Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
2671666e
Commit
2671666e
authored
Feb 20, 2019
by
Mark Andrews
Committed by
Evan Hunt
Mar 05, 2019
Browse files
improve clang / cmocka integration
(cherry picked from commit
cb913177
)
parent
ae383b7b
Pipeline
#11024
passed with stages
in 12 minutes and 48 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/dns/tests/result_test.c
View file @
2671666e
...
...
@@ -15,6 +15,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
...
...
lib/isc/include/isc/util.h
View file @
2671666e
...
...
@@ -220,15 +220,26 @@
#ifdef UNIT_TESTING
extern
void
mock_assert
(
const
int
result
,
const
char
*
const
expression
,
const
char
*
const
file
,
const
int
line
);
/*
* Allow clang to determine that the following code is not reached
* by calling abort() if the condition fails. The abort() will
* never be executed as mock_assert() and _assert_true() longjmp
* or exit if the condition is false.
*/
#define REQUIRE(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(expression)) ? \
(mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
#define ENSURE(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(int)(expression)) ? \
(mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
#define INSIST(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(expression)) ? \
(mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
#define INVARIANT(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(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()))
#else
/* UNIT_TESTING */
/*
* Assertions
...
...
lib/isc/inet_ntop.c
View file @
2671666e
...
...
@@ -16,6 +16,7 @@
#include <errno.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <isc/net.h>
...
...
lib/isc/tests/inet_ntop_test.c
View file @
2671666e
...
...
@@ -16,6 +16,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
#define UNIT_TESTING
...
...
lib/isc/tests/netaddr_test.c
View file @
2671666e
...
...
@@ -15,6 +15,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <stdbool.h>
...
...
lib/isc/tests/result_test.c
View file @
2671666e
...
...
@@ -15,6 +15,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
...
...
lib/isccc/tests/result_test.c
View file @
2671666e
...
...
@@ -15,6 +15,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment