From 7c5d888ea69a30f29d7b100e4e7a8fcccd0a9e81 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Jan 2011 23:09:19 +0100 Subject: 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. --- tests/unit/curlcheck.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/unit/curlcheck.h') 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 \ -- cgit v1.2.3