mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-18 14:48:17 +01:00
dm: test: Correct assertion in dm_test_part()
This obscures the line number. Update the test to avoid make sure that the line which failed is displayed, so it is possible to diagnose the failure. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3d01254140
commit
a0fb9de60d
@ -11,8 +11,8 @@
|
|||||||
#include <dm/test.h>
|
#include <dm/test.h>
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
|
|
||||||
static inline int do_test(struct unit_test_state *uts, int expected,
|
static int do_test(struct unit_test_state *uts, int expected,
|
||||||
const char *part_str, bool whole)
|
const char *part_str, bool whole)
|
||||||
{
|
{
|
||||||
struct blk_desc *mmc_dev_desc;
|
struct blk_desc *mmc_dev_desc;
|
||||||
struct disk_partition part_info;
|
struct disk_partition part_info;
|
||||||
@ -54,11 +54,8 @@ static int dm_test_part(struct unit_test_state *uts)
|
|||||||
|
|
||||||
oldbootdevice = env_get("bootdevice");
|
oldbootdevice = env_get("bootdevice");
|
||||||
|
|
||||||
#define test(expected, part_str, whole) do { \
|
#define test(expected, part_str, whole) \
|
||||||
ret = do_test(uts, expected, part_str, whole); \
|
ut_assertok(do_test(uts, expected, part_str, whole))
|
||||||
if (ret) \
|
|
||||||
goto out; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
env_set("bootdevice", NULL);
|
env_set("bootdevice", NULL);
|
||||||
test(-ENODEV, NULL, true);
|
test(-ENODEV, NULL, true);
|
||||||
@ -92,7 +89,6 @@ static int dm_test_part(struct unit_test_state *uts)
|
|||||||
test(2, "1#test2", false);
|
test(2, "1#test2", false);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
|
||||||
env_set("bootdevice", oldbootdevice);
|
env_set("bootdevice", oldbootdevice);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user