#include "utest.h" static int a, b; void test_pass_run(utest *t) { asserteq(t, a, 0); assertneq(t, a, b); expect(t, b > a, "expected b > a"); } void test_fail_run(utest *t) { expect(t, 0, "oopsie!"); } void test_crash_run(utest *t) { int *x = NULL; *x = 8; } void test_timeout_run(utest *t) { sleep(10); } void test_init(void) { a = 0, b = 1; printf("hello, world!\n\n"); } void test_cleanup(void) { printf("\ngood bye!\n"); } utest tests[] = { UTEST_INIT_S(test_pass, 0), UTEST_INIT_S(test_fail, 0), UTEST_INIT_S(test_crash, 0), UTEST_INIT_S(test_timeout, 1), }; RUN_TEST_SUITE(test_init, test_cleanup, tests);