This repository has been archived on 2021-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
OS/pintos-env/pintos/tests/filesys/extended/dir-rm-parent.c

17 lines
418 B
C
Raw Normal View History

/* Tries to remove a parent of the current directory. This must
fail, because that directory is non-empty. */
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
CHECK (mkdir ("a"), "mkdir \"a\"");
CHECK (chdir ("a"), "chdir \"a\"");
CHECK (mkdir ("b"), "mkdir \"b\"");
CHECK (chdir ("b"), "chdir \"b\"");
CHECK (!remove ("/a"), "remove \"/a\" (must fail)");
}