More filesys tests.
[pintos-anon] / grading / filesys / grow-sparse.c
1 /* -*- c -*- */
2
3 #include <syscall.h>
4 #include "fslib.h"
5
6 const char test_name[] = "grow-sparse";
7 static char buf[76543];
8
9 void
10 test_main (void) 
11 {
12   char zero = 0;
13   int fd;
14   
15   check (create ("testfile", 0), "create \"testfile\"");
16   check ((fd = open ("testfile")) > 1, "open \"testfile\"");
17   msg ("seek \"testfile\"");
18   seek (fd, sizeof buf - 1);
19   check (write (fd, &zero, 1) > 0, "write \"testfile\"");
20   msg ("close \"testfile\"");
21   close (fd);
22   check_file ("testfile", buf, sizeof buf);
23 }