Skip to content

Commit

Permalink
core/device: Test dt_new_check()
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
stewartsmith committed Oct 16, 2018
1 parent 51c35e3 commit c5d7181
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/test/run-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const char **props_to_fix(struct dt_node *node)

int main(void)
{
struct dt_node *root, *other_root, *c1, *c2, *gc1, *gc2, *gc3, *ggc1, *ggc2;
struct dt_node *root, *other_root, *c1, *c2, *c2_c, *gc1, *gc2, *gc3, *ggc1, *ggc2;
struct dt_node *addrs, *addr1, *addr2;
struct dt_node *i, *subtree, *ev1, *ut1, *ut2;
const struct dt_property *p;
Expand All @@ -117,14 +117,16 @@ int main(void)
assert(!list_top(&root->properties, struct dt_property, list));
check_path(root, "/");

c1 = dt_new(root, "c1");
c1 = dt_new_check(root, "c1");
assert(!list_top(&c1->properties, struct dt_property, list));
check_path(c1, "/c1");
assert(dt_find_by_name(root, "c1") == c1);
assert(dt_find_by_path(root, "/c1") == c1);
assert(dt_new(root, "c1") == NULL);

c2 = dt_new(root, "c2");
c2_c = dt_new_check(root, "c2");
assert(c2 == c2_c);
assert(!list_top(&c2->properties, struct dt_property, list));
check_path(c2, "/c2");
assert(dt_find_by_name(root, "c2") == c2);
Expand Down

0 comments on commit c5d7181

Please sign in to comment.