Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / extended / dir-rm-cwd-cd.c
1 #include <syscall.h>
2 #include "tests/lib.h"
3 #include "tests/main.h"
4
5 void
6 test_main (void) 
7 {
8   CHECK (mkdir ("a"), "mkdir \"a\"");
9   CHECK (chdir ("a"), "chdir \"a\"");
10   msg ("remove \"/a\" (must not crash)");
11   if (remove ("/a"))
12     CHECK (!chdir ("/a"),
13            "chdir \"/a\" (remove succeeded so this must return false)");
14   else
15     CHECK (chdir ("/a"), "chdir \"/a\" (remove failed so this must succeed)");
16 }