Make the default simulator qemu for project 2...4,
[pintos-anon] / src / tests / filesys / extended / dir-rm-vine.c
index 990bcb42b6eb20a4831f21c7c42fe61fd18b9641..e01ff49c1235b02914f2921f3c5f96976efd1545 100644 (file)
@@ -1,3 +1,7 @@
+/* Creates a "vine" of directories /0/1/2/3/4/5/6/7/8/9
+   and changes directory into each of them,
+   then remove them. */
+
 #include <string.h>
 #include <syscall.h>
 #include "tests/lib.h"
@@ -6,7 +10,7 @@
 void
 test_main (void) 
 {
-  const char *filename = "/0/1/2/3/4/5/6/7/8/9/test";
+  const char *file_name = "/0/1/2/3/4/5/6/7/8/9/test";
   int fd;
   char tmp[128];
   
@@ -19,16 +23,16 @@ test_main (void)
   CHECK (create ("test", 512), "create \"test\"");
 
   CHECK (chdir ("/"), "chdir \"/\"");
-  CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
-  msg ("close \"%s\"", filename);
+  CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
+  msg ("close \"%s\"", file_name);
   close (fd);
 
-  strlcpy (tmp, filename, sizeof tmp);
+  strlcpy (tmp, file_name, sizeof tmp);
   while (strlen (tmp) > 0)
     {
       CHECK (remove (tmp), "remove \"%s\"", tmp);
       *strrchr (tmp, '/') = 0;
     }
 
-  CHECK (open (filename) == -1, "open \"%s\" (must return -1)", filename);
+  CHECK (open (file_name) == -1, "open \"%s\" (must return -1)", file_name);
 }