Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / vm / mmap-exit.c
1 #include <syscall.h>
2 #include "tests/vm/sample.inc"
3 #include "tests/lib.h"
4 #include "tests/main.h"
5
6 void
7 test_main (void)
8 {
9   pid_t child;
10
11   /* Make child write file. */
12   quiet = true;
13   CHECK ((child = exec ("child-mm-wrt")) != -1, "exec \"child-mm-wrt\"");
14   CHECK (wait (child) == 0, "wait for child (should return 0)");
15   quiet = false;
16
17   /* Check file contents. */
18   check_file ("sample.txt", sample, sizeof sample);
19 }