8 static void setup_fail(void **state) {
11 /* We need to fail in setup */
12 assert_non_null(NULL);
15 static void int_test_ignored(void **state) {
16 /* should not be called */
17 assert_non_null(*state);
20 static void setup_ok(void **state) {
21 int *answer = malloc(sizeof(int));
23 assert_non_null(answer);
29 /* A test case that does check if an int is equal. */
30 static void int_test_success(void **state) {
33 assert_int_equal(*answer, 42);
36 static void teardown(void **state) {
41 const UnitTest tests[] = {
42 unit_test_setup_teardown(int_test_ignored, setup_fail, teardown),
43 unit_test_setup_teardown(int_test_success, setup_ok, teardown),
46 return run_tests(tests);