regressions: Add ck_test convenience macro.

ck_pring
Samy Al Bahra 9 years ago
parent 2686ca0223
commit 275908d246

@ -24,6 +24,9 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef CK_COMMON_H
#define CK_COMMON_H
#include <ck_cc.h> #include <ck_cc.h>
#include <ck_pr.h> #include <ck_pr.h>
#include <stdarg.h> #include <stdarg.h>
@ -454,3 +457,10 @@ ck_error(const char *message, ...)
va_end(ap); va_end(ap);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#define ck_test(A, B, ...) do { \
if (A) \
ck_error(B, ##__VA_ARGS__); \
} while (0)
#endif /* CK_COMMON_H */

Loading…
Cancel
Save