END_TEST START_TEST(test_send_test_error) { TestResult *tr; setup_messaging(); send_ctx_info(CK_CTX_SETUP); send_loc_info("abc123.c", 10); send_ctx_info(CK_CTX_TEST); send_loc_info("abc124.c", 22); send_loc_info("abc125.c", 25); tr = receive_test_result(1); teardown_messaging(); ck_assert_msg (tr != NULL, "No test result received"); ck_assert_msg (tr_ctx(tr) == CK_CTX_TEST, "Bad CTX received"); ck_assert_msg (strcmp(tr_lfile(tr), "abc125.c") == 0, "Bad loc file received"); ck_assert_msg (tr_lno(tr) == 25, "Bad loc line received"); if (tr != NULL) tr_free(tr); }
END_TEST START_TEST(test_send_big) { TestResult *tr; int i; setup_messaging(); send_ctx_info(CK_CTX_SETUP); send_loc_info("abc123.c", 10); for (i = 0; i < 10000; i++) { send_ctx_info(CK_CTX_TEST); send_loc_info("abc124.c", i); } tr = receive_test_result(0); teardown_messaging(); ck_assert_msg (tr != NULL, "No test result received"); ck_assert_msg (tr_ctx(tr) == CK_CTX_TEST, "Bad CTX received"); ck_assert_msg (strcmp(tr_lfile(tr), "abc124.c") == 0, "Bad loc file received"); ck_assert_msg (tr_lno(tr) == i -1, "Bad loc line received"); if (tr != NULL) tr_free(tr); }
static TestResult * receive_result_info_nofork (const char *tcname, const char *tname, int iter) { TestResult *tr; tr = receive_test_result (0); if (tr == NULL) eprintf ("Failed to receive test result", __FILE__, __LINE__); tr->tcname = tcname; tr->tname = tname; tr->iter = iter; set_nofork_info (tr); return tr; }
static TestResult * receive_result_info_fork (const char *tcname, const char *tname, int iter, int status, int expected_signal, unsigned char allowed_exit_value) { TestResult *tr; tr = receive_test_result (waserror (status, expected_signal)); if (tr == NULL) eprintf ("Failed to receive test result", __FILE__, __LINE__); tr->tcname = tcname; tr->tname = tname; tr->iter = iter; set_fork_info (tr, status, expected_signal, allowed_exit_value); return tr; }