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@linux.ibm.com>
Mon, 21 Feb 2022 06:26:06 +0000 (08:26 +0200)
commitdd45dc071101a45619cbaff0f77d07abdf25caf0
tree91eb48715091d5c6b5ec0f2dd5a7510b2fa288e7
parente393c093ec7640dc42ad63fb414a9680b69f26f1
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