From 929063bb126b45cfe175a0e9518905bfcc8c95a2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 22 Nov 2010 12:38:41 +0100 Subject: lib/torture: add torture_assert_u64_equal_goto() metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sat Dec 4 12:55:44 CET 2010 on sn-devel-104 --- lib/torture/torture.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/torture') diff --git a/lib/torture/torture.h b/lib/torture/torture.h index 605ba341eb..aeedd71e6b 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -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) { \ -- cgit