lib/torture: add torture_assert_u64_not_equal_goto macro
authorGünther Deschner <gd@samba.org>
Wed, 24 Feb 2016 18:23:21 +0000 (19:23 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 21 Mar 2016 23:23:21 +0000 (00:23 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/torture/torture.h

index 356922a295d9de67fe4f6523c7d10b8f7c8156f4..e710873fb39423c7297192eca7cf558eeaa366eb 100644 (file)
@@ -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) { \