random: Fix behavior of kernel option "-rs".
[pintos-anon] / src / tests / filesys / extended / grow-tell.c
1 /* Checks that growing a file updates the file position
2    correctly. */
3
4 #include <syscall.h>
5 #include "tests/filesys/seq-test.h"
6 #include "tests/lib.h"
7 #include "tests/main.h"
8
9 static char buf[2134];
10
11 static size_t
12 return_block_size (void) 
13 {
14   return 37;
15 }
16
17 static void
18 check_tell (int fd, long ofs) 
19 {
20   long pos = tell (fd);
21   if (pos != ofs)
22     fail ("file position not updated properly: should be %ld, actually %ld",
23           ofs, pos);
24 }
25
26 void
27 test_main (void) 
28 {
29   seq_test ("foobar",
30             buf, sizeof buf, 0,
31             return_block_size, check_tell);
32 }