summaryrefslogtreecommitdiff
path: root/include/test/ut.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-11 16:16:46 -0600
committerSimon Glass <sjg@chromium.org>2019-10-27 10:56:41 -0600
commit91a8c95623af3aad1c9579f6ae9eff274d4c1b0a (patch)
tree5bf357e656c4bfcfa3c4ea4f6aa1684369fccec2 /include/test/ut.h
parentffc379b42c85466e1dd4c8fee8268801f26d2ab8 (diff)
sandbox: test: Show hex values on failure
Quite a few tests use addresses or hex values for comparisons. Add hex output for test failures, e.g.: 0x55ca22fa == reg: Expected 0x55ca22fa (1439310586), got 0x55ea22fb (1441407739) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/test/ut.h')
-rw-r--r--include/test/ut.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/test/ut.h b/include/test/ut.h
index 19bcb8c374..fbfde10719 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -61,7 +61,8 @@ void ut_failf(struct unit_test_state *uts, const char *fname, int line,
if (val1 != val2) { \
ut_failf(uts, __FILE__, __LINE__, __func__, \
#expr1 " == " #expr2, \
- "Expected %d, got %d", val1, val2); \
+ "Expected %#x (%d), got %#x (%d)", val1, val1, \
+ val2, val2); \
return CMD_RET_FAILURE; \
} \
}