aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-10-07 23:41:03 +0200
committerTom Rini <trini@konsulko.com>2023-12-10 09:21:33 -0500
commit335007af19a17ceed05074c5680ac9d457bfc98a (patch)
tree460b6b7cb5ffa22f6561070544ba9c6a90ee6d0f
parent17c88a7f1da5ba3da4be9e284710c1aab8e4ec99 (diff)
downloadu-boot-335007af19a17ceed05074c5680ac9d457bfc98a.zip
u-boot-335007af19a17ceed05074c5680ac9d457bfc98a.tar.gz
u-boot-335007af19a17ceed05074c5680ac9d457bfc98a.tar.bz2
test: bdinfo: Test both bdinfo and bdinfo -a
Factor out the core of test for all bdinfo output into bdinfo_test_all() and then reuse it to verify that both 'bdinfo' and 'bdinfo -a' print all the bdinfo output. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r--test/cmd/bdinfo.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c
index b2896e8..509a8b5 100644
--- a/test/cmd/bdinfo.c
+++ b/test/cmd/bdinfo.c
@@ -130,15 +130,11 @@ static int lmb_test_dump_all(struct unit_test_state *uts, struct lmb *lmb)
return 0;
}
-static int bdinfo_test_full(struct unit_test_state *uts)
+static int bdinfo_test_all(struct unit_test_state *uts)
{
struct bd_info *bd = gd->bd;
int i;
- /* Test moving the working BDINFO to a new location */
- ut_assertok(console_record_reset_enable());
- ut_assertok(run_commandf("bdinfo"));
-
ut_assertok(test_num_l(uts, "boot_params", 0));
for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
@@ -212,6 +208,17 @@ static int bdinfo_test_full(struct unit_test_state *uts)
ut_assertok(test_num_l(uts, "malloc base", gd_malloc_start()));
}
+ return 0;
+}
+
+static int bdinfo_test_full(struct unit_test_state *uts)
+{
+ /* Test BDINFO full print */
+ ut_assertok(console_record_reset_enable());
+ ut_assertok(run_commandf("bdinfo"));
+ ut_assertok(bdinfo_test_all(uts));
+ ut_assertok(run_commandf("bdinfo -a"));
+ ut_assertok(bdinfo_test_all(uts));
ut_assertok(ut_check_console_end(uts));
return 0;