Commit Graph

23 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
2e9fef38c2 Revert the test_null test back to emitted to stdout, and update the expected output to match. 2012-12-23 10:25:03 -06:00
Alexander Klauer
57f36ed32a Write additional test info to stderr instead of stdout so as not to mar the expected output 2012-12-19 10:52:50 +01:00
Alexander Klauer
827a4a97b9 Fixed memory leak in testReplaceExisting 2012-12-19 10:46:35 +01:00
Alexander Klauer
b1d61d10e1 Library is now called libjson-c 2012-12-18 18:46:24 +01:00
Eric Haszlakiewicz
4e4af93d66 Fix issue #53 - ensure explicit length string are still NUL terminated, and fix json_tokener_parse() to work properly with embedded unicode \u0000 values in strings.
Adjust test_null to check for this case.
See also http://bugs.debian.org/687269
2012-12-09 16:32:11 -06:00
Eric Haszlakiewicz
aec876357c Add a missing json_object_get() so we don't try to use a freed object in test1. 2012-11-29 15:06:17 -05:00
Eric Haszlakiewicz
447b88a115 Fix a memory leak in the test_printbuf test. 2012-11-29 13:29:55 -06:00
Eric Haszlakiewicz
f6b27cbb6c Make it safe to delete keys while iterating with the json_object_object_foreach macro. 2012-10-20 20:26:37 -05:00
Eric Haszlakiewicz
c3d1d597ab Fix a memory leak in test1 with respect to how json_object_object_del was used. 2012-09-16 20:49:22 -05:00
Eric Haszlakiewicz
c3068bfd09 Reformat the test sources. No functional change. 2012-09-16 20:43:29 -05:00
Eric Haszlakiewicz
4b1a0668a8 Update the set_serializer test to match the actual output. 2012-09-09 13:53:12 -05:00
Eric Haszlakiewicz
38f421a2e7 Add a json_set_serializer() function to allow the string output of a json_object to be customized. 2012-09-02 15:21:56 -05:00
Eric Haszlakiewicz
92f31bd99a Handle the \f escape sequence (the two characters: backslash followed by an f, not a literal formfeed) and extend the test_parse test to check all valid escape sequences. 2012-07-29 12:31:07 -05:00
Eric Haszlakiewicz
77c6239465 Initialize errno before calling sscanf in json_parse_int64() so parsing valid numbers after parsing an out of range number works. 2012-07-29 12:13:54 -05:00
Eric Haszlakiewicz
6988f53fcb Rewrite json_object_object_add to replace just the value if the key already exists so keys remain valid.
This is particularly useful when replacing values in a loop, since it allows
 the key used by json_object_object_foreach to continue to be used.
2012-07-24 23:27:41 -05:00
Mateusz Loskot
984303dfe5 Added a bunch of missing HAVE_* defines tested with ./configure script to fix compilation on Linux with GCC 4.7.1. The issue likely caused by my previous commits related to Visual C++ port of the code. 2012-06-19 20:15:44 +01:00
Mateusz Loskot
271c53ebdd Missing explicit casts from void* to specific pointers required. Added #define strcasecmp for Visual C++. 2012-05-22 23:51:44 +01:00
Eric Haszlakiewicz
4c7f38eb9b Extend test1 and test2 to run using json_object_to_json_string_ext() based on an additional command line parameter.
Extend the run_output_test() function so we actually can pass command line
 parameters and so we can support different output files for the same test
 executable.
Also provide some hints about what to do if a test fails (i.e. set VERBOSE=1).
2012-04-28 14:14:26 -05:00
Eric Haszlakiewicz
3d8817978c Actually save the expected output for the test_printbuf test so it passes. 2012-04-22 14:25:08 -05:00
Eric Haszlakiewicz
e5c1e87f05 Add a test for the printbuf functions. 2012-04-22 14:13:01 -05:00
Eric Haszlakiewicz
b80772a0f5 Use a different variable when referring to the json.la file, since the original lib_LTLIBRARIES means something special to automake. 2012-04-22 10:48:30 -05:00
Eric Haszlakiewicz
c1b8891a13 Move the rest of the tests into the tests subdirectory. 2012-04-22 10:33:41 -05:00
Eric Haszlakiewicz
1e89ba68af Create a tests subdirectory and move one of the test to there. 2012-04-22 10:27:50 -05:00