summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/test.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/include/ouroboros/test.h b/include/ouroboros/test.h
index a88b5548..096e145c 100644
--- a/include/ouroboros/test.h
+++ b/include/ouroboros/test.h
@@ -29,22 +29,25 @@
#include <unistd.h>
#include <sys/wait.h>
-#define TEST_START() \
- do { \
- printf("%s started.\n", __func__); \
- fflush(stdout); \
- } while(0)
-#define TEST_SUCCESS() \
- do { \
- printf("%s succeeded.\n", __func__); \
- fflush(stdout); \
- } while(0)
+#define TEST_START() \
+ do { \
+ printf("%s started.\n", __func__); \
+ fflush(stdout); \
+ } while (0)
+#define TEST_SUCCESS() \
+ do { \
+ printf("%s succeeded.\n", __func__); \
+ fflush(stdout); \
+ } while (0)
-#define TEST_FAIL() \
- do { \
- printf("%s failed.\n", __func__); \
- fflush(stdout); \
- } while(0)
+#define TEST_FAIL() \
+ do { \
+ printf("%s failed.\n", __func__); \
+ fflush(stdout); \
+ } while (0)
+
+#define TEST_END(result) \
+ do { if (result == 0) TEST_SUCCESS(); else TEST_FAIL(); } while (0)
static int __attribute__((unused)) test_assert_fail(int(* testfunc)(void))
{