1 /* Creates a "vine" of directories /0/1/2/3/4/5/6/7/8/9
2 and changes directory into each of them,
8 #include "tests/main.h"
13 const char *filename = "/0/1/2/3/4/5/6/7/8/9/test";
18 for (tmp[0] = '0'; tmp[0] <= '9'; tmp[0]++)
20 CHECK (mkdir (tmp), "mkdir \"%s\"", tmp);
21 CHECK (chdir (tmp), "chdir \"%s\"", tmp);
23 CHECK (create ("test", 512), "create \"test\"");
25 CHECK (chdir ("/"), "chdir \"/\"");
26 CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
27 msg ("close \"%s\"", filename);
30 strlcpy (tmp, filename, sizeof tmp);
31 while (strlen (tmp) > 0)
33 CHECK (remove (tmp), "remove \"%s\"", tmp);
34 *strrchr (tmp, '/') = 0;
37 CHECK (open (filename) == -1, "open \"%s\" (must return -1)", filename);