summaryrefslogtreecommitdiff
path: root/lib/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-02-24 19:23:21 +0100
committerJeremy Allison <jra@samba.org>2016-03-22 00:23:21 +0100
commitc5c3f91c6fd1ac3282d2fa27e262af097f0adfca (patch)
tree0613575694e0f6f7f3d6fd66512bd7632ed1e99d /lib/torture
parent2b799880b91f2ee44531644c62916f9a50531d04 (diff)
downloadsamba-c5c3f91c6fd1ac3282d2fa27e262af097f0adfca.tar.gz
lib/torture: add torture_assert_u64_not_equal_goto macro
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/torture')
-rw-r--r--lib/torture/torture.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 356922a295d..e710873fb39 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -479,6 +479,18 @@ void torture_result(struct torture_context *test,
} \
} while(0)
+#define torture_assert_u64_not_equal_goto(torture_ctx,got,not_expected,ret,label,cmt)\
+ do { uint64_t __got = (got), __not_expected = (not_expected); \
+ if (__got == __not_expected) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" was %llu (0x%llX), expected a different number: %s", \
+ (unsigned long long)__got, (unsigned long long)__got, \
+ cmt); \
+ ret = false; \
+ goto label; \
+ } \
+ } while(0)
+
#define torture_assert_errno_equal(torture_ctx,expected,cmt)\
do { int __expected = (expected); \
if (errno != __expected) { \