diff options
Diffstat (limited to 'test/test.h')
-rw-r--r-- | test/test.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/test/test.h b/test/test.h index 35f704f..a1c0957 100644 --- a/test/test.h +++ b/test/test.h @@ -5,23 +5,27 @@ static int test_passed = 0; static int test_failed = 0; /* Terminate current test with error */ -#define fail() return __LINE__ +#define fail() return __LINE__ /* Successful end of the test case */ #define done() return 0 /* Check single condition */ -#define check(cond) do { if (!(cond)) fail(); } while (0) +#define check(cond) \ + do { \ + if (!(cond)) \ + fail(); \ + } while (0) /* Test runner */ static void test(int (*func)(void), const char *name) { - int r = func(); - if (r == 0) { - test_passed++; - } else { - test_failed++; - printf("FAILED: %s (at line %d)\n", name, r); - } + int r = func(); + if (r == 0) { + test_passed++; + } else { + test_failed++; + printf("FAILED: %s (at line %d)\n", name, r); + } } #endif /* __TEST_H__ */ |