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@kernel.org>
Wed, 9 Feb 2022 07:17:57 +0000 (09:17 +0200)
commitd047055e609e23190c4d46899816dc32a6cc297b
tree7b3fd22dfae57944a6bacb51a065c9ad6d782b6c
parent46ad27eef5220e3cda0fe263e8a9f785896f7aec
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]