From cb1a40859029f33184355475e51fec95afb79a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sat, 22 Jul 2023 03:03:09 +0300 Subject: init Just some C wares; hmap, list, optional, unit tests. --- utest/utest-test.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 utest/utest-test.c (limited to 'utest/utest-test.c') 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); -- cgit v1.2.3