aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-01-04 23:09:19 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-01-04 23:13:10 +0100
commit7c5d888ea69a30f29d7b100e4e7a8fcccd0a9e81 (patch)
treee5bcd302d44213d6d0a0a5ea5a4d4de9c5cbb253
parentadb49ad8bb280b586b387ba930c0681afee03923 (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.
-rw-r--r--tests/unit/curlcheck.h10
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 \