diff options
Diffstat (limited to 'test.h')
-rw-r--r-- | test.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +/* See LICENSE file for copyright and license details. */ + + +#define assert(EXPR)\ + do {\ + if (EXPR)\ + break;\ + fprintf(stderr, "Failed at %s:%i: %s\n", __FILE__, __LINE__, #EXPR);\ + exit(1);\ + } while (0) + + + +#define strcmp(...) test_strcmp(__VA_ARGS__) +static inline int +test_strcmp(const char *a, const char *b) +{ + return (!a || !b) ? !b - !a : (strcmp)(a, b); +} |