diff options
Diffstat (limited to 'utest/utest-test.c')
-rw-r--r-- | utest/utest-test.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utest/utest-test.c b/utest/utest-test.c new file mode 100644 index 0000000..591ee32 --- /dev/null +++ b/utest/utest-test.c @@ -0,0 +1,34 @@ +#include "utest.h" + +static int a, b; + +/* This should pass */ +TEST_BEGIN(test_pass) +{ + asserteq(a, 0); + assertneq(a, b); + expect(b > a, "expected b > a"); + TEST_OUT +} +TEST_END + +/* This should fail */ +TEST_BEGIN(test_fail) +{ + expect(0, "oopsie!"); + TEST_OUT +} +TEST_END + +void test_init(void) +{ + a = 0, b = 1; + printf("hello, world!\n\n"); +} + +void test_destroy(void) +{ + printf("\ngood bye!\n"); +} + +RUN_TEST_SUITE(test_init, test_destroy, test_pass, test_fail); |