Skip to content

Commit

Permalink
check test_one_worker works finally
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Jun 23, 2009
1 parent 8e475be commit c407045
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions check_work.c
Expand Up @@ -21,6 +21,8 @@ struct agg {

int main_check(int argc, char **argv);

#if 0

static void test_collect_worker(void *data0, void *data1) {
fail_unless(data0 != NULL, "wsc");
fail_unless(data1 != NULL, "wsc");
Expand Down Expand Up @@ -68,11 +70,14 @@ START_TEST(test_collect)
}
END_TEST

#endif

static void test_one_worker(void *data0, void *data1) {
char *s0 = data0;
char *s1 = data1;
fail_unless(strcmp(s0, "hello"), "tcw");
fail_unless(strcmp(s1, "world"), "tcw");

fail_unless(strcmp(s0, "hello") == 0, "tcw");
fail_unless(strcmp(s1, "world") == 0, "tcw");
}

START_TEST(test_one)
Expand All @@ -92,7 +97,7 @@ static Suite* work_suite(void)
/* Core test case */
TCase *tc_core = tcase_create("core");
tcase_add_test(tc_core, test_one);
tcase_add_test(tc_core, test_collect);
// tcase_add_test(tc_core, test_collect);
suite_add_tcase(s, tc_core);

return s;
Expand All @@ -108,6 +113,7 @@ static void *check_thread(void *arg) {
int number_failed;
Suite *s = work_suite();
SRunner *sr = srunner_create(s);
srunner_set_fork_status(sr, CK_NOFORK);
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
Expand Down

0 comments on commit c407045

Please sign in to comment.