summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-18 20:09:13 -0600
committerSimon Glass <sjg@chromium.org>2017-06-01 07:03:09 -0600
commit34b744beb866c9ae660f2851f9776f80e165d421 (patch)
tree33aef867d123887f4171a8fd2baa3432a7b1a1dd /test
parenta40cc8e12352ee35d095d29125fedd2eb2821228 (diff)
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>
Diffstat (limited to 'test')
-rw-r--r--test/dm/test-main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 67c0082fb8..9aa9d3a953 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -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();