memblock tests: update alloc_api to test memblock_alloc_raw
authorRebecca Mckeever <remckee0@gmail.com>
Sat, 27 Aug 2022 05:42:47 +0000 (00:42 -0500)
committerMike Rapoport <rppt@linux.ibm.com>
Tue, 30 Aug 2022 10:12:00 +0000 (13:12 +0300)
commitdeee033e0f8ea66a9f4acfc1eb069fdef3013bec
tree003885166819fc8027064414cda88c7bab07f852
parent21a233f68afe55aafa8b79705c97f7a1d37be3e1
memblock tests: update alloc_api to test memblock_alloc_raw

Update memblock_alloc() tests so that they test either memblock_alloc()
or memblock_alloc_raw() depending on the value of alloc_test_flags. Run
through all the existing tests in memblock_alloc_api twice: once for
memblock_alloc() and once for memblock_alloc_raw().

When the tests run memblock_alloc(), they test that the entire memory
region is zero. When the tests run memblock_alloc_raw(), they test that
the entire memory region is nonzero. The content of the memory region is
initialized to nonzero, and we expect it to remain unchanged if running
memblock_alloc_raw().

Reviewed-by: Shaoqin Huang <shaoqin.huang@intel.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/5a7cfb2f807ee2cb53ee77f9f5c910107b253d6e.1661578349.git.remckee0@gmail.com
tools/testing/memblock/tests/alloc_api.c
tools/testing/memblock/tests/common.h