continue;
}
- fail_if(i - passed > sub_nfailed);
+ fail_if(i - passed > sub_nfailed, NULL);
tr = tr_fail_array[i - passed];
- fail_unless(tr != NULL);
+ fail_unless(tr != NULL, NULL);
got_msg = tr_msg(tr);
expected_msg = master_tests[i].msg;
if (strcmp(got_msg, expected_msg) != 0) {
continue;
}
- fail_if(i - passed > sub_nfailed);
+ fail_if(i - passed > sub_nfailed, NULL);
tr = tr_fail_array[i - passed];
- fail_unless(tr != NULL);
+ fail_unless(tr != NULL, NULL);
line_no = master_tests[i].line_nos;
if (line_no > 0 && tr_lno(tr) != line_no) {
char *emsg = malloc(MAXSTR);
continue;
}
- fail_if(i - passed > sub_nfailed);
+ fail_if(i - passed > sub_nfailed, NULL);
tr = tr_fail_array[i - passed];
- fail_unless(tr != NULL);
+ fail_unless(tr != NULL, NULL);
fail_unless(master_tests[i].failure_type == tr_rtype(tr),
"Failure type wrong for test %d", i);
}
int i;
for (i = 0; i < sub_nfailed; i++) {
TestResult *tr = tr_fail_array[i];
- fail_unless(tr != NULL);
+ fail_unless(tr != NULL, NULL);
fail_unless(tr_lfile(tr) != NULL, "Bad file name for test %d", i);
fail_unless(strstr(tr_lfile(tr), "check_check_sub.c") != 0,
"Bad file name for test %d", i);
fail_unless(9999, "This test should pass");
}
END_TEST
-
+/* FIXME: this should really be called test_fail_unless */
START_TEST(test_fail)
{
fail_unless(1 == 2, "This test should fail");
}
END_TEST
-
+#if defined(__GNUC__)
START_TEST(test_fail_no_msg)
{
fail_unless(4 == 5);
}
END_TEST
-
+#endif /* __GNUC__ */
START_TEST(test_fail_if_null_msg)
{
fail_if(2 != 3, NULL);
}
END_TEST
-
+#if defined(__GNUC__)
START_TEST(test_fail_if_no_msg)
{
fail_if(4 != 5);
}
END_TEST
-
+#endif /* __GNUC__ */
START_TEST(test_fail_vararg_msg_1)
{
int x = 3;
fail("%d == %d", x, y);
}
END_TEST
-
+#if defined(__GNUC__)
START_TEST(test_fail_empty)
{ /* plain fail() doesn't compile with xlc in C mode because of `, ## __VA_ARGS__' problem */
- fail(NULL);
+ fail();
}
END_TEST
-
+#endif /* __GNUC__ */
/* FIXME: all these line numbers are kind of hard to maintain */
START_TEST(test_ck_abort)
{
if((pid = fork()) < 0) {
fail("Failed to fork new process");
} else if (pid > 0) {
- fail_unless(1);
+ fail_unless(1, NULL);
kill(pid, SIGKILL);
} else {
for (;;) {
} else if (pid > 0) {
check_waitpid_and_exit(pid);
} else {
- fail_unless(1);
+ fail_unless(1, NULL);
check_waitpid_and_exit(0);
}
}
if((pid2 = check_fork()) < 0) {
fail("Failed to fork new process");
} else if (pid2 == 0) {
- fail_unless(1);
+ fail_unless(1, NULL);
check_waitpid_and_exit(0);
}
check_waitpid_and_exit(pid2);
SRunner *sr;
s = suite_create("Check Servant3");
- fail_unless(s != NULL);
+ fail_unless(s != NULL, NULL);
sr = srunner_create(NULL);
- fail_unless(sr != NULL);
+ fail_unless(sr != NULL, NULL);
srunner_add_suite(sr, s);
srunner_free(sr);
sr = srunner_create(NULL);
- fail_unless(sr != NULL);
+ fail_unless(sr != NULL, NULL);
srunner_add_suite(sr, NULL);
srunner_free(sr);
s = suite_create("Check Servant3");
- fail_unless(s != NULL);
+ fail_unless(s != NULL, NULL);
sr = srunner_create(s);
- fail_unless(sr != NULL);
+ fail_unless(sr != NULL, NULL);
srunner_free(sr);
}
END_TEST
tcase_add_test (tc_simple, test_fail_if_pass);
tcase_add_test (tc_simple, test_fail_if_fail);
tcase_add_test (tc_simple, test_fail_null_msg);
+#if defined(__GNUC__)
tcase_add_test (tc_simple, test_fail_no_msg);
+#endif /* __GNUC__ */
tcase_add_test (tc_simple, test_fail_if_null_msg);
+#if defined(__GNUC__)
tcase_add_test (tc_simple, test_fail_if_no_msg);
+#endif /* __GNUC__ */
tcase_add_test (tc_simple, test_fail_vararg_msg_1);
tcase_add_test (tc_simple, test_fail_vararg_msg_2);
tcase_add_test (tc_simple, test_fail_vararg_msg_3);
+#if defined(__GNUC__)
tcase_add_test (tc_simple, test_fail_empty);
+#endif /* __GNUC__ */
tcase_add_test (tc_simple, test_ck_abort);
tcase_add_test (tc_simple, test_ck_abort_msg);