void suite_add_tcase (Suite * s, TCase * tc) { if (s == NULL || tc == NULL) return; check_list_add_end (s->tclst, tc); }
static void tcase_add_fixture (TCase *tc, SFun setup, SFun teardown, int ischecked) { if (setup) { if (ischecked) check_list_add_end (tc->ch_sflst, fixture_create(setup, ischecked)); else check_list_add_end (tc->unch_sflst, fixture_create(setup, ischecked)); } /* Add teardowns at front so they are run in reverse order. */ if (teardown) { if (ischecked) check_list_add_front (tc->ch_tflst, fixture_create(teardown, ischecked)); else check_list_add_front (tc->unch_tflst, fixture_create(teardown, ischecked)); } }
static void srunner_add_failure (SRunner * sr, TestResult * tr) { check_list_add_end (sr->resultlst, tr); sr->stats->n_checked++; /* count checks during setup, test, and teardown */ if (tr->rtype == CK_FAILURE) sr->stats->n_failed++; else if (tr->rtype == CK_ERROR) sr->stats->n_errors++; }
void _tcase_add_test (TCase *tc, TFun fn, const char *name, int _signal, int allowed_exit_value, int start, int end) { TF * tf; if (tc == NULL || fn == NULL || name == NULL) return; tf = emalloc (sizeof(TF)); /* freed in tcase_free */ tf->fn = fn; tf->loop_start = start; tf->loop_end = end; tf->signal = _signal; /* 0 means no signal expected */ tf->allowed_exit_value = allowed_exit_value; /* 0 is default successful exit */ tf->name = name; check_list_add_end (tc->tflst, tf); }
void srunner_register_lfun(SRunner * sr, FILE * lfile, int close, LFun lfun, enum print_output printmode) { Log *l = (Log *)emalloc(sizeof(Log)); if(printmode == CK_ENV) { printmode = get_env_printmode(); } l->lfile = lfile; l->lfun = lfun; l->close = close; l->mode = printmode; check_list_add_end(sr->loglst, l); return; }