diff options
author | Tom Rini <trini@konsulko.com> | 2021-03-28 20:29:39 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-28 20:29:39 -0400 |
commit | 4906238191b90be7aec2269ba8cd6aeb161cd312 (patch) | |
tree | 1bab411fe047542ab69342a90fba6110f4dbe124 /test | |
parent | 9c7335e4e68355a96bd5a411b2a5f85866823c58 (diff) | |
parent | e5021221db3faf7e90a295d6eb045fbf5c6a908b (diff) | |
download | u-boot-4906238191b90be7aec2269ba8cd6aeb161cd312.tar.gz |
Merge tag 'dm-pull-28mar21' of git://git.denx.de/u-boot-dm into next
binman support for expanding entries, connections
misc fixes and improvements to sandbox, etc.
x86 CBFS improvements
x86 coreboot improvements
Diffstat (limited to 'test')
-rw-r--r-- | test/cmd/test_echo.c | 3 | ||||
-rw-r--r-- | test/dm/sf.c | 10 | ||||
-rw-r--r-- | test/lib/test_print.c | 8 |
3 files changed, 17 insertions, 4 deletions
diff --git a/test/cmd/test_echo.c b/test/cmd/test_echo.c index aa5cebc4e78..9d60d7d1a0b 100644 --- a/test/cmd/test_echo.c +++ b/test/cmd/test_echo.c @@ -44,9 +44,10 @@ static int lib_test_hush_echo(struct unit_test_state *uts) int i; for (i = 0; i < ARRAY_SIZE(echo_data); ++i) { + ut_silence_console(uts); console_record_reset_enable(); ut_assertok(run_command(echo_data[i].cmd, 0)); - gd->flags &= ~GD_FLG_RECORD; + ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(echo_data[i].expected, uts->actual_str); diff --git a/test/dm/sf.c b/test/dm/sf.c index cc1fc4d69af..17d43fef3bc 100644 --- a/test/dm/sf.c +++ b/test/dm/sf.c @@ -21,7 +21,7 @@ /* Simple test of sandbox SPI flash */ static int dm_test_spi_flash(struct unit_test_state *uts) { - struct udevice *dev; + struct udevice *dev, *emul; int full_size = 0x200000; int size = 0x10000; u8 *src, *dst; @@ -51,6 +51,14 @@ static int dm_test_spi_flash(struct unit_test_state *uts) ut_assertok(spi_flash_read_dm(dev, 0, size, dst)); ut_asserteq_mem(src, dst, size); + /* Try the write-protect stuff */ + ut_assertok(uclass_first_device_err(UCLASS_SPI_EMUL, &emul)); + ut_asserteq(0, spl_flash_get_sw_write_prot(dev)); + sandbox_sf_set_block_protect(emul, 1); + ut_asserteq(1, spl_flash_get_sw_write_prot(dev)); + sandbox_sf_set_block_protect(emul, 0); + ut_asserteq(0, spl_flash_get_sw_write_prot(dev)); + /* Check mapping */ ut_assertok(dm_spi_get_mmap(dev, &map_base, &map_size, &offset)); ut_asserteq(0x1000, map_base); diff --git a/test/lib/test_print.c b/test/lib/test_print.c index 12972f1bcd6..a60a5a51f12 100644 --- a/test/lib/test_print.c +++ b/test/lib/test_print.c @@ -18,12 +18,14 @@ DECLARE_GLOBAL_DATA_PTR; static int test_print_freq(struct unit_test_state *uts, uint64_t freq, char *expected) { + ut_silence_console(uts); console_record_reset_enable(); print_freq(freq, ";\n"); - gd->flags &= ~GD_FLG_RECORD; + ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(expected, uts->actual_str); ut_assertok(ut_check_console_end(uts)); + return 0; } @@ -46,12 +48,14 @@ LIB_TEST(lib_test_print_freq, 0); static int test_print_size(struct unit_test_state *uts, uint64_t freq, char *expected) { + ut_silence_console(uts); console_record_reset_enable(); print_size(freq, ";\n"); - gd->flags &= ~GD_FLG_RECORD; + ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(expected, uts->actual_str); ut_assertok(ut_check_console_end(uts)); + return 0; } |