mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
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>
This commit is contained in:
parent
c56468a60d
commit
b5bf83b691
@ -262,3 +262,4 @@ CONFIG_UNIT_TEST=y
|
|||||||
CONFIG_SPL_UNIT_TEST=y
|
CONFIG_SPL_UNIT_TEST=y
|
||||||
CONFIG_UT_TIME=y
|
CONFIG_UT_TIME=y
|
||||||
CONFIG_UT_DM=y
|
CONFIG_UT_DM=y
|
||||||
|
# CONFIG_SPL_UT_LOAD_OS is not set
|
||||||
|
@ -58,10 +58,8 @@ static int spl_test_load(struct unit_test_state *uts)
|
|||||||
load.read = read_fit_image;
|
load.read = read_fit_image;
|
||||||
|
|
||||||
ret = sandbox_find_next_phase(fname, sizeof(fname), true);
|
ret = sandbox_find_next_phase(fname, sizeof(fname), true);
|
||||||
if (ret) {
|
if (ret)
|
||||||
printf("(%s not found, error %d)\n", fname, ret);
|
ut_assertf(0, "%s not found, error %d\n", fname, ret);
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
load.filename = fname;
|
load.filename = fname;
|
||||||
|
|
||||||
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
|
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user