memblock tests: Add memblock_alloc_from tests for bottom up
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Mon, 28 Feb 2022 14:46:48 +0000 (15:46 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Wed, 9 Mar 2022 13:54:03 +0000 (15:54 +0200)
commit0ac06631a3bcdaed497f7b8abccf405f9eb8e0bd
treef77732afcd8a7af1b2da2f5b54672b5be89da29d
parent16567b5f30f6ea13a78a3b553e0c9c0c1ba34e64
memblock tests: Add memblock_alloc_from tests for bottom up

Add checks for memblock_alloc_from for bottom up 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 parameter is too close to the end of the available
    memory

Add test case wrappers to test both directions in the same context.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/506cf5293c8a21c012b7ea87b14af07754d3e656.1646055639.git.karolinadrobnik@gmail.com
tools/testing/memblock/tests/alloc_helpers_api.c