00001 /* Checks that growing a file updates the file position 00002 correctly. */ 00003 00004 #include <syscall.h> 00005 #include "tests/filesys/seq-test.h" 00006 #include "tests/lib.h" 00007 #include "tests/main.h" 00008 00009 static char buf[2134]; 00010 00011 static size_t 00012 return_block_size (void) 00013 { 00014 return 37; 00015 } 00016 00017 static void 00018 check_tell (int fd, long ofs) 00019 { 00020 long pos = tell (fd); 00021 if (pos != ofs) 00022 fail ("file position not updated properly: should be %ld, actually %ld", 00023 ofs, pos); 00024 } 00025 00026 void 00027 test_main (void) 00028 { 00029 seq_test ("foobar", 00030 buf, sizeof buf, 0, 00031 return_block_size, check_tell); 00032 }