lib/torture: add torture_assert_u64_equal_goto()
authorStefan Metzmacher <metze@samba.org>
Mon, 22 Nov 2010 11:38:41 +0000 (12:38 +0100)
committerStefan Metzmacher <metze@samba.org>
Sat, 4 Dec 2010 11:55:44 +0000 (12:55 +0100)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Dec  4 12:55:44 CET 2010 on sn-devel-104

lib/torture/torture.h

index 605ba341eba834ba2e66f0b0e8b3112538fe6f51..aeedd71e6b5ecf1fdac14d7b33be4795cd193afd 100644 (file)
@@ -416,6 +416,19 @@ void torture_result(struct torture_context *test,
        } \
        } while(0)
 
+#define torture_assert_u64_equal_goto(torture_ctx,got,expected,ret,label,cmt)\
+       do { uint64_t __got = (got), __expected = (expected); \
+       if (__got != __expected) { \
+               torture_result(torture_ctx, TORTURE_FAIL, \
+                       __location__": "#got" was %llu (0x%llX), expected %llu (0x%llX): %s", \
+                       (unsigned long long)__got, (unsigned long long)__got, \
+                       (unsigned long long)__expected, (unsigned long long)__expected, \
+                       cmt); \
+               ret = false; \
+               goto label; \
+       } \
+       } while(0)
+
 #define torture_assert_errno_equal(torture_ctx,expected,cmt)\
        do { int __expected = (expected); \
        if (errno != __expected) { \