mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
sandbox: Add a way to reset sandbox state for tests
Running a new test should reset the sandbox state to avoid tests interferring with each other. Move the existing state-reset code into a function so it can be used from tests. Also update the code to reset the SPI devices and adjust the test code to call it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -29,6 +29,7 @@ static int dm_test_init(struct unit_test_state *uts)
|
||||
memset(dms, '\0', sizeof(*dms));
|
||||
gd->dm_root = NULL;
|
||||
memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count));
|
||||
state_reset_for_test(state_get_current());
|
||||
|
||||
ut_assertok(dm_init(false));
|
||||
dms->root = dm_root();
|
||||
|
||||
Reference in New Issue
Block a user