diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-14 10:06:05 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-14 10:07:42 +0300 |
commit | b2a06b3039b41958d9e1526a267c8abeab61388f (patch) | |
tree | eed05f137dcebd590cafaf6e94ab1f5e0568ffdc /tests | |
parent | 6bbe5558adeead2970b5090782466e87f8801f53 (diff) |
ubi-tests: teach errmsg and failed return error code
Just like we do in ubi-utils.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ubi-tests/common.h | 12 |
1 files changed, 8 insertions, 4 deletions
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) |