From: Joshua Watt <jpewhacker@gmail.com>
To: u-boot@lists.denx.de
Cc: Joshua Watt <JPEWhacker@gmail.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH v2 2/5] dm: test: Improve partition test error output
Date: Mon, 3 Jul 2023 08:39:53 -0500 [thread overview]
Message-ID: <20230703133959.3880305-3-JPEWhacker@gmail.com> (raw)
In-Reply-To: <20230703133959.3880305-1-JPEWhacker@gmail.com>
Improve the logging when the partition test fails so that it is clear
what went wrong, shown with actual values.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
test/dm/part.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/test/dm/part.c b/test/dm/part.c
index d5c58d6e3f..7dd8bc7a3c 100644
--- a/test/dm/part.c
+++ b/test/dm/part.c
@@ -17,10 +17,12 @@ static int do_test(struct unit_test_state *uts, int expected,
struct blk_desc *mmc_dev_desc;
struct disk_partition part_info;
- ut_asserteq(expected,
- part_get_info_by_dev_and_name_or_num("mmc", part_str,
- &mmc_dev_desc,
- &part_info, whole));
+ int ret = part_get_info_by_dev_and_name_or_num("mmc", part_str,
+ &mmc_dev_desc,
+ &part_info, whole);
+
+ ut_assertf(expected == ret, "test(%d, \"%s\", %d) == %d", expected,
+ part_str, whole, ret);
return 0;
}
--
2.33.0
next prev parent reply other threads:[~2023-07-03 13:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 19:59 [PATCH 0/2] Fix 'mbr' command with hybrid MBR/GPT Joshua Watt
2023-06-23 19:59 ` [PATCH 1/2] disk: part: Add API to get partitions with specific driver Joshua Watt
2023-06-26 9:07 ` Simon Glass
2023-06-28 13:33 ` Joshua Watt
2023-06-29 19:09 ` Simon Glass
2023-06-23 20:00 ` [PATCH 2/2] cmd: mbr: Force DOS driver to be used for verify Joshua Watt
2023-07-03 13:39 ` [PATCH v2 0/5] Fix 'mbr' command with hybrid MBR/GPT Joshua Watt
2023-07-03 13:39 ` [PATCH v2 1/5] dm: test: Fix partition test to use mmc2 Joshua Watt
2023-07-04 2:40 ` Simon Glass
2023-07-05 0:16 ` Jaehoon Chung
2023-07-18 13:58 ` Tom Rini
2023-07-03 13:39 ` Joshua Watt [this message]
2023-07-04 2:40 ` [PATCH v2 2/5] dm: test: Improve partition test error output Simon Glass
2023-07-18 13:58 ` Tom Rini
2023-07-03 13:39 ` [PATCH v2 3/5] disk: part: Add API to get partitions with specific driver Joshua Watt
2023-07-04 2:40 ` Simon Glass
2023-07-18 13:58 ` Tom Rini
2023-07-03 13:39 ` [PATCH v2 4/5] dm: test: Add test for part_get_info_by_type Joshua Watt
2023-07-04 2:40 ` Simon Glass
2023-07-18 13:58 ` Tom Rini
2023-07-03 13:39 ` [PATCH v2 5/5] cmd: mbr: Force DOS driver to be used for verify Joshua Watt
2023-07-04 2:40 ` Simon Glass
2023-07-18 13:58 ` Tom Rini
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=20230703133959.3880305-3-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox