Make the default simulator qemu for project 2...4,
[pintos-anon] / src / tests / filesys / extended / grow-too-big.c
index 5edcf955a1eefa1350f2f64be8a59b2235b2036d..a908e45fa648ca098606b0e0726cd798a35ee451 100644 (file)
@@ -1,3 +1,6 @@
+/* Checks that trying to grow a file beyond the capacity of the
+   file system behaves reasonably (does not crash). */
+
 #include <limits.h>
 #include <syscall.h>
 #include "tests/lib.h"
@@ -6,15 +9,16 @@
 void
 test_main (void) 
 {
-  const char *filename = "fumble";
+  const char *file_name = "fumble";
   char zero = 0;
   int fd;
   
-  CHECK (create (filename, 0), "create \"%s\"", filename);
-  CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
-  msg ("seek \"%s\"", filename);
+  CHECK (create (file_name, 0), "create \"%s\"", file_name);
+  CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
+  msg ("seek \"%s\"", file_name);
   seek (fd, UINT_MAX);
-  CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", filename);
-  msg ("close \"%s\"", filename);
+  msg ("write \"%s\"", file_name);
+  write (fd, &zero, 1);
+  msg ("close \"%s\"", file_name);
   close (fd);
 }