summaryrefslogtreecommitdiff
path: root/lib/torture
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-10-02 13:02:48 +0200
committerAndrew Bartlett <abartlet@samba.org>2014-10-03 08:34:05 +0200
commitfae589be2af8efe36713536203ae715d29d78b5b (patch)
tree00f030c349ef5501953de8bfaf7258cb25fb0ba2 /lib/torture
parent7f242d035778d581ef90d26fe02537d5955e655d (diff)
downloadsamba-fae589be2af8efe36713536203ae715d29d78b5b.tar.gz
torture: add torture_assert_int_not_equal
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/torture')
-rw-r--r--lib/torture/torture.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 3a080429a81..e6f323abc57 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -414,6 +414,16 @@ void torture_result(struct torture_context *test,
} \
} while(0)
+#define torture_assert_int_not_equal(torture_ctx,got,not_expected,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); \
+ return false; \
+ } \
+ } while(0)
+
#define torture_assert_u64_equal(torture_ctx,got,expected,cmt)\
do { uint64_t __got = (got), __expected = (expected); \
if (__got != __expected) { \