vsnprintf(buf, BUFSIZ, msg, ap);
va_end(ap);
send_failure_info (buf);
- if (cur_fork_status() == CK_FORK)
+ if (cur_fork_status() == CK_FORK) {
+#ifdef _POSIX_VERSION
exit(1);
+#endif /* _POSIX_VERSION */
+ }
}
}
tcase_run_checked_setup(sr, tc);
tfun->fn(i);
tcase_run_checked_teardown(tc);
+#ifdef _POSIX_VERSION
exit(EXIT_SUCCESS);
+#endif /* _POSIX_VERSION */
} else {
group_pid = pid;
}
pid_w = waitpid(pid, &status, 0);
#endif /* _POSIX_VERSION */
} while (pid_w == -1);
- if (waserror(status, 0))
+ if (waserror(status, 0)) {
+#ifdef _POSIX_VERSION
exit(EXIT_FAILURE);
+#endif /* _POSIX_VERSION */
+ }
}
+#ifdef _POSIX_VERSION
exit(EXIT_SUCCESS);
+#endif /* _POSIX_VERSION */
}
static int waserror (int CK_ATTRIBUTE_UNUSED status, int signal_expected)
/* FIXME: all these line numbers are kind of hard to maintain */
static master_test_t master_tests[] = {
{ "Simple Tests", 18, CK_FAILURE, "Failure expected" },
- { "Simple Tests", 24, CK_ERROR, "Early exit with return value 1" },
+ { "Simple Tests", 23, CK_ERROR, "Early exit with return value 1" },
{ "Simple Tests", -1, CK_PASS, "Passed" },
{ "Simple Tests", -1, CK_FAILURE, "This test should fail" },
{ "Simple Tests", -1, CK_PASS, "Passed" },
fail("Failure expected"); /* line 18*/
}
END_TEST
-
START_TEST(test_mark_lno)
{
- mark_point(); /* line 24*/
- exit(EXIT_FAILURE); /* should fail at line 24*/
+ mark_point(); /* line 23*/
+#ifdef _POSIX_VERSION
+ exit(EXIT_FAILURE); /* should fail at line 23*/
+#endif /* _POSIX_VERSION */
}
END_TEST
-
START_TEST(test_pass)
{
fail_unless(1 == 1, "This test should pass");