lib/torture: also print intergers as HEX values in the torture_assert macros
authorStefan Metzmacher <metze@samba.org>
Fri, 9 Apr 2010 11:23:53 +0000 (13:23 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 9 Apr 2010 14:28:29 +0000 (16:28 +0200)
metze

lib/torture/torture.h

index af61ac189f8dfffb62c2381ed2c7d543daffa253..6eb2c1593d2a0e3806a58db18adb8c379bfa27a9 100644 (file)
@@ -372,8 +372,8 @@ void torture_result(struct torture_context *test,
        do { int __got = (got), __expected = (expected); \
        if (__got != __expected) { \
                torture_result(torture_ctx, TORTURE_FAIL, \
-                       __location__": "#got" was %d, expected %d: %s", \
-                       __got, __expected, cmt); \
+                       __location__": "#got" was %d (0x%X), expected %d (0x%X): %s", \
+                       __got, __got, __expected, __expected, cmt); \
                return false; \
        } \
        } while(0)
@@ -382,8 +382,8 @@ void torture_result(struct torture_context *test,
        do { int __got = (got), __expected = (expected); \
        if (__got != __expected) { \
                torture_result(torture_ctx, TORTURE_FAIL, \
-                       __location__": "#got" was %d, expected %d: %s", \
-                       __got, __expected, cmt); \
+                       __location__": "#got" was %d (0x%X), expected %d (0x%X): %s", \
+                       __got, __got, __expected, __expected, cmt); \
                ret = false; \
                goto label; \
        } \
@@ -393,8 +393,10 @@ void torture_result(struct torture_context *test,
        do { uint64_t __got = (got), __expected = (expected); \
        if (__got != __expected) { \
                torture_result(torture_ctx, TORTURE_FAIL, \
-                       __location__": "#got" was %llu, expected %llu: %s", \
-                       (unsigned long long)__got, (unsigned long long)__expected, cmt); \
+                       __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); \
                return false; \
        } \
        } while(0)