]> granicus.if.org Git - check/commitdiff
Add test for setting invalid for status
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 4 Jan 2014 18:33:51 +0000 (18:33 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 4 Jan 2014 18:33:51 +0000 (18:33 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1017 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/check_check_master.c
tests/check_check_sub.c

index 62e0dab14a3115b31c78560a4831a7ddb296884f..99f1832e37c505fb4d592add82faf673eefc0ada 100644 (file)
@@ -216,6 +216,7 @@ static master_test_t master_tests[] = {
 #endif  /* HAVE_FORK */
 
 #if defined(HAVE_FORK) && HAVE_FORK==1
+  { "Check Errors Tests", CK_FAILURE,    "Early exit with return value 2" },
 #endif /* HAVE_FORK */
 
   { "Core", CK_PASS,    "Passed" },
index 6c2f56cc3c2383343612f8d42af8d61502501509..3f911399bb6339b3b2fb294c4e385f832f3372a9 100644 (file)
@@ -636,6 +636,20 @@ END_TEST
 #endif /* HAVE_FORK */
 
 #if defined(HAVE_FORK) && HAVE_FORK == 1
+START_TEST(test_invalid_set_fork_status)
+  #define LINENO_invalid_set_fork_status _STR(__LINE__)
+{
+   Suite *s1;
+   TCase *tc1;
+   SRunner *sr;
+   s1 = suite_create ("suite1");
+   tc1 = tcase_create ("tcase1");
+   tcase_add_test (tc1, test_pass);
+   sr = srunner_create(s1);
+   srunner_set_fork_status (sr, -1);
+   srunner_run_all(sr, CK_SILENT);
+}
+END_TEST
 #endif /* HAVE_FORK */
 
 START_TEST(test_srunner)
@@ -878,6 +892,7 @@ void init_master_tests_lineno(int num_master_tests) {
 
 #if defined(HAVE_FORK) && HAVE_FORK==1
 /* Check Errors Tests */
+    LINENO_invalid_set_fork_status,
 #endif /* HAVE_FORK */
 
 /* Core */
@@ -1187,6 +1202,8 @@ Suite *make_sub_suite(void)
   tcase_add_test (tc_messaging_and_fork, test_fork1c_fail);
   tcase_add_test (tc_messaging_and_fork, test_fork2_pass);
   tcase_add_test (tc_messaging_and_fork, test_fork2_fail);
+
+  tcase_add_test_raise_signal (tc_errors, test_invalid_set_fork_status, 2);
 #endif /* HAVE_FORK */
 
   return s;