diff options
author | Simon Glass <sjg@chromium.org> | 2015-04-19 13:21:02 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-22 17:15:36 (GMT) |
commit | f9fd4558ea977f0ad574c829026f26157176cea6 (patch) | |
tree | b6317bac1f4d74ad4152a6ed60afbdf0531e1fe3 | |
parent | 98a1605309d82dd85f9046b7f81afabeba390b46 (diff) | |
download | u-boot-f9fd4558ea977f0ad574c829026f26157176cea6.tar.xz |
dm: test: Don't clear global_data in dm_test_uclass_before_ready()
We must not clear global_data even in tests, since the ram_buffer (which
is used by malloc()) will also be lost, and subsequent tests will fail.
Zero only the global_data fields that are required for the test to function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r-- | test/dm/core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/dm/core.c b/test/dm/core.c index 7f7b977..91be1e5 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -651,7 +651,10 @@ static int dm_test_uclass_before_ready(struct dm_test_state *dms) ut_assertok(uclass_get(UCLASS_TEST, &uc)); - memset(gd, '\0', sizeof(*gd)); + gd->dm_root = NULL; + gd->dm_root_f = NULL; + memset(&gd->uclass_root, '\0', sizeof(gd->uclass_root)); + ut_asserteq_ptr(NULL, uclass_find(UCLASS_TEST)); return 0; |