Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / extended / grow-tell.c
diff --git a/src/tests/filesys/extended/grow-tell.c b/src/tests/filesys/extended/grow-tell.c
new file mode 100644 (file)
index 0000000..3f1e211
--- /dev/null
@@ -0,0 +1,29 @@
+#include <syscall.h>
+#include "tests/filesys/seq-test.h"
+#include "tests/lib.h"
+#include "tests/main.h"
+
+static char buf[2134];
+
+static size_t
+return_block_size (void) 
+{
+  return 37;
+}
+
+static void
+check_tell (int fd, long ofs) 
+{
+  long pos = tell (fd);
+  if (pos != ofs)
+    fail ("file position not updated properly: should be %ld, actually %ld",
+          ofs, pos);
+}
+
+void
+test_main (void) 
+{
+  seq_test ("foobar",
+            buf, sizeof buf, 0,
+            return_block_size, check_tell);
+}