summaryrefslogtreecommitdiffstats
path: root/pintos-progos/tests/vm/mmap-twice.c
diff options
context:
space:
mode:
Diffstat (limited to 'pintos-progos/tests/vm/mmap-twice.c')
-rw-r--r--pintos-progos/tests/vm/mmap-twice.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/pintos-progos/tests/vm/mmap-twice.c b/pintos-progos/tests/vm/mmap-twice.c
deleted file mode 100644
index d277a37..0000000
--- a/pintos-progos/tests/vm/mmap-twice.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/* Maps the same file into memory twice and verifies that the
2 same data is readable in both. */
3
4#include <string.h>
5#include <syscall.h>
6#include "tests/vm/sample.inc"
7#include "tests/lib.h"
8#include "tests/main.h"
9
10void
11test_main (void)
12{
13 char *actual[2] = {(char *) 0x10000000, (char *) 0x20000000};
14 size_t i;
15 int handle[2];
16
17 for (i = 0; i < 2; i++)
18 {
19 CHECK ((handle[i] = open ("sample.txt")) > 1,
20 "open \"sample.txt\" #%zu", i);
21 CHECK (mmap (handle[i], actual[i]) != MAP_FAILED,
22 "mmap \"sample.txt\" #%zu at %p", i, (void *) actual[i]);
23 }
24
25 for (i = 0; i < 2; i++)
26 CHECK (!memcmp (actual[i], sample, strlen (sample)),
27 "compare mmap'd file %zu against data", i);
28}