curlcheck.h: add fail()

fail is a new function/macro that a test case can use to indicate a test
failure for cases when the standard macros are not sufficient.
This commit is contained in:
Daniel Stenberg 2011-01-04 23:09:19 +01:00
parent adb49ad8bb
commit 7c5d888ea6
1 changed files with 10 additions and 0 deletions

View File

@ -30,6 +30,16 @@
unitfail++; \
}
/* fail() is for when the test case figured out by itself that a check
proved a failure */
#define fail(msg) do { \
fprintf(stderr, "%s:%d test failed: '%s'\n", \
__FILE__, __LINE__, msg); \
unitfail++; \
} while(0)
extern int unitfail;
#define UNITTEST_START \