diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-03-27 03:04:09 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-09 12:21:26 +0300 |
commit | ae30cb958e86364b653c3e46cdc889e0324660a2 (patch) | |
tree | 6ae858f6e9f52a978cfb5b6301f652a494a98e22 /lib/torture | |
parent | 9d1f8bcca9e39d1e0caa9377f30c290b0738f080 (diff) | |
download | samba-ae30cb958e86364b653c3e46cdc889e0324660a2.tar.gz samba-ae30cb958e86364b653c3e46cdc889e0324660a2.tar.bz2 samba-ae30cb958e86364b653c3e46cdc889e0324660a2.zip |
torture: add torture_assert_goto() convenience macro
Diffstat (limited to 'lib/torture')
-rw-r--r-- | lib/torture/torture.h | 7 |
1 files changed, 7 insertions, 0 deletions
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)) { \ |