add test for rm .
This commit is contained in:
parent
15b326b630
commit
5e03dd86c8
2 changed files with 41 additions and 3 deletions
3
BUGS
3
BUGS
|
@ -31,9 +31,6 @@ sysfile.c:
|
|||
general:
|
||||
sizeof parens?
|
||||
|
||||
usertests.c:
|
||||
check for rm of . or ..
|
||||
|
||||
L=$HOME/mit/l
|
||||
(for i in *.c; do xoc -x xgnu -x ./nodecleq.zeta --typesonly $i; done) 2>&1 | grep warning
|
||||
|
||||
|
|
41
usertests.c
41
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();
|
||||
|
|
Loading…
Reference in a new issue