torture: add torture_assert_u64_not_equal()
authorMichael Adam <obnox@samba.org>
Thu, 2 Oct 2014 11:03:05 +0000 (13:03 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Oct 2014 06:34:05 +0000 (08:34 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
lib/torture/torture.h

index e6f323abc5779be56572378838f72e07378225b2..d6a92177767b4f11363f41d73eb05abd44aa9d45 100644 (file)
@@ -449,6 +449,17 @@ void torture_result(struct torture_context *test,
        } \
        } while(0)
 
+#define torture_assert_u64_not_equal(torture_ctx,got,not_expected,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); \
+               return false; \
+       } \
+       } while(0)
+
 #define torture_assert_errno_equal(torture_ctx,expected,cmt)\
        do { int __expected = (expected); \
        if (errno != __expected) { \