X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftest_json.c;h=4a3c0a62192ce8287abf727bdbe7295f81fbd18b;hb=79786d23233dc896ecb0f68580298a8759592577;hp=d402c0ebd716aa12714c5123d3cca17642d02966;hpb=8fc5b2c281ffb8dcb97af9816aabbe04c37a8599;p=yaz-moved-to-github.git diff --git a/test/test_json.c b/test/test_json.c index d402c0e..4a3c0a6 100644 --- a/test/test_json.c +++ b/test/test_json.c @@ -1,13 +1,21 @@ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2012 Index Data + * See the file LICENSE for details. + */ /** - * \file + * \file * \brief JSON test */ +#if HAVE_CONFIG_H +#include +#endif + #include #include #include #include -static int expect(json_parser_t p, const char *input, +static int expect(json_parser_t p, const char *input, const char *output) { int ret = 0; @@ -76,7 +84,7 @@ static void tst1(void) YAZ_CHECK(expect(p, "{} extra", 0)); YAZ_CHECK(expect(p, "{\"a\":[1,2,3}", 0)); - + YAZ_CHECK(expect(p, "{\"a\":[1,2,", 0)); YAZ_CHECK(expect(p, "{\"k\":\"wa\"}", "{\"k\":\"wa\"}")); @@ -142,7 +150,7 @@ static void tst2(void) return; YAZ_CHECK_EQ(json_count_children(n), 3); - + n1 = json_get_object(n, "a"); YAZ_CHECK(n1 && n1->type == json_node_number && n1->u.number == 1.0); YAZ_CHECK_EQ(json_count_children(n1), 0);