From: Baptiste L. <bap...@gm...> - 2009-11-18 22:03:26
|
I just added the tests from jsonchecker (http://json.org/JSON_checker/). The good news is that we only have missing failures, all the "pass" tests pass... Failure details can be found below. I have modified the reader to allow support of a "strict" mode. The Reader now accept a Features instance which describes which extension are allowed. JsonCpp supports for comments and non array/object as root value (see features.h) for instance. The failures fall into a few categories: 1. Extra text after root JSON value 2. Forbidden control character inside string 3. Bad real number 4. Too deep nesting of values My take on this would be to make 1 & 4 extensions (features that can be turned off), and 2 & 3 always fail. 1 makes is already supported by python JSON API 4 makes sense for portability, but can be handy (assuming the nesting limitation is not only for array) Has anyone a different mind on this? Anyone willing to tackle some of the failure? (on a side note, I fixed unit tests execution when running with scons). * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail10.json Parsing should have failed: {"Extra value after close": true} "misplaced quoted value" * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail13.json Parsing should have failed: {"Numbers cannot have leading zeroes": 013} * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail18.json Parsing should have failed: [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail25.json Parsing should have failed: [" tab character in string "] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail27.json Parsing should have failed: ["line break"] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail29.json Parsing should have failed: [0e] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail30.json Parsing should have failed: [0e+] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail31.json Parsing should have failed: [0e+-1] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail7.json Parsing should have failed: ["Comma after the close"], * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail8.json Parsing should have failed: ["Extra close"]] Test results: 29 passed, 10 failed. |