From aeaf53ea136a14a192db65fdb8e70ee8d1cd720a Mon Sep 17 00:00:00 2001
From: h2-addad <hamza2.addad@live.uwe.ac.uk>
Date: Sun, 16 Jul 2023 15:13:33 +0000
Subject: [PATCH] Upload New File

---
 src/tests/vm/mmap-exit.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 src/tests/vm/mmap-exit.c

diff --git a/src/tests/vm/mmap-exit.c b/src/tests/vm/mmap-exit.c
new file mode 100644
index 0000000..7a2278a
--- /dev/null
+++ b/src/tests/vm/mmap-exit.c
@@ -0,0 +1,22 @@
+/* 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);
+}
-- 
GitLab