Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / extended / dir-open.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 fd;
9   
10   CHECK (mkdir ("xyzzy"), "mkdir \"xyzzy\"");
11   msg ("open \"xyzzy\"");
12   fd = open ("xyzzy");
13   if (fd == -1) 
14     msg ("open returned -1 -- ok");
15   else 
16     {
17       int retval = write (fd, "foobar", 6);
18       CHECK (retval == -1, "write \"xyzzy\" (must return -1, actually %d)",
19              retval);
20     }
21 }