summaryrefslogtreecommitdiff
path: root/src/libstrongswan/tests/test_suite.h
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
commit5313d2d78ca150515f7f5eb39801c100690b6b29 (patch)
treec78e420367283bb1b16f14210b12687cdfbd26eb /src/libstrongswan/tests/test_suite.h
parent6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (diff)
downloadvyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.tar.gz
vyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.zip
Imported Upstream version 5.1.1
Diffstat (limited to 'src/libstrongswan/tests/test_suite.h')
-rw-r--r--src/libstrongswan/tests/test_suite.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libstrongswan/tests/test_suite.h b/src/libstrongswan/tests/test_suite.h
index edf16f128..2a2861323 100644
--- a/src/libstrongswan/tests/test_suite.h
+++ b/src/libstrongswan/tests/test_suite.h
@@ -30,10 +30,13 @@
*/
#define CHECK_FOR_LEAKS() do \
{ \
- if (lib->leak_detective->leaks(lib->leak_detective)) { \
- lib->leak_detective->report(lib->leak_detective, TRUE); \
+ if (lib->leak_detective) \
+ { \
+ if (lib->leak_detective->leaks(lib->leak_detective)) { \
+ lib->leak_detective->report(lib->leak_detective, TRUE); \
+ } \
+ ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0); \
} \
- ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0); \
} \
while(0)
@@ -55,7 +58,10 @@ static void name (int _i CK_ATTRIBUTE_UNUSED) \
{ \
tcase_fn_start(""#name, __FILE__, __LINE__); \
dbg_default_set_level(LEVEL_SILENT); \
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
+ if (lib->leak_detective) \
+ { \
+ lib->leak_detective->set_state(lib->leak_detective, TRUE); \
+ }
#undef END_TEST
#define END_TEST \
@@ -73,7 +79,10 @@ static void name (int _i CK_ATTRIBUTE_UNUSED) \
static void name() \
{ \
lib->set(lib, UNIT_TEST_FIXTURE_USED, (void*)TRUE); \
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
+ if (lib->leak_detective) \
+ { \
+ lib->leak_detective->set_state(lib->leak_detective, TRUE); \
+ }
/**
* End a setup function