]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
teach cppcheck that _assert_int_equal and _assert_int_not_equal don't return on failure
authorMark Andrews <marka@isc.org>
Tue, 16 Apr 2019 05:03:18 +0000 (15:03 +1000)
committerMark Andrews <marka@isc.org>
Tue, 4 Jun 2019 03:04:10 +0000 (23:04 -0400)
lib/isc/include/isc/util.h
lib/isc/tests/aes_test.c
lib/isc/tests/errno_test.c

index 53b31f1f74f28832efbc4ee416a1fa53716dd08a..4dfe1d77e4aa7798e0a9bad456c5b341fcc30c01 100644 (file)
@@ -219,6 +219,10 @@ extern void mock_assert(const int result, const char* const expression,
        (mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
 #define _assert_true(c, e, f, l) \
        ((c) ? (void)0 : (_assert_true(0, e, f, l), abort()))
+#define _assert_int_equal(a, b, f, l) \
+       (((a) == (b)) ? (void)0 : (_assert_int_equal(a, b, f, l), abort()))
+#define _assert_int_not_equal(a, b, f, l) \
+       (((a) != (b)) ? (void)0 : (_assert_int_not_equal(a, b, f, l), abort()))
 #else /* UNIT_TESTING */
 /*
  * Assertions
index 9ead547faa45645776d5be983f5c846c1f5fef93..20795fee9f272d5f7c309b57a450b8eb14aa827a 100644 (file)
 
 #if HAVE_CMOCKA
 
+#include <setjmp.h>
 #include <stdarg.h>
 #include <stddef.h>
-#include <setjmp.h>
+#include <stdlib.h>
 
 #include <stdio.h>
 #include <string.h>
index 1872f7dbdd85dd6782cd032adf9cf251204eb8c1..b17937e81572a851dc57e71a5237b5f30125f282 100644 (file)
 
 #if HAVE_CMOCKA
 
+#include <setjmp.h>
 #include <stdarg.h>
 #include <stddef.h>
-#include <setjmp.h>
+#include <stdlib.h>
 
 #include <string.h>
 #include <sys/errno.h>