add an extent_free test.

This commit is contained in:
mrg 2002-02-21 03:59:25 +00:00
parent 71bd5d8f3c
commit f91c336c9f
3 changed files with 32 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: extest.awk,v 1.5 2000/07/03 04:02:36 matt Exp $
# $NetBSD: extest.awk,v 1.6 2002/02/21 03:59:25 mrg Exp $
BEGIN {
first = 1;
@ -60,6 +60,11 @@ $1 == "alloc_subregion" {
printf("else\n\tprintf(\"result: 0x%%lx\\n\", result);\n")
}
$1 == "free" {
printf("error = extent_free(ex, %s, %s, 0);\n", $2, $3)
printf("if (error)\n\tprintf(\"error: %%s\\n\", strerror(error));\n")
}
$1 == "print" {
printf("extent_print(ex);\n")
}

View File

@ -1,4 +1,4 @@
# $NetBSD: extest.exp,v 1.7 2002/02/20 01:26:37 enami Exp $
# $NetBSD: extest.exp,v 1.8 2002/02/21 03:59:25 mrg Exp $
# real output must start in line 4
output for test1
@ -51,3 +51,15 @@ extent `test9' (0x0 - 0x4f), flags = 0x0
0x0 - 0x3
0xd - 0xe
0x10 - 0x17
output for test10
result: 0xc0010000
result: 0xc0020000
extent `test10' (0xc0002000 - 0xffffe000), flags = 0x0
0xc0010000 - 0xc0011fff
0xc0020000 - 0xc0021fff
extent `test10' (0xc0002000 - 0xffffe000), flags = 0x0
0xc0010000 - 0xc0011fff
result: 0xc0022000
extent `test10' (0xc0002000 - 0xffffe000), flags = 0x0
0xc0010000 - 0xc0011fff
0xc0022000 - 0xc0031fff

View File

@ -1,4 +1,4 @@
# $NetBSD: tests,v 1.7 2002/02/09 15:58:35 bouyer Exp $
# $NetBSD: tests,v 1.8 2002/02/21 03:59:25 mrg Exp $
#fill up an extent, should coalesce into one allocation
extent test1 0 0x4f
@ -72,3 +72,15 @@ alloc_subregion 0xd 0x20 2
boundary 8
alloc_subregion 0 0x4f 8
print
#check that free works
extent test10 0xc0002000 0xffffe000 EX_BOUNDZERO
boundary 0x10000
align 0x10000
alloc_subregion 0xc0002000 0xffffe000 0x2000
alloc_subregion 0xc0002000 0xffffe000 0x2000
print
free 0xc0020000 0x2000
print
alloc_subregion 0xc0002000 0xffffe000 0x10000
print