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/sw_tree1.c | |
parent | f059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f (diff) |
Notes
Diffstat (limited to 'tests/sw_tree1.c')
-rw-r--r-- | tests/sw_tree1.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/sw_tree1.c b/tests/sw_tree1.c index 6d4c531029675..386b05f6f7201 100644 --- a/tests/sw_tree1.c +++ b/tests/sw_tree1.c @@ -42,14 +42,14 @@ static void realloc_fdt(void **fdt, size_t *size, bool created) switch (alloc_mode) { case FIXED: if (!(*fdt)) - fdt = xmalloc(*size); + *fdt = xmalloc(*size); else FAIL("Ran out of space"); return; case RESIZE: if (!(*fdt)) { - fdt = xmalloc(SPACE); + *fdt = xmalloc(SPACE); } else if (*size < SPACE) { *size += 1; fdt_resize(*fdt, *fdt, *size); @@ -85,6 +85,9 @@ int main(int argc, char *argv[]) size_t size; int err; bool created = false; + void *place; + const char place_str[] = "this is a placeholder string\0string2"; + int place_len = sizeof(place_str); test_init(argc, argv); @@ -108,6 +111,8 @@ int main(int argc, char *argv[]) CONFIG("Bad allocation mode \"%s\" specified", argv[1]); } + } else { + CONFIG("sw_tree1 <dtb file> [<allocation mode>]"); } fdt = xmalloc(size); @@ -135,6 +140,8 @@ int main(int argc, char *argv[]) CHECK(fdt_begin_node(fdt, "subsubnode")); CHECK(fdt_property(fdt, "compatible", "subsubnode1\0subsubnode", 23)); + CHECK(fdt_property_placeholder(fdt, "placeholder", place_len, &place)); + memcpy(place, place_str, place_len); CHECK(fdt_property_cell(fdt, "prop-int", TEST_VALUE_1)); CHECK(fdt_end_node(fdt)); CHECK(fdt_begin_node(fdt, "ss1")); |