diff options
author | Sean Anderson <seanga2@gmail.com> | 2023-10-14 16:47:58 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-17 20:50:52 -0400 |
commit | b5bf83b6912a67d2a147cf866c87854bd43cc863 (patch) | |
tree | f283a1236d7c294756c5c4592ec12e3ffbd5d85e | |
parent | c56468a60d503aee45bc39542307a9d8e6cf5a40 (diff) | |
download | u-boot-b5bf83b6912a67d2a147cf866c87854bd43cc863.zip u-boot-b5bf83b6912a67d2a147cf866c87854bd43cc863.tar.gz u-boot-b5bf83b6912a67d2a147cf866c87854bd43cc863.tar.bz2 |
test: spl: Fix spl_test_load not failing if fname doesn't exist
Returning a negative value from a unit test doesn't automatically fail the
test. We have to fail an assertion. Modify the test to do so.
This now causes the test to count as a failure on VPL. This is because the
fname of SPL (and U-Boot) is generated with make_exec in os_jump_to_image.
The original name of SPL is gone, and we can't determine the name of U-Boot
from the generated name.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | configs/sandbox_vpl_defconfig | 1 | ||||
-rw-r--r-- | test/image/spl_load_os.c | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig index 8d76f19..5bd0281 100644 --- a/configs/sandbox_vpl_defconfig +++ b/configs/sandbox_vpl_defconfig @@ -262,3 +262,4 @@ CONFIG_UNIT_TEST=y CONFIG_SPL_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y +# CONFIG_SPL_UT_LOAD_OS is not set diff --git a/test/image/spl_load_os.c b/test/image/spl_load_os.c index bf374f2..3b2967d 100644 --- a/test/image/spl_load_os.c +++ b/test/image/spl_load_os.c @@ -58,10 +58,8 @@ static int spl_test_load(struct unit_test_state *uts) load.read = read_fit_image; ret = sandbox_find_next_phase(fname, sizeof(fname), true); - if (ret) { - printf("(%s not found, error %d)\n", fname, ret); - return ret; - } + if (ret) + ut_assertf(0, "%s not found, error %d\n", fname, ret); load.filename = fname; header = spl_get_load_buffer(-sizeof(*header), sizeof(*header)); |