blob: e2ad1adc9b55102c91c6a35ea01580daee70969f [file] [log] [blame]
// Macros to simplify testing functions.
#ifndef SRC_SERVER_TESTS_TEST_H_
#define SRC_SERVER_TESTS_TEST_H_
#define EXPECT(a, m) \
do { \
if (!a) { \
printf("[%s] failed: %s\n", #a, m); \
printf("%s -> FAILED\n", __func__); \
return; \
} \
} while (0)
#define EXPECT_STREQ(a, b) \
do { \
if (strcmp(a, b)) { \
printf("expected [%s == %s]\n", #a, #b); \
printf(" a = \"%s\"\n", a); \
printf(" b = \"%s\"\n", b); \
printf("%s -> FAILED\n", __func__); \
return; \
} \
} while (0)
#define DONE() \
printf("%s -> OK\n", __func__)
#endif /* SRC_SERVER_TESTS_TEST_H_ */