summaryrefslogtreecommitdiffstats
path: root/src/tests/userprog/close-normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/userprog/close-normal.c')
-rw-r--r--src/tests/userprog/close-normal.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/userprog/close-normal.c b/src/tests/userprog/close-normal.c
new file mode 100644
index 0000000..8ce04e3
--- /dev/null
+++ b/src/tests/userprog/close-normal.c
@@ -0,0 +1,14 @@
+/* Opens a file and then closes it. */
+
+#include <syscall.h>
+#include "tests/lib.h"
+#include "tests/main.h"
+
+void
+test_main (void)
+{
+ int handle;
+ CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
+ msg ("close \"sample.txt\"");
+ close (handle);
+}