END_TEST START_TEST(test_check_failure_lfiles) { int i; for (i = 0; i < sub_nfailed; i++) { TestResult *tr = tr_fail_array[i]; ck_assert_msg(tr != NULL, NULL); ck_assert_msg(tr_lfile(tr) != NULL, "Bad file name for test %d", i); ck_assert_msg(strstr(tr_lfile(tr), "check_check_sub.c") != 0, "Bad file name for test %d", i); } }
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); }