diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/ktests/region1/test.c | 19 | ||||
-rwxr-xr-x | src/tests/ktests/run_qemu_test.sh | 2 | ||||
-rw-r--r-- | src/tests/utests/malloc/test.c | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/tests/ktests/region1/test.c b/src/tests/ktests/region1/test.c index 58b4933..b5367d9 100644 --- a/src/tests/ktests/region1/test.c +++ b/src/tests/ktests/region1/test.c @@ -5,24 +5,39 @@ void test_region_1() { void* p = region_alloc(0x1000, "Test region"); dbg_printf("Allocated one-page region: 0x%p\n", p); dbg_print_region_info(); + void* q = region_alloc(0x1000, "Test region"); dbg_printf("Allocated one-page region: 0x%p\n", q); dbg_print_region_info(); + void* r = region_alloc(0x2000, "Test region"); dbg_printf("Allocated two-page region: 0x%p\n", r); dbg_print_region_info(); + void* s = region_alloc(0x10000, "Test region"); dbg_printf("Allocated 16-page region: 0x%p\n", s); dbg_print_region_info(); + region_free(p); dbg_printf("Freed region 0x%p\n", p); dbg_print_region_info(); + + region_free(r); + dbg_printf("Freed region 0x%p\n", r); + dbg_print_region_info(); + + p = region_alloc(0x1000, "Test region"); + dbg_printf("Allocated one-page region: 0x%p\n", p); + dbg_print_region_info(); + region_free(q); dbg_printf("Freed region 0x%p\n", q); dbg_print_region_info(); - region_free(r); - dbg_printf("Freed region 0x%p\n", r); + + region_free(p); + dbg_printf("Freed region 0x%p\n", p); dbg_print_region_info(); + region_free(s); dbg_printf("Freed region 0x%p\n", s); dbg_print_region_info(); diff --git a/src/tests/ktests/run_qemu_test.sh b/src/tests/ktests/run_qemu_test.sh index 0e7b83e..5f7df83 100755 --- a/src/tests/ktests/run_qemu_test.sh +++ b/src/tests/ktests/run_qemu_test.sh @@ -1,6 +1,6 @@ #!/bin/bash -(qemu-system-i386 -kernel test_kernel.bin -initrd ../../kernel/kernel.map -serial stdio -m 16 -display none & echo $! >pid) \ +(qemu-system-i386 -kernel test_kernel.bin -initrd ../../../kernel/kernel.map -serial stdio -m 16 -display none & echo $! >pid) \ | tee >(grep -m 1 "TEST-" >result; kill -INT `cat pid`) \ RESULT=`cat result` diff --git a/src/tests/utests/malloc/test.c b/src/tests/utests/malloc/test.c index b55d28a..fb2f3b9 100644 --- a/src/tests/utests/malloc/test.c +++ b/src/tests/utests/malloc/test.c @@ -4,7 +4,7 @@ #include <syscall.h> #include <debug.h> -#include <user_region.h> +#include <region_alloc.h> int main(int argc, char **argv) { dbg_print("(BEGIN-USER-TEST malloc-test)\n"); |