From 13cf53265372d021fdb37b04acb5fc9879783d05 Mon Sep 17 00:00:00 2001 From: brarcher Date: Sat, 4 Jan 2014 19:26:38 +0000 Subject: [PATCH] only test test_invalid_set_fork_status if not mem leak checking This test leaks memory, as the allocated suite, test case, and suite runner remain after the call to srunner_run_all() calls exit(2) due to the error. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1030 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- tests/check_check_master.c | 2 ++ tests/check_check_sub.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tests/check_check_master.c b/tests/check_check_master.c index 99f1832..eec3c90 100644 --- a/tests/check_check_master.c +++ b/tests/check_check_master.c @@ -216,7 +216,9 @@ static master_test_t master_tests[] = { #endif /* HAVE_FORK */ #if defined(HAVE_FORK) && HAVE_FORK==1 +#if MEMORY_LEAKING_TESTS_ENABLED { "Check Errors Tests", CK_FAILURE, "Early exit with return value 2" }, +#endif #endif /* HAVE_FORK */ { "Core", CK_PASS, "Passed" }, diff --git a/tests/check_check_sub.c b/tests/check_check_sub.c index 3f91139..b1b6313 100644 --- a/tests/check_check_sub.c +++ b/tests/check_check_sub.c @@ -636,6 +636,7 @@ END_TEST #endif /* HAVE_FORK */ #if defined(HAVE_FORK) && HAVE_FORK == 1 +#if MEMORY_LEAKING_TESTS_ENABLED START_TEST(test_invalid_set_fork_status) #define LINENO_invalid_set_fork_status _STR(__LINE__) { @@ -650,6 +651,7 @@ START_TEST(test_invalid_set_fork_status) srunner_run_all(sr, CK_SILENT); } END_TEST +#endif /* MEMORY_LEAKING_TESTS_ENABLED */ #endif /* HAVE_FORK */ START_TEST(test_srunner) @@ -892,7 +894,9 @@ void init_master_tests_lineno(int num_master_tests) { #if defined(HAVE_FORK) && HAVE_FORK==1 /* Check Errors Tests */ +#if MEMORY_LEAKING_TESTS_ENABLED LINENO_invalid_set_fork_status, +#endif #endif /* HAVE_FORK */ /* Core */ @@ -1203,7 +1207,9 @@ Suite *make_sub_suite(void) tcase_add_test (tc_messaging_and_fork, test_fork2_pass); tcase_add_test (tc_messaging_and_fork, test_fork2_fail); +#if MEMORY_LEAKING_TESTS_ENABLED tcase_add_test_raise_signal (tc_errors, test_invalid_set_fork_status, 2); +#endif #endif /* HAVE_FORK */ return s; -- 2.49.0