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