Skip to content

Commit

Permalink
dm: test: Improve partition test error output
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
JPEWdev authored and trini committed Jul 17, 2023
1 parent 19c961e commit 44ef285
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/dm/part.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 44ef285

Please sign in to comment.