1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2025-03-31 17:25:22 -04:00
This commit is contained in:
Alex Kotov 2020-11-30 23:32:27 +05:00
parent 16fd74f0ca
commit 8599102102
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 41 additions and 0 deletions

1
.gitignore vendored
View file

@ -35,4 +35,5 @@
/tests/test_multiboot2_helpers
/tests/test_multiboot2_print
/tests/test_multiboot2_validation
/tests/test_pfa
/tests/test_stdlib

View file

@ -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
View 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;
}