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/vm/mmap-exit.c

22 lines
526 B
C
Executable file

/* Executes child-mm-wrt and verifies that the writes that should
have occurred really did. */
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
pid_t child;
/* Make child write file. */
quiet = true;
CHECK ((child = exec ("child-mm-wrt")) != -1, "exec \"child-mm-wrt\"");
CHECK (wait (child) == 0, "wait for child (should return 0)");
quiet = false;
/* Check file contents. */
check_file ("sample.txt", sample, sizeof sample);
}