X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ffailtest%2Ftest%2Frun-failpath.c;h=9795ee9d054f9810b4aecd2c1a1f73bf2689efbb;hp=c5aca9ef88f6ceb97609855db820cfcf30106834;hb=c438ec17d7b2efe76e56e5fc5ab88bd4a02735e8;hpb=f0002cb9e4f6f403a25ad50252c06694439900f0 diff --git a/ccan/failtest/test/run-failpath.c b/ccan/failtest/test/run-failpath.c index c5aca9ef..9795ee9d 100644 --- a/ccan/failtest/test/run-failpath.c +++ b/ccan/failtest/test/run-failpath.c @@ -1,9 +1,9 @@ +#include #include #include #include #include #include -#include int main(void) { @@ -11,14 +11,15 @@ int main(void) void *p; plan_tests(14); + failtest_init(0, NULL); failpath = "mceopwrMCEOPWR"; ok1((p = failtest_malloc(10, "run-failpath.c", 1)) != NULL); ok1(failtest_calloc(10, 5, "run-failpath.c", 1) != NULL); ok1((p = failtest_realloc(p, 100, "run-failpath.c", 1)) != NULL); - ok1((fd = failtest_open("failpath-scratch", O_RDWR|O_CREAT, - "run-failpath.c", 1, 0600)) >= 0); + ok1((fd = failtest_open("failpath-scratch", "run-failpath.c", 1, + O_RDWR|O_CREAT, 0600)) >= 0); ok1(failtest_pipe(fds, "run-failpath.c", 1) == 0); ok1(failtest_write(fd, "xxxx", 4, "run-failpath.c", 1) == 4); lseek(fd, 0, SEEK_SET); @@ -28,8 +29,8 @@ int main(void) ok1(failtest_malloc(10, "run-failpath.c", 1) == NULL); ok1(failtest_calloc(10, 5, "run-failpath.c", 1) == NULL); ok1(failtest_realloc(p, 100, "run-failpath.c", 1) == NULL); - ok1(failtest_open("failpath-scratch", O_RDWR|O_CREAT, - "run-failpath.c", 1, 0600) == -1); + ok1(failtest_open("failpath-scratch", "run-failpath.c", 1, + O_RDWR|O_CREAT, 0600) == -1); ok1(failtest_pipe(fds, "run-failpath.c", 1) == -1); ok1(failtest_write(fd, "xxxx", 4, "run-failpath.c", 1) == -1); lseek(fd, 0, SEEK_SET);