Commit Graph

13 Commits

Author SHA1 Message Date
Petri Lehtinen
1b02f3546c Distribute stripped unit test data
Apparently, it was forgotten to add these files to
test/testdata/Makefile.am in commit
04d550b02e.
2009-10-20 21:23:49 +03:00
Petri Lehtinen
5406c2b3d3 load: Check for integer and real overlfows and underflows 2009-09-13 13:18:01 +03:00
Petri Lehtinen
04d550b02e Add stripped unit tests for decoder
That is, test cases where there's no newline or other whitespace at
the beginning or end of input. This was implemented by adding a
--strip option to split-testfile to strip the input file after writing
it.

The actual test JSON texts are the same as testdata/invalid and
testdata/valid. The expected output of the invalid cases had to be
adjusted a bit: because there's no newline at the end, some of the
line numbers needed to be changed.
2009-09-08 17:03:01 +03:00
Petri Lehtinen
390b0ba633 Distribute appropriate files 2009-08-25 21:48:34 +03:00
Petri Lehtinen
ee2d164025 Detect garbage near EOF in json_loadf() and json_load_file() 2009-08-24 20:58:59 +03:00
Petri Lehtinen
b348519e96 Fix some memory leaks and invalid memory references 2009-07-28 10:38:21 +03:00
Petri Lehtinen
f60c563bab Enhance test system
- Tests are now named
- Testlogs are preserved between runs
- Tests can be run through Valgrind Memcheck tool
2009-07-28 10:36:16 +03:00
Petri Lehtinen
d3b3055a34 Expand encoder test coverage 2009-07-26 21:51:45 +03:00
Petri Lehtinen
20efe4aa26 Expand parser and Unicode test coverage 2009-07-26 11:31:25 +03:00
Petri Lehtinen
9240146c10 Implement support for \u escapes 2009-07-16 09:58:23 +03:00
Petri Lehtinen
df307f1bc3 Report errors from lexical and stream level in parser
Before, only the syntax level (parse_*) was able to set the error
string. This patch fixes the situation so that lexical (lex_*) and
stream (stream_*) levels can report detailed error messages.

Also, instead of 0, EOF is now returned by stream on error.
2009-07-14 00:24:39 +03:00
Petri Lehtinen
625f50f916 Streamify the loader
It's no longer needed to load the whole input into a string and then
parse from the string. Instead, the input is read as needed from
a string or file.
2009-07-13 21:45:16 +03:00
Petri Lehtinen
8ef778c843 Add some tests 2009-07-09 21:01:40 +03:00