diff -r a9a1d07a6840 -r 05910a8994f7 tests/test_json.c --- a/tests/test_json.c Sat Nov 02 19:27:45 2024 +0100 +++ b/tests/test_json.c Sat Nov 02 19:37:59 2024 +0100 @@ -59,7 +59,7 @@ CxJson json; cxJsonInit(&json); - cxJsonFill(&json, text.ptr, text.length); + cxJsonFill(&json, text); // parse the big fat object CxJsonValue *obj; @@ -130,7 +130,7 @@ size_t part = 0; while(part < nparts) { - cxJsonFill(&json, parts[part].ptr, parts[part].length); + cxJsonFill(&json, parts[part]); part++; result = cxJsonNext(&json, &obj); @@ -191,7 +191,7 @@ for(int i=0;i<5;i++) { cxJsonInit(&json); - cxJsonFill(&json, tests[i].ptr, tests[i].length); + cxJsonFill(&json, tests[i]); result = cxJsonNext(&json, &obj); CX_TEST_ASSERT(result == -1); @@ -207,7 +207,7 @@ cxstring text = cx_str("{\"test\": [{},{\"foo\": [[{\"bar\":[4, 2, [null, {\"key\": 47}]]}]]}]}"); CX_TEST_DO { cxJsonInit(&json); - cxJsonFill(&json, text.ptr, text.length); + cxJsonFill(&json, text); cxJsonNext(&json, &d1); CX_TEST_ASSERT(d1 != NULL); @@ -246,6 +246,17 @@ } } +CX_TEST(test_json_number) { + CxJson json; + cxJsonInit(&json); + CX_TEST_DO { + CxJsonValue *v; + + cxJsonNext(&json, &v); + } + cxJsonDestroy(&json); +} + CxTestSuite *cx_test_suite_json(void) { CxTestSuite *suite = cx_test_suite_new("json");