]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: fdtdec: Add test for new no-map fdtdec_add_reserved_memory() parameter
authorPatrice Chotard <patrice.chotard@st.com>
Thu, 10 Sep 2020 08:50:00 +0000 (10:50 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Sep 2020 18:54:13 +0000 (12:54 -0600)
Add a test to verify that the no-map property is added in reserved-memory
node when fdtdec_add_reserved_memory() no-map parameter is set to true.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/fdtdec.c

index 4119003041e694f9dabe815831089ae363821db9..017157a2ecd154ac0189e03b15c3d2c0ef02af73 100644 (file)
@@ -101,10 +101,13 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
        resv.start = 0x2000;
        resv.end = 0x2fff;
        ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
-                                              &resv, &phandle1, false));
+                                              &resv, &phandle1, true));
        subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1");
        ut_assert(subnode > 0);
 
+       /* check that no-map property is present */
+       ut_assert(fdt_getprop(blob, subnode, "no-map", NULL) > 0);
+
        /* phandles must be different */
        ut_assert(phandle != phandle1);