Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / userprog / open-twice.c
1 #include <syscall.h>
2 #include "tests/lib.h"
3 #include "tests/main.h"
4
5 void
6 test_main (void) 
7 {
8   int h1 = open ("sample.txt");
9   int h2 = open ("sample.txt");  
10
11   CHECK ((h1 = open ("sample.txt")) > 1, "open \"sample.txt\" once");
12   CHECK ((h2 = open ("sample.txt")) > 1, "open \"sample.txt\" again");
13   if (h1 == h2)
14     fail ("open() returned %d both times", h1);
15 }