Lines Matching refs:tc
59 TCase *tc = (TCase *) calloc(1, sizeof(TCase)); in tcase_create() local
60 if (tc != NULL) { in tcase_create()
61 tc->name = name; in tcase_create()
63 return tc; in tcase_create()
67 suite_add_tcase(Suite *suite, TCase *tc) in suite_add_tcase() argument
70 assert(tc != NULL); in suite_add_tcase()
71 assert(tc->next_tcase == NULL); in suite_add_tcase()
73 tc->next_tcase = suite->tests; in suite_add_tcase()
74 suite->tests = tc; in suite_add_tcase()
78 tcase_add_checked_fixture(TCase *tc, in tcase_add_checked_fixture() argument
82 assert(tc != NULL); in tcase_add_checked_fixture()
83 tc->setup = setup; in tcase_add_checked_fixture()
84 tc->teardown = teardown; in tcase_add_checked_fixture()
88 tcase_add_test(TCase *tc, tcase_test_function test) in tcase_add_test() argument
90 assert(tc != NULL); in tcase_add_test()
91 if (tc->allocated == tc->ntests) { in tcase_add_test()
92 int nalloc = tc->allocated + 100; in tcase_add_test()
94 tcase_test_function *new_tests = realloc(tc->tests, new_size); in tcase_add_test()
96 tc->tests = new_tests; in tcase_add_test()
97 tc->allocated = nalloc; in tcase_add_test()
99 tc->tests[tc->ntests] = test; in tcase_add_test()
100 tc->ntests++; in tcase_add_test()
104 tcase_free(TCase *tc) in tcase_free() argument
106 if (! tc) { in tcase_free()
110 free(tc->tests); in tcase_free()
111 free(tc); in tcase_free()
168 TCase *tc; in srunner_run_all() local
171 tc = suite->tests; in srunner_run_all()
172 while (tc != NULL) { in srunner_run_all()
174 for (i = 0; i < tc->ntests; ++i) { in srunner_run_all()
177 if (tc->setup != NULL) { in srunner_run_all()
183 tc->setup(); in srunner_run_all()
190 (tc->tests[i])(); in srunner_run_all()
193 if (tc->teardown != NULL) { in srunner_run_all()
198 tc->teardown(); in srunner_run_all()
201 tc = tc->next_tcase; in srunner_run_all()