aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2009-10-29load: Parse a badly put - sign correctlyPetri Lehtinen2-2/+32
Thanks to Manolis Delakis for reporting.
2009-10-27json_load_file: Initialize the error struct properlyPetri Lehtinen3-1/+27
Failing to do this has the effect that the error message is not returned when the input file cannot be opened (e.g. if it doesn't exist). Thanks to Martin Vopatek for reporting.
2009-10-20Distribute stripped unit test dataPetri Lehtinen1-1/+1
Apparently, it was forgotten to add these files to test/testdata/Makefile.am in commit 04d550b02e8eadc0c9fb1966fe42fe9fc25f89e0.
2009-10-16Fix indentationPetri Lehtinen3-5/+5
No functional changes.
2009-10-15Enhance handling of circular referencesPetri Lehtinen2-0/+76
It's now an error to try to add an object or array to itself. The encoder checks for circular references and fails with an error status if one is detected.
2009-10-14Make integer, real and string mutablePetri Lehtinen1-0/+28
Added functions: json_string_set json_integer_set json_real_set While at it, clarify the documentation and parameter naming of json_{string,integer,real}_value() a bit.
2009-10-11Extend object APIPetri Lehtinen1-4/+139
Added functions: json_object_size json_object_clear json_object_update
2009-10-10Fix API tests for objectPetri Lehtinen2-1/+3
Because of a typo in test/testprogs/Makefile.am, the tests for object were never compiled or run.
2009-09-29Extend array APIPetri Lehtinen2-6/+243
Added functions: json_array_insert json_array_insert_new json_array_remove json_array_clear json_array_extend
2009-09-13load: Check for integer and real overlfows and underflowsPetri Lehtinen2-0/+50
2009-09-11test/json-compare.py: Use json module from Python >=2.6 or simplejsonPetri Lehtinen1-3/+6
2009-09-08Add stripped unit tests for decoderPetri Lehtinen6-7/+287
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-07test/.gitignore: Add testprogs/test_simplePetri Lehtinen1-0/+1
2009-09-06Better argument validationPetri Lehtinen3-3/+37
All pointer arguments are now tested for NULL. json_string() now also tests that strdup() succeeds. This is to ensure that no NULL values end up in data structures. Also desribe the different sources of errors in documentation.
2009-09-06Expand test coveragePetri Lehtinen3-2/+109
Now all public API functions are tested (at least on some level) in the test-api suite.
2009-09-04Add reference stealing functions for inserting values to objects and arraysPetri Lehtinen2-1/+17
The non-stealing functions are now just simple wrappers around these.
2009-08-25Distribute appropriate filesPetri Lehtinen2-0/+10
2009-08-25test: Add Makefile.am to test/testprogsPetri Lehtinen2-3/+13
This way it's an individual subdirectory and things go easier.
2009-08-25Add some missing copyright noticesPetri Lehtinen2-0/+12
2009-08-24Detect garbage near EOF in json_loadf() and json_load_file()Petri Lehtinen1-0/+11
2009-08-24Add test for numbersPetri Lehtinen3-1/+46
2009-08-23Expand value test coveragePetri Lehtinen6-2/+256
2009-08-23run-test: Don't remove all testlogs when starting a new test suitePetri Lehtinen1-2/+1
2009-07-30Add LICENSE and a copyright note to all sourcesPetri Lehtinen7-0/+41
2009-07-28Rename json_{load,dump} to json_{load,dump}_filePetri Lehtinen4-6/+6
2009-07-28Fix some memory leaks and invalid memory referencesPetri Lehtinen1-0/+5
2009-07-28Enhance test systemPetri Lehtinen9-137/+170
- Tests are now named - Testlogs are preserved between runs - Tests can be run through Valgrind Memcheck tool
2009-07-26Expand encoder test coveragePetri Lehtinen2-1/+5
2009-07-26Expand parser and Unicode test coveragePetri Lehtinen7-17/+123
2009-07-16Implement support for \u escapesPetri Lehtinen2-0/+28
2009-07-14Report errors from lexical and stream level in parserPetri Lehtinen1-5/+5
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-13Streamify the loaderPetri Lehtinen1-7/+7
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-13Get rid of json_dumpfd and json_loadfdPetri Lehtinen4-28/+1
fdopen() makes supporting separate API for file descriptors useless. Supporting fd's also makes Jansson less portable.
2009-07-09Add some testsPetri Lehtinen13-0/+485