summaryrefslogtreecommitdiff
path: root/usertests.c
diff options
context:
space:
mode:
Diffstat (limited to 'usertests.c')
-rw-r--r--usertests.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/usertests.c b/usertests.c
index a449ed0..59cb0b3 100644
--- a/usertests.c
+++ b/usertests.c
@@ -984,6 +984,7 @@ fourteen(void)
{
int fd;
+ // DIRSIZ is 14.
printf(1, "fourteen test\n");
if(mkdir("12345678901234") != 0){
@@ -1019,6 +1020,45 @@ fourteen(void)
printf(1, "fourteen ok\n");
}
+void
+rmdot(void)
+{
+ printf(1, "rmdot test\n");
+ if(mkdir("dots") != 0){
+ printf(1, "mkdir dots failed\n");
+ exit();
+ }
+ if(chdir("dots") != 0){
+ printf(1, "chdir dots failed\n");
+ exit();
+ }
+ if(unlink(".") == 0){
+ printf(1, "rm . worked!\n");
+ exit();
+ }
+ if(unlink("..") == 0){
+ printf(1, "rm .. worked!\n");
+ exit();
+ }
+ if(chdir("/") != 0){
+ printf(1, "chdir / failed\n");
+ exit();
+ }
+ if(unlink("dots/.") == 0){
+ printf(1, "unlink dots/. worked!\n");
+ exit();
+ }
+ if(unlink("dots/..") == 0){
+ printf(1, "unlink dots/.. worked!\n");
+ exit();
+ }
+ if(unlink("dots") != 0){
+ printf(1, "unlink dots failed!\n");
+ exit();
+ }
+ printf(1, "rmdot ok\n");
+}
+
int
main(int argc, char *argv[])
{
@@ -1040,6 +1080,7 @@ main(int argc, char *argv[])
preempt();
exitwait();
+ rmdot();
fourteen();
bigfile();
subdir();