Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / vm / child-mm-wrt.c
1 #include <string.h>
2 #include <syscall.h>
3 #include "tests/vm/sample.inc"
4 #include "tests/lib.h"
5 #include "tests/main.h"
6
7 #define ACTUAL ((void *) 0x10000000)
8
9 void
10 test_main (void)
11 {
12   int handle;
13
14   CHECK (create ("sample.txt", sizeof sample), "create \"sample.txt\"");
15   CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
16   CHECK (mmap (handle, ACTUAL) != MAP_FAILED, "mmap \"sample.txt\"");
17   memcpy (ACTUAL, sample, sizeof sample);
18 }
19