All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] sandbox: test: Show hex values on failure
Date: Fri, 11 Oct 2019 16:16:46 -0600	[thread overview]
Message-ID: <20191011221650.19482-2-sjg@chromium.org> (raw)
In-Reply-To: <20191011221650.19482-1-sjg@chromium.org>

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>
---

 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

  reply	other threads:[~2019-10-11 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 22:16 [U-Boot] [PATCH 0/5] dm: regmap: Various fixes for regmap Simon Glass
2019-10-11 22:16 ` Simon Glass [this message]
2019-10-12  2:13   ` [U-Boot] [PATCH 1/5] sandbox: test: Show hex values on failure Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 2/5] sandbox: Drop 'const' from sandbox_write() Simon Glass
2019-10-12  2:12   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 3/5] sandbox: test: Add a prototype for sandbox_set_enable_memio() Simon Glass
2019-10-12  2:13   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 4/5] dm: regmap: Fix mask in regmap_update_bits() Simon Glass
2019-10-12  2:17   ` Bin Meng
2019-10-25  9:40   ` Jean-Jacques Hiblot
2019-10-29 23:21   ` sjg at google.com
2019-10-11 22:16 ` [U-Boot] [PATCH 5/5] test: regmap: check the values read from the regmap Simon Glass
2019-10-12  2:41   ` Bin Meng
2019-10-29 23:21   ` sjg at google.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191011221650.19482-2-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.