memblock tests: Add memblock_remove tests
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Wed, 2 Feb 2022 11:03:13 +0000 (12:03 +0100)
committerMike Rapoport <rppt@kernel.org>
Wed, 9 Feb 2022 07:17:57 +0000 (09:17 +0200)
commited7b7402f9c9f37fd29267ee3c9a6a3eca8871c0
tree6390af5b5426e4434bf1bf83cd6d133c816ce9de
parent7ee605ba936534c001c2b4b0b6f5f925d86fef6b
memblock tests: Add memblock_remove tests

Add checks for removing a region from available memory in different
scenarios:
 - The requested region matches one in the collection of available
   memory regions
 - The requested region does not exist in memblock.memory
 - 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/8e6aa005407bbe1a75b75e85ac04ebb51318a52a.1643796665.git.karolinadrobnik@gmail.com
tools/testing/memblock/tests/basic_api.c