2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

teach cppcheck that _assert_int_equal and _assert_int_not_equal don't return on failure

This commit is contained in:
Mark Andrews
2019-04-16 15:03:18 +10:00
parent ce52ac1178
commit 5d5d751c7f
3 changed files with 8 additions and 2 deletions

View 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

View File

@@ -11,9 +11,10 @@
#if HAVE_CMOCKA
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View File

@@ -11,9 +11,10 @@
#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>