X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstring%2Ftest%2Frun-grab.c;h=2b36a0fb70d77ba03b59ae83cb64ab66e6acb56b;hb=845cdae34801560b5970fafbbda0ed7fcc1e97db;hp=96b9dac852b428224171563e608c6126ec1e1f0f;hpb=be6b32cbe44df085efbae36c07b566bda88c6154;p=ccan diff --git a/ccan/string/test/run-grab.c b/ccan/string/test/run-grab.c index 96b9dac8..2b36a0fb 100644 --- a/ccan/string/test/run-grab.c +++ b/ccan/string/test/run-grab.c @@ -1,24 +1,4 @@ /* This is test for grab_file() function - * - * Example: - * - * void *grab_file(const void *ctx, const char *filename) - * { - * int fd; - * char *buffer; - * - * if (streq(filename, "-")) - * fd = dup(STDIN_FILENO); - * else - * fd = open(filename, O_RDONLY, 0); - * - * if (fd < 0) - * return NULL; - * - * buffer = grab_fd(ctx, fd); - * close_noerr(fd); - * return buffer; - * } */ #include @@ -37,7 +17,7 @@ main(int argc, char *argv[]) int length; struct stat st; - str = grab_file(NULL, "ccan/string/test/run-grab.c"); + str = grab_file(NULL, "ccan/string/test/run-grab.c", NULL); split = strsplit(NULL, str, "\n", NULL); length = strlen(split[0]); ok1(streq(split[0], "/* This is test for grab_file() function"));