aboutsummaryrefslogtreecommitdiff
path: root/tests/torture.c
blob: 6fa4c459e71f38efebbb04888562eef7e05a1a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "torture.h"

#include <stdio.h>

void torture_create_case(Suite *s, const char *name, TFun function) {
  TCase *tc_new = tcase_create(name);
  tcase_set_timeout(tc_new, 30);
  suite_add_tcase (s, tc_new);
  tcase_add_test(tc_new, function);
}

void torture_create_case_fixture(Suite *s, const char *name, TFun function, void (*setup)(void), void (*teardown)(void)) {
  TCase *tc_new = tcase_create(name);
  tcase_add_checked_fixture(tc_new, setup, teardown);
  tcase_set_timeout(tc_new, 30);
  suite_add_tcase (s, tc_new);
  tcase_add_test(tc_new, function);
}

void torture_create_case_timeout(Suite *s, const char *name, TFun function, int timeout) {
  TCase *tc_new = tcase_create(name);
  tcase_set_timeout(tc_new, timeout);
  suite_add_tcase (s, tc_new);
  tcase_add_test(tc_new, function);
}