diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2013-11-01 13:32:07 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2013-11-01 13:32:07 +0100 |
commit | 5313d2d78ca150515f7f5eb39801c100690b6b29 (patch) | |
tree | c78e420367283bb1b16f14210b12687cdfbd26eb /src/libstrongswan/tests/test_suite.h | |
parent | 6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (diff) | |
download | vyos-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.h | 19 |
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 |