Consistently spell "file name" and "file system" as two words.
[pintos-anon] / src / tests / filesys / extended / dir-mk-vine.c
1 /* Creates a "vine" of directories /0/1/2/3/4/5/6/7/8/9
2    and changes directory into each of them,
3    then creates a test file in the bottommost
4    and verifies that it can be opened by absolute name. */
5
6 #include <syscall.h>
7 #include "tests/lib.h"
8 #include "tests/main.h"
9
10 void
11 test_main (void) 
12 {
13   const char *file_name = "/0/1/2/3/4/5/6/7/8/9/test";
14   char dir[2];
15   
16   dir[1] = '\0';
17   for (dir[0] = '0'; dir[0] <= '9'; dir[0]++) 
18     {
19       CHECK (mkdir (dir), "mkdir \"%s\"", dir);
20       CHECK (chdir (dir), "chdir \"%s\"", dir);
21     }
22   CHECK (create ("test", 512), "create \"test\"");
23   CHECK (chdir ("/"), "chdir \"/\"");
24   CHECK (open (file_name) > 1, "open \"%s\"", file_name);
25 }
26