From 0ba697fe8c3a05fc7723529fa20ea9c7865e5b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 1 Dec 2020 15:08:49 +0100 Subject: [PATCH] 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 #include See !2204 for other header requirements for including cmocka.h. --- lib/isc/tests/task_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/isc/tests/task_test.c b/lib/isc/tests/task_test.c index 9cbe1c99c6..f4a44a12c5 100644 --- a/lib/isc/tests/task_test.c +++ b/lib/isc/tests/task_test.c @@ -23,6 +23,8 @@ #define UNIT_TESTING +#include + #include #include #include