summaryrefslogtreecommitdiff
path: root/lib/torture
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2015-03-27 10:02:28 +0100
committerGünther Deschner <gd@samba.org>2015-03-30 13:41:25 +0200
commitbc858fda4237dd75934ab6c29ae68ba4b0aa04cc (patch)
treeae81ffc68a414e75b7af6d7645e9b85855866ae1 /lib/torture
parent54e68e94ee878878df394e596ca5ea118b105bba (diff)
downloadsamba-bc858fda4237dd75934ab6c29ae68ba4b0aa04cc.tar.gz
torture: add torture_assert_int_not_equal_goto
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'lib/torture')
-rw-r--r--lib/torture/torture.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index d6a92177767..efdba182459 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -424,6 +424,17 @@ void torture_result(struct torture_context *test,
} \
} while(0)
+#define torture_assert_int_not_equal_goto(torture_ctx,got,not_expected,ret,label,cmt)\
+ do { int __got = (got), __not_expected = (not_expected); \
+ if (__got == __not_expected) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" was %d (0x%X), expected a different number: %s", \
+ __got, __got, cmt); \
+ ret = false; \
+ goto label; \
+ } \
+ } while(0)
+
#define torture_assert_u64_equal(torture_ctx,got,expected,cmt)\
do { uint64_t __got = (got), __expected = (expected); \
if (__got != __expected) { \