From ae30cb958e86364b653c3e46cdc889e0324660a2 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 27 Mar 2010 03:04:09 +0200 Subject: torture: add torture_assert_goto() convenience macro --- lib/torture/torture.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/torture/torture.h b/lib/torture/torture.h index cb2c02ba3e..af61ac189f 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -238,6 +238,13 @@ void torture_result(struct torture_context *test, return false; \ } +#define torture_assert_goto(torture_ctx,expr,ret,label,cmt) \ + if (!(expr)) { \ + torture_result(torture_ctx, TORTURE_FAIL, __location__": Expression `%s' failed: %s", __STRING(expr), cmt); \ + ret = false; \ + goto label; \ + } + #define torture_assert_werr_equal(torture_ctx, got, expected, cmt) \ do { WERROR __got = got, __expected = expected; \ if (!W_ERROR_EQUAL(__got, __expected)) { \ -- cgit