summaryrefslogtreecommitdiff
path: root/test/dm/test-dm.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-08 03:34:56 +0300
committerTom Rini <trini@konsulko.com>2021-03-12 17:57:30 +0300
commit72b524cf426697e764c9c63611d0f6743f50f0f5 (patch)
tree7496d35d4a59e8e3bb34d35dc918c4d61c956565 /test/dm/test-dm.c
parent47ec3ede4efe214b4debdaf845d6eb622154f405 (diff)
downloadu-boot-72b524cf426697e764c9c63611d0f6743f50f0f5.tar.xz
test: Handle driver model reinit in test_pre_run()
For driver model tests we want to reinit the data structures so that everything is in a known state before the test runs. This avoids one test changing something that breaks a subsequent tests. Move the call for this into test_pre_run(). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/test-dm.c')
-rw-r--r--test/dm/test-dm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c
index 569ffbbad9..ceeac3fd36 100644
--- a/test/dm/test-dm.c
+++ b/test/dm/test-dm.c
@@ -24,10 +24,10 @@ DECLARE_GLOBAL_DATA_PTR;
struct unit_test_state global_dm_test_state;
static struct dm_test_state _global_priv_dm_test_state;
-/* Get ready for testing */
-static int dm_test_init(struct unit_test_state *uts, bool of_live)
+int dm_test_init(struct unit_test_state *uts)
{
struct dm_test_state *dms = uts->priv;
+ bool of_live = uts->of_live;
memset(dms, '\0', sizeof(*dms));
gd->dm_root = NULL;
@@ -70,7 +70,7 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test,
printf("Test: %s: %s%s\n", test->name, fname,
!of_live ? " (flat tree)" : "");
- ut_assertok(dm_test_init(uts, of_live));
+ uts->of_live = of_live;
ut_assertok(test_pre_run(uts, test));