START_TEST(test_early_exit_normal)
{
exit(0);
- fail("Should've exitted...");
+ ck_abort_msg("Should've exitted...");
}
END_TEST
START_TEST(test_early_exit_with_allowed_error)
{
exit(-1);
- fail("Should've exitted...");
+ ck_abort_msg("Should've exitted...");
}
END_TEST
START_TEST(loop_early_exit_normal)
{
exit(0);
- fail("Should've exitted...");
+ ck_abort_msg("Should've exitted...");
}
END_TEST
START_TEST(loop_early_exit_allowed_exit)
{
exit(-2);
- fail("Should've exitted...");
+ ck_abort_msg("Should've exitted...");
}
END_TEST
static void fixture_sub_setup (void)
{
- fail("Test failure in fixture");
+ ck_abort_msg("Test failure in fixture");
}
static SRunner *fixture_sr;
snprintf(errm, sizeof(errm),
"Bad setup tr msg (%s)", trm);
- fail (errm);
+ ck_abort_msg (errm);
}
free(trm);
}
START_TEST(test_sub_ch_setup_norm)
{
if (testval_up == 1)
- fail("Setup not run correctly");
+ ck_abort_msg("Setup not run correctly");
else if (testval_up > 3)
- fail("Test side-effects persist across runs");
+ ck_abort_msg("Test side-effects persist across runs");
testval_up++;
}
END_TEST
static void setup_sub_fail (void)
{
- fail("Failed setup"); /* check_check_fixture.c:129 */
+ ck_abort_msg("Failed setup"); /* check_check_fixture.c:129 */
}
static void teardown_sub_fail (void)
{
- fail("Failed teardown");
+ ck_abort_msg("Failed teardown");
}
static void setup_sub_signal (void)
START_TEST(test_sub_fail)
{
- fail("Should never run");
+ ck_abort_msg("Should never run");
}
END_TEST
snprintf(errm, sizeof(errm),
"Bad failed checked setup tr msg (%s)", trm);
- fail (errm);
+ ck_abort_msg (errm);
}
}
END_TEST
snprintf(errm, sizeof(errm),
"Msg was (%s)", trm);
- fail (errm);
+ ck_abort_msg (errm);
}
}
END_TEST
snprintf(errm, sizeof(errm),
"Bad failed checked teardown tr msg (%s)", trm);
- fail (errm);
+ ck_abort_msg (errm);
}
}
snprintf(errm, sizeof(errm),
"Bad msg (%s)", trm);
- fail (errm);
+ ck_abort_msg (errm);
}
}
char *emsg = malloc(MAXSTR);
snprintf(emsg, MAXSTR,"For test %d: Expected %s, got %s",
i, expected_msg, got_msg);
- fail(emsg);
+ ck_abort_msg(emsg);
free(emsg);
}
}
char *emsg = malloc(MAXSTR);
snprintf(emsg, MAXSTR, "For test %d: Expected lno %d, got %d",
i, line_no, tr_lno(tr));
- fail(emsg);
+ ck_abort_msg(emsg);
free(emsg);
}
}
char *emsg = malloc (MAXSTR);
snprintf(emsg, MAXSTR,"Expected %s, got %s",
master_tests[_i].tcname, tcname);
- fail(emsg);
+ ck_abort_msg(emsg);
free(emsg);
}
}
char *emsg = malloc (MAXSTR);
snprintf(emsg, MAXSTR,"Expected %s, got %s",
master_tests[_i].msg, msg);
- fail(emsg);
+ ck_abort_msg(emsg);
free(emsg);
}
}
START_TEST(test_lno)
{
- fail("Failure expected");
+ ck_abort_msg("Failure expected");
#define LINENO_lno _STR(__LINE__)
}
END_TEST
i++;
mark_point();
raise(SIGFPE);
- fail("Shouldn't reach here");
+ ck_abort_msg("Shouldn't reach here");
}
END_TEST
srunner_create(NULL);
srunner_run_all (NULL, -1);
srunner_free (NULL);
- fail("Completed properly");
+ ck_abort_msg("Completed properly");
}
END_TEST
SRunner *sr = srunner_create(NULL);
srunner_run_all (sr, CK_NORMAL);
srunner_free (sr);
- fail("Completed properly");
+ ck_abort_msg("Completed properly");
}
END_TEST
pid_t pid;
if((pid = fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid > 0) {
fail_unless(1, NULL);
kill(pid, SIGKILL);
pid_t pid;
if((pid = fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid > 0) {
- fail("Expected fail");
+ ck_abort_msg("Expected fail");
kill(pid, SIGKILL);
} else {
for (;;) {
pid_t pid;
if((pid = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid > 0) {
check_waitpid_and_exit(pid);
} else {
pid_t pid;
if((pid = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid == 0) {
- fail("Expected fail");
+ ck_abort_msg("Expected fail");
check_waitpid_and_exit(0);
}
check_waitpid_and_exit(pid);
pid_t pid2;
if((pid = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid > 0) {
if((pid2 = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid2 == 0) {
fail_unless(1, NULL);
check_waitpid_and_exit(0);
pid_t pid2;
if((pid = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid > 0) {
if((pid2 = check_fork()) < 0) {
- fail("Failed to fork new process");
+ ck_abort_msg("Failed to fork new process");
} else if (pid2 == 0) {
- fail("Expected fail");
+ ck_abort_msg("Expected fail");
check_waitpid_and_exit(0);
}
check_waitpid_and_exit(pid2);
- fail("Expected fail");
+ ck_abort_msg("Expected fail");
}
check_waitpid_and_exit(pid);
}
START_TEST(test_2nd_suite)
{
- fail("We failed");
+ ck_abort_msg("We failed");
}
END_TEST
START_TEST(test_fail)
{
- fail("This test fails");
+ ck_abort_msg("This test fails");
}
END_TEST
START_TEST(test_fail)
{
- fail("Failure");
+ ck_abort_msg("Failure");
}
END_TEST
START_TEST(test_fail)
{
- fail("Failure");
+ ck_abort_msg("Failure");
}
END_TEST
START_TEST(test_fail)
{
- fail("Failure");
+ ck_abort_msg("Failure");
}
END_TEST
START_TEST(test_xml_esc_fail_msg)
{
- fail("fail \" ' < > & message");
+ ck_abort_msg("fail \" ' < > & message");
}
END_TEST