mirror of
https://github.com/tailix/libkernaux.git
synced 2025-03-31 17:25:22 -04:00
Test PFA
This commit is contained in:
parent
16fd74f0ca
commit
8599102102
3 changed files with 41 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -35,4 +35,5 @@
|
|||
/tests/test_multiboot2_helpers
|
||||
/tests/test_multiboot2_print
|
||||
/tests/test_multiboot2_validation
|
||||
/tests/test_pfa
|
||||
/tests/test_stdlib
|
||||
|
|
|
@ -8,6 +8,7 @@ TESTS = \
|
|||
tests/test_multiboot2_helpers \
|
||||
tests/test_multiboot2_print \
|
||||
tests/test_multiboot2_validation \
|
||||
tests/test_pfa \
|
||||
tests/test_stdlib
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
|
@ -47,6 +48,10 @@ tests_test_multiboot2_validation_SOURCES = \
|
|||
$(libkernaux_a_SOURCES) \
|
||||
tests/test_multiboot2_validation.c
|
||||
|
||||
tests_test_pfa_SOURCES = \
|
||||
$(libkernaux_a_SOURCES) \
|
||||
tests/test_pfa.c
|
||||
|
||||
tests_test_stdlib_SOURCES = \
|
||||
$(libkernaux_a_SOURCES) \
|
||||
tests/test_stdlib.c
|
||||
|
|
35
tests/test_pfa.c
Normal file
35
tests/test_pfa.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <kernaux/pfa.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
struct KernAux_PFA pfa;
|
||||
|
||||
assert(KernAux_PFA_initialize_start(&pfa));
|
||||
|
||||
assert(KernAux_PFA_initialize_add_zone(
|
||||
&pfa,
|
||||
"foo",
|
||||
0,
|
||||
16 * 1024 * 1024 - 1
|
||||
));
|
||||
|
||||
assert(KernAux_PFA_initialize_add_zone(
|
||||
&pfa,
|
||||
"bar",
|
||||
16 * 1024 * 1024,
|
||||
896 * 1024 * 1024 - 1
|
||||
));
|
||||
|
||||
assert(KernAux_PFA_initialize_add_zone(
|
||||
&pfa,
|
||||
"car",
|
||||
896 * 1024 * 1024,
|
||||
(unsigned long long)4 * 1024 * 1024 * 1024 - 1
|
||||
));
|
||||
|
||||
assert(KernAux_PFA_initialize_finish(&pfa));
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue