]> git.ipfire.org Git - thirdparty/bind9.git/commit
The cmocka.h header MUST be included before isc/util.h gets included
authorOndřej Surý <ondrej@sury.org>
Tue, 1 Dec 2020 14:08:49 +0000 (15:08 +0100)
committerOndřej Surý <ondrej@sury.org>
Tue, 1 Dec 2020 15:47:25 +0000 (16:47 +0100)
commit0ba697fe8c3a05fc7723529fa20ea9c7865e5b6c
tree898e84ad020144373f1e1f48b4f2dd5431af521b
parentc26a2ea13401291c7c286fc4a88787866735241f
The cmocka.h header MUST be included before isc/util.h gets included

The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...)  to
be cmocka "fake" assertions.  However that means that cmocka.h needs to
be included after UNIT_TESTING is defined but before isc/util.h is
included.  Because isc/util.h is included in most of the project headers
this means that the sequence MUST be:

    #define UNIT_TESTING
    #include <cmocka.h>

    #include <isc/_anything_.h>

See !2204 for other header requirements for including cmocka.h.
lib/isc/tests/task_test.c