From: Artem Bityutskiy Date: Mon, 14 Jun 2010 07:06:05 +0000 (+0300) Subject: ubi-tests: teach errmsg and failed return error code X-Git-Tag: v1.4.0~41 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b2a06b3039b41958d9e1526a267c8abeab61388f;p=mtd-utils.git ubi-tests: teach errmsg and failed return error code Just like we do in ubi-utils. Signed-off-by: Artem Bityutskiy --- diff --git a/tests/ubi-tests/common.h b/tests/ubi-tests/common.h index 3821098..86357cb 100644 --- a/tests/ubi-tests/common.h +++ b/tests/ubi-tests/common.h @@ -35,11 +35,15 @@ extern "C" { #define min(a, b) ((a) < (b) ? (a) : (b)) -#define errmsg(fmt, ...) \ - __errmsg(TESTNAME, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__) +#define errmsg(fmt, ...) ({ \ + __errmsg(TESTNAME, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__); \ + -1; \ +}) -#define failed(name) \ - __failed(TESTNAME, __FUNCTION__, __LINE__, name) +#define failed(name) ({ \ + __failed(TESTNAME, __FUNCTION__, __LINE__, name); \ + -1; \ +}) #define initial_check(argc, argv) \ __initial_check(TESTNAME, argc, argv)