]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: core: Add tests for oftree_path()
authorSimon Glass <sjg@chromium.org>
Tue, 26 Sep 2023 14:14:46 +0000 (08:14 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 6 Oct 2023 18:38:13 +0000 (14:38 -0400)
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>
test/dm/ofnode.c

index e078a9755a830bf7118dee2a7e0354597f578bf3..a5bc43aea4e76148bef524d89c382801051ea143 100644 (file)
@@ -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));