[4/5] core/device: increase test coverage for dt_new_addr and dt_new_2addr

Message ID 20181010051950.13202-5-stewart@linux.ibm.com
State Accepted
Headers show
Series
  • Small code coverage improvements
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Stewart Smith Oct. 10, 2018, 5:19 a.m.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 core/test/run-device.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/core/test/run-device.c b/core/test/run-device.c
index 727b14fffe43..076ec2489def 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++) {