From: Simon Glass Date: Fri, 11 Oct 2019 16:16:46 -0600 Subject: [U-Boot] [PATCH 1/5] sandbox: test: Show hex values on failure In-Reply-To: <20191011221650.19482-1-sjg@chromium.org> References: <20191011221650.19482-1-sjg@chromium.org> Message-ID: <20191011221650.19482-2-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- include/test/ut.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/test/ut.h b/include/test/ut.h index 19bcb8c3748..fbfde10719f 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; \ } \ } -- 2.23.0.700.g56cf767bdb-goog