aboutsummaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-26 08:14:46 -0600
committerTom Rini <trini@konsulko.com>2023-10-06 14:38:13 -0400
commit5fe8bc3cf2d028e7503323d24768bf72b279760b (patch)
tree7fe057ed143b3bbf7d297afb31ee40dba645548c /test/dm
parent7071c82bdc55ed5d7955d8e1682b7c80af5659b5 (diff)
downloadu-boot-5fe8bc3cf2d028e7503323d24768bf72b279760b.tar.gz
dm: core: Add tests for oftree_path()
Add a few simple tests for getting the root node, since this is handled as a special case in the implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/ofnode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index e078a9755a..a5bc43aea4 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -228,6 +228,9 @@ static int dm_test_ofnode_read(struct unit_test_state *uts)
ofnode node;
int size;
+ node = oftree_path(oftree_default(), "/");
+ ut_assert(ofnode_valid(node));
+
node = ofnode_path("/a-test");
ut_assert(ofnode_valid(node));
@@ -256,6 +259,9 @@ static int dm_test_ofnode_read_ot(struct unit_test_state *uts)
ofnode node;
int size;
+ node = oftree_path(otree, "/");
+ ut_assert(ofnode_valid(node));
+
node = oftree_path(otree, "/node/subnode");
ut_assert(ofnode_valid(node));