Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / extended / dir-rm-cwd.c
diff --git a/src/tests/filesys/extended/dir-rm-cwd.c b/src/tests/filesys/extended/dir-rm-cwd.c
new file mode 100644 (file)
index 0000000..3e6fc44
--- /dev/null
@@ -0,0 +1,14 @@
+#include <syscall.h>
+#include "tests/lib.h"
+#include "tests/main.h"
+
+void
+test_main (void) 
+{
+  CHECK (mkdir ("a"), "mkdir \"a\"");
+  CHECK (chdir ("a"), "chdir \"a\"");
+  msg ("remove \"/a\" (must not crash)");
+  remove ("/a");
+  msg ("create \"b\" (must not crash)");
+  create ("b", 123);
+}