diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-01-12 21:44:53 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-01-12 21:44:53 +0000 |
commit | 2f36e4ecd0f0c04781c752e5382906a43feaf4e3 (patch) | |
tree | 27f6eba9c66c680c931ce0562e2586cc9a3c07de /tests/path-references.c | |
parent | f059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f (diff) |
Notes
Diffstat (limited to 'tests/path-references.c')
-rw-r--r-- | tests/path-references.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/path-references.c b/tests/path-references.c index c8d25fb85fdd..5e332e8f32ca 100644 --- a/tests/path-references.c +++ b/tests/path-references.c @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) void *fdt; const char *p; int len, multilen; - int n1, n2; + int n1, n2, n3, n4; test_init(argc, argv); fdt = load_blob_arg(argc, argv); @@ -92,6 +92,16 @@ int main(int argc, char *argv[]) if ((!streq(p, "/node1") || !streq(p + strlen("/node1") + 1, "/node2"))) FAIL("multiref has wrong value"); + /* Check reference to nested nodes with common prefix */ + n3 = fdt_path_offset(fdt, "/foo/baz"); + if (n3 < 0) + FAIL("fdt_path_offset(/foo/baz): %s", fdt_strerror(n3)); + n4 = fdt_path_offset(fdt, "/foobar/baz"); + if (n4 < 0) + FAIL("fdt_path_offset(/foobar/baz): %s", fdt_strerror(n4)); + check_ref(fdt, n3, "/foobar/baz"); + check_ref(fdt, n4, "/foo/baz"); + check_rref(fdt); PASS(); |