aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.ibm.com>2018-10-10 16:19:49 +1100
committerStewart Smith <stewart@linux.ibm.com>2018-10-16 18:26:24 +1100
commit51c35e372831a1c2ba1305bfcfbaf78fab055e0c (patch)
tree1d478684a8ac31a4c64f6b230b53767d098e426c
parent8fd95036cdd8566e2d0912fad3f461036b892d1b (diff)
downloadskiboot-51c35e372831a1c2ba1305bfcfbaf78fab055e0c.zip
skiboot-51c35e372831a1c2ba1305bfcfbaf78fab055e0c.tar.gz
skiboot-51c35e372831a1c2ba1305bfcfbaf78fab055e0c.tar.bz2
core/device: increase test coverage for dt_new_addr and dt_new_2addr
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--core/test/run-device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/test/run-device.c b/core/test/run-device.c
index 727b14f..076ec24 100644
--- a/core/test/run-device.c
+++ b/core/test/run-device.c
@@ -166,12 +166,14 @@ int main(void)
assert(dt_find_by_name(root, "addr@1337") == addr1);
assert(dt_find_by_name_addr(root, "addr", 0x1337) == addr1);
assert(dt_find_by_path(root, "/addrs/addr@1337") == addr1);
+ assert(dt_new_addr(addrs, "addr", 0x1337) == NULL);
addr2 = dt_new_2addr(addrs, "2addr", 0xdead, 0xbeef);
assert(!list_top(&addr2->properties, struct dt_property, list));
check_path(addr2, "/addrs/2addr@dead,beef");
assert(dt_find_by_name(root, "2addr@dead,beef") == addr2);
assert(dt_find_by_path(root, "/addrs/2addr@dead,beef") == addr2);
+ assert(dt_new_2addr(addrs, "2addr", 0xdead, 0xbeef) == NULL);
/* Test walking the tree, checking and setting values */
for (n = 0, i = dt_first(root); i; i = dt_next(root, i), n++) {