aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-29 13:31:07 -0500
committerAlon Zakai <alonzakai@gmail.com>2012-12-29 13:31:07 -0500
commit9f8132c93fc0669e08187f55204f440f8363b9a1 (patch)
tree9c70c5cf1d1fadedcf60f0b9453b820e61f4df81 /tests/runner.py
parent7b9f47555515346b1b04d8b9eb599a931e6b56da (diff)
force mmap to return page-aligned addresses, and check for valid input in munmap
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 66331a86..f3602097 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6181,13 +6181,20 @@ void*:16
#include <assert.h>
int main(int argc, char *argv[]) {
+ for (int i = 0; i < 10; i++) {
+ int* map = (int*)mmap(0, 5000, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANON, -1, 0);
+ assert(((int)map) % 4096 == 0); // aligned
+ assert(munmap(map, 5000) == 0);
+ }
+
const int NUM_BYTES = 8 * 1024 * 1024;
const int NUM_INTS = NUM_BYTES / sizeof(int);
int* map = (int*)mmap(0, NUM_BYTES, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANON, -1, 0);
assert(map != MAP_FAILED);
-
+
int i;
for (i = 0; i < NUM_INTS; i++) {