diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-01-04 23:09:19 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-01-04 23:13:10 +0100 |
commit | 7c5d888ea69a30f29d7b100e4e7a8fcccd0a9e81 (patch) | |
tree | e5bcd302d44213d6d0a0a5ea5a4d4de9c5cbb253 /tests/unit | |
parent | adb49ad8bb280b586b387ba930c0681afee03923 (diff) |
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.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/curlcheck.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/curlcheck.h b/tests/unit/curlcheck.h index 88ee80afa..57babe5c7 100644 --- a/tests/unit/curlcheck.h +++ b/tests/unit/curlcheck.h @@ -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 \ |