cf36c178fb152c4dd10a8fe8cb88a4329e234ba9
[pintos-anon] / grading / filesys / grow-file-size.c
1 /* -*- c -*- */
2
3 #include <syscall.h>
4 #include "fslib.h"
5
6 const char test_name[] = "grow-file-size";
7 static char buf[2134];
8
9 static size_t
10 return_block_size (void) 
11 {
12   return 37;
13 }
14
15 static void
16 check_file_size (int fd, long ofs) 
17 {
18   long size = filesize (fd);
19   if (size != ofs)
20     fail ("filesize not updated properly: should be %ld, actually %ld",
21           ofs, size);
22 }
23
24 void
25 test_main (void) 
26 {
27   seq_test ("testfile",
28             buf, sizeof buf, 0,
29             return_block_size, check_file_size);
30 }