7 #define _END } while(0);
9 /* msg must be a string literal */
10 #define _ASSERT(expr, msg, ...) _BEGIN \
12 fprintf(stderr, "Assertion failed: " msg "\n", __VA_ARGS__); \
16 #define SUCCEED _BEGIN return 1; _END
17 #define ASSERT(expr) _ASSERT(expr, "%s", #expr)
18 /* This macro is meant for int-like things that can print with %d */
19 #define ASSERT_EQUAL(expected, actual) _ASSERT((expected) == (actual), \
20 "%s == %s (expected %d, was %d)", \
21 #actual, #expected, expected, actual);
23 struct TestDescription {
25 int (*testfunc)(void);
28 #endif /* GLKUNIT_H */