memblock tests: Add memblock_free tests
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Wed, 2 Feb 2022 11:03:15 +0000 (12:03 +0100)
committerMike Rapoport <rppt@kernel.org>
Wed, 9 Feb 2022 07:17:57 +0000 (09:17 +0200)
commit5b3408a4e5ff7609cc5b06da255b973ca0ab66d1
tree4283c64a461197f96786c8baeae9511007e86cbd
parentbe95b2fb44340a00065f3153d75ab6c797c23740
memblock tests: Add memblock_free tests

Add checks for removing a region from reserved memory in different
scenarios:
 - The requested region matches one in the collection of reserved
   memory regions
 - The requested region does not exist in memblock.reserved
 - The region overlaps with one of the entries: from the top (its
   end address is bigger than the base of the existing region) or
   from the bottom (its base address is smaller than the end address
   of one of the regions)
 - The region is within an already defined region

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/30af95c82754ad8029404c3b528a5ef1c05d1ed6.1643796665.git.karolinadrobnik@gmail.com
tools/testing/memblock/tests/basic_api.c