From: Daniel Stenberg Date: Tue, 4 Jan 2011 22:09:19 +0000 (+0100) Subject: curlcheck.h: add fail() X-Git-Tag: curl-7_21_4~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5d888ea69a30f29d7b100e4e7a8fcccd0a9e81;p=thirdparty%2Fcurl.git 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. --- diff --git a/tests/unit/curlcheck.h b/tests/unit/curlcheck.h index 88ee80afab..57babe5c74 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 \