]> 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>
Wed, 9 Dec 2020 09:46:16 +0000 (10:46 +0100)
commit9b2184893d167a201e1edff80c18c3dc81fb4851
tree2178e4c71a327688929a03393b8902cac1ba7258
parent012946eadcbc92a8b96645bfc5f414874e2ff4d2
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.

(cherry picked from commit 0ba697fe8c3a05fc7723529fa20ea9c7865e5b6c)
lib/isc/tests/task_test.c