diff options
Diffstat (limited to 'tests/unit/curlcheck.h')
-rw-r--r-- | tests/unit/curlcheck.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/unit/curlcheck.h b/tests/unit/curlcheck.h new file mode 100644 index 000000000..c34f99093 --- /dev/null +++ b/tests/unit/curlcheck.h @@ -0,0 +1,31 @@ +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + */ + +#include "test.h" + +#define fail_unless(expr, msg) \ + if(!(expr)) { \ + fprintf(stderr, "%s:%d Assertion '%s' failed: %s" , \ + __FILE__, __LINE__, #expr, msg); \ + unitfail++; \ + } + +extern int unitfail; + +#define UNITTEST_START \ + int test(char *unused) \ + { \ + (void)unused; \ + unit_setup(); + +#define UNITTEST_STOP \ + unit_stop(); \ + return unitfail; \ + } + |