7f81a0bef234c5e18030fda20dd0f34b77309f54
[pintos-anon] / src / tests / filesys / extended / dir-rm-cwd.c
1 /* Tries to remove the current directory.
2    This is allowed to succeed or fail.
3    Then creates a file in the root to make sure that we haven't
4    corrupted any directory state. */
5
6 #include <syscall.h>
7 #include "tests/lib.h"
8 #include "tests/main.h"
9
10 void
11 test_main (void) 
12 {
13   CHECK (mkdir ("a"), "mkdir \"a\"");
14   CHECK (chdir ("a"), "chdir \"a\"");
15   msg ("remove \"/a\" (must not crash)");
16   remove ("/a");
17   msg ("create \"b\" (must not crash)");
18   create ("b", 123);
19 }