aboutsummaryrefslogtreecommitdiff
path: root/tests/fs/test_append.c
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-16 14:40:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-16 14:40:45 -0700
commitba387574f23867d889a04f1586e6dd9597e8bad8 (patch)
tree6934000fdd9c173c552a382676b5046f58877b26 /tests/fs/test_append.c
parent7acb48826165890ebc9d3794d8d7473aa62b762e (diff)
parent7c26bbdb7d3c40d68777cc93f54ebfa5355a48bc (diff)
Merge branch 'incoming' into proxyGL
Diffstat (limited to 'tests/fs/test_append.c')
-rw-r--r--tests/fs/test_append.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/fs/test_append.c b/tests/fs/test_append.c
new file mode 100644
index 00000000..27909ba3
--- /dev/null
+++ b/tests/fs/test_append.c
@@ -0,0 +1,24 @@
+#include<assert.h>
+#include<stdio.h>
+
+int main (int argc, char *argv[])
+{
+ FILE *fp;
+ int res;
+ long len;
+
+ fp = fopen("testappend", "wb+");
+ res = fwrite("1234567890", 10, 1, fp);
+ fclose(fp);
+
+ fp = fopen("testappend", "ab+");
+ res = fwrite("1234567890", 10, 1, fp);
+
+ fseek(fp, -7, SEEK_END);
+ len = ftell(fp);
+ assert(len == 13);
+ fclose(fp);
+
+ puts("success");
+ return 0;
+}