memblock tests: Add memblock_reserve tests
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Wed, 2 Feb 2022 11:03:12 +0000 (12:03 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Mon, 21 Feb 2022 06:16:21 +0000 (08:16 +0200)
commit83787a803793881a2e6cf47ea0706cc8fe4573d7
tree6e461335117eff39a4814623fbeb60cd6feda144
parent1f1180d46d21506325b7217da5a546235a2263a2
memblock tests: Add memblock_reserve tests

Add checks for marking a region as reserved in different scenarios:
 - The region does not overlap with existing entries
 - The region overlaps with one of the previous 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
 - The same region is marked as reserved twice

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