]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: test: Improve partition test error output
authorJoshua Watt <jpewhacker@gmail.com>
Mon, 3 Jul 2023 13:39:53 +0000 (08:39 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 17 Jul 2023 19:39:55 +0000 (15:39 -0400)
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/part.c

index d5c58d6e3f7c9bc622e30866a06143fc9437a8be..7dd8bc7a3c4ebebaef11fc2268433613a1d9d50f 100644 (file)
@@ -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;
 }