test: Print out actual result when test_succ fails
authorDaisuke Nojiri <dnojiri@chromium.org>
Wed, 18 May 2016 17:24:59 +0000 (10:24 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Wed, 18 May 2016 23:41:25 +0000 (16:41 -0700)
BUG=none
BRANCH=tot
TEST=make runtests

Change-Id: I419b01d2dd0798bd0a3fe155e41d6aa3d328716a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/345586
Reviewed-by: Randall Spangler <rspangler@chromium.org>
tests/test_common.c

index dd3f0ea..e6c32f6 100644 (file)
@@ -139,7 +139,7 @@ int test_succ(int result,
   } else {
     fprintf(stderr, "%s: %s, %s ... " COL_RED "FAILED\n" COL_STOP,
            preamble, desc, comment);
-    fprintf(stderr, "  Expected SUCCESS, got: 0x%lx\n", (long)result);
+    fprintf(stderr, "  Expected SUCCESS, got: 0x%x (%d)\n", result, result);
     gTestSuccess = 0;
   }
   return !result;