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

Stewart Smith stewart at linux.ibm.com
Wed Oct 10 16:19:49 AEDT 2018


Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 core/test/run-device.c | 2 ++
 1 file changed, 2 insertions(+)

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 at 1337") == addr1);
 	assert(dt_find_by_name_addr(root, "addr", 0x1337) == addr1);
 	assert(dt_find_by_path(root, "/addrs/addr at 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 at dead,beef");
 	assert(dt_find_by_name(root, "2addr at dead,beef") == addr2);
 	assert(dt_find_by_path(root, "/addrs/2addr at 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++) {
-- 
2.17.1



More information about the Skiboot mailing list