78e84b1c76b48613947ecc23fc4e4c3b9f120a29
[pintos-anon] / src / tests / filesys / extended / dir-rm-parent.c
1 /* Tries to remove the change of parents of the current
2    directory.
3    This can succeed or fail as long as it doesn't crash. */
4
5 #include <syscall.h>
6 #include "tests/lib.h"
7 #include "tests/main.h"
8
9 void
10 test_main (void) 
11 {
12   CHECK (mkdir ("a"), "mkdir \"a\"");
13   CHECK (chdir ("a"), "chdir \"a\"");
14   CHECK (mkdir ("b"), "mkdir \"b\"");
15   CHECK (chdir ("b"), "chdir \"b\"");
16   msg ("remove \"/b\" (must not crash)");
17   remove ("/b");
18   msg ("remove \"/a\" (must not crash)");
19   remove ("/a");
20 }