Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / vm / mmap-over-stk.c
1 #include <stdint.h>
2 #include <round.h>
3 #include <syscall.h>
4 #include "tests/lib.h"
5 #include "tests/main.h"
6
7 void
8 test_main (void) 
9 {
10   int handle;
11   uintptr_t handle_page = ROUND_DOWN ((uintptr_t) &handle, 4096);
12   
13   CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
14   CHECK (mmap (handle, (void *) handle_page) == MAP_FAILED,
15          "try to mmap over stack segment");
16 }
17