memblock tests: Add memblock_alloc_from tests for top down
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Mon, 28 Feb 2022 14:46:47 +0000 (15:46 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Wed, 9 Mar 2022 13:54:03 +0000 (15:54 +0200)
commit16567b5f30f6ea13a78a3b553e0c9c0c1ba34e64
tree30a66b9502b7d8a55000e2e90d6605f6b1c0edad
parent0237ee2388703cf72d1e1f9ea0c73c054582f30d
memblock tests: Add memblock_alloc_from tests for top down

Add checks for memblock_alloc_from for default allocation direction.
The tested scenarios are:
  - Not enough space to allocate memory at the minimal address
  - Minimal address parameter is smaller than the start address
    of the available memory
  - Minimal address is too close to the available memory

Add simple memblock_alloc_from test that can be used to test both
allocation directions (minimal address is aligned or misaligned).

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/3dd645f437975fd393010b95b8faa85d2b86490a.1646055639.git.karolinadrobnik@gmail.com
tools/testing/memblock/Makefile
tools/testing/memblock/main.c
tools/testing/memblock/tests/alloc_helpers_api.c [new file with mode: 0644]
tools/testing/memblock/tests/alloc_helpers_api.h [new file with mode: 0644]