From 8ef778c8431c17d970b2667943c6ea13c3770912 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Thu, 9 Jul 2009 21:01:40 +0300 Subject: Add some tests --- test/loadf_dumpf.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/loadf_dumpf.c (limited to 'test/loadf_dumpf.c') diff --git a/test/loadf_dumpf.c b/test/loadf_dumpf.c new file mode 100644 index 0000000..5d42156 --- /dev/null +++ b/test/loadf_dumpf.c @@ -0,0 +1,24 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + json_t *json; + json_error_t error; + + if(argc != 1) { + fprintf(stderr, "usage: %s\n", argv[0]); + return 2; + } + + json = json_loadf(stdin, &error); + if(!json) { + fprintf(stderr, "%d\n%s\n", error.line, error.text); + return 1; + } + + json_dumpf(json, stdout, 0); + json_decref(json); + + return 0; +} -- cgit v1.1