memblock tests: Add memblock reset function
authorKarolina Drobnik <karolinadrobnik@gmail.com>
Wed, 2 Feb 2022 11:03:10 +0000 (12:03 +0100)
committerMike Rapoport <rppt@linux.ibm.com>
Sun, 20 Feb 2022 06:44:37 +0000 (08:44 +0200)
commitf3252a22d1f59d89cca769431efa1c95d6343929
tree924a6a46092b6f7493f1f76029d8772c5eb981c0
parent16802e55dea9534c18a30bd8eeefea8a06337916
memblock tests: Add memblock reset function

Memblock simulator needs to be able to reset memblock data structures
between different test cases. Add a function that sets all fields to
their default values.

Add a test checking if memblock is being initialized to expected values.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/8c185aa7e0dd68c2c7e937c9a06c90ae413e240f.1643796665.git.karolinadrobnik@gmail.com
tools/testing/memblock/Makefile
tools/testing/memblock/main.c
tools/testing/memblock/tests/basic_api.c [new file with mode: 0644]
tools/testing/memblock/tests/basic_api.h [new file with mode: 0644]
tools/testing/memblock/tests/common.c [new file with mode: 0644]
tools/testing/memblock/tests/common.h [new file with mode: 0644]