]> granicus.if.org Git - check/commitdiff
add test for tcase_add_loop_test_raise_signal
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 17 Feb 2014 12:07:52 +0000 (12:07 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 17 Feb 2014 12:07:52 +0000 (12:07 +0000)
There was originally no test for this

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1122 64e312b2-a51f-0410-8e61-82d0ca0eb02a

src/check.h.in
tests/check_check_exit.c

index 4720706cc0a8fb9a955c4b0bd2c91201713980c0..4f22da0c99de9a07a62cd48fba73088710457061 100644 (file)
@@ -235,8 +235,6 @@ CK_DLL_EXP TCase *CK_EXPORT tcase_create(const char *name);
  *
  * The added test is expected to terminate by throwing the given signal
  *
- * @todo add a test case; this is untested as part of Check's tests.
- *
  * @param tc test case to add test to
  * @param tf function to add to test case
  * @param signal expected signal for test function to throw in order for
index 72fd07b6bf756792a1708283a7d5d2382f25f112..9bd493968a1eeed0614ea7120aebbc04580fee97 100644 (file)
@@ -35,6 +35,13 @@ START_TEST(loop_early_exit_allowed_exit)
 }
 END_TEST
 
+START_TEST(loop_early_exit_signal_segv)
+{
+       raise (SIGSEGV);
+       ck_abort_msg("Should've exitted...");
+}
+END_TEST
+
 Suite *make_exit_suite(void)
 {
   Suite *s;
@@ -48,5 +55,6 @@ Suite *make_exit_suite(void)
   tcase_add_exit_test(tc,test_early_exit_with_allowed_error,-1);
   tcase_add_loop_test(tc,loop_early_exit_normal,0,5);
   tcase_add_loop_exit_test(tc,loop_early_exit_allowed_exit,-2,0,5);
+  tcase_add_loop_test_raise_signal(tc, loop_early_exit_signal_segv, SIGSEGV, 0, 5);
   return s;
 }