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@kernel.org>
Wed, 9 Feb 2022 07:17:57 +0000 (09:17 +0200)
commit7ee605ba936534c001c2b4b0b6f5f925d86fef6b
treefa4896769da91c36f00c556f75ff08edca6c5131
parentc294f4708f0116a0e5a9695a471a0cafd05d2899
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