From 275908d246cddb2fbb4638c97660a5557860e9a4 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Tue, 29 Dec 2015 19:18:24 -0500 Subject: [PATCH] regressions: Add ck_test convenience macro. --- regressions/common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/regressions/common.h b/regressions/common.h index 6d76ddc..1377532 100644 --- a/regressions/common.h +++ b/regressions/common.h @@ -24,6 +24,9 @@ * SUCH DAMAGE. */ +#ifndef CK_COMMON_H +#define CK_COMMON_H + #include #include #include @@ -454,3 +457,10 @@ ck_error(const char *message, ...) va_end(ap); exit(EXIT_FAILURE); } + +#define ck_test(A, B, ...) do { \ + if (A) \ + ck_error(B, ##__VA_ARGS__); \ +} while (0) + +#endif /* CK_COMMON_H */