]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/test/run-open.c
failtest, rbuf: fix up incorrect lseek arg order.
[ccan] / ccan / failtest / test / run-open.c
index e055045739d619db301f3cf98cddcb24b0def734..8b31ff71f35e73349e7ac1e9a060ef7014721c53 100644 (file)
@@ -1,11 +1,11 @@
+/* Include the C files directly. */
+#include <ccan/failtest/failtest.c>
 #include <stdlib.h>
 #include <setjmp.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <assert.h>
 #include <ccan/tap/tap.h>
-/* Include the C files directly. */
-#include <ccan/failtest/failtest.c>
 
 int main(void)
 {
@@ -14,6 +14,7 @@ int main(void)
        struct stat st;
 
        plan_tests(12);
+       failtest_init(0, NULL);
 
        if (pipe(pfd))
                abort();
@@ -28,7 +29,7 @@ int main(void)
        }
        /* Check it is read-write. */
        ok1(write(fd, buf, strlen(buf)) == strlen(buf));
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
        ok1(read(fd, buf, strlen("Hello world!")) == strlen("Hello world!"));
        ok1(strcmp(buf, "Hello world!") == 0);