Commit Graph

12 Commits

Author SHA1 Message Date
Matthias Schiffer
d13cfe10f6 tests/tests1: fix printf format for size_t arguments
Change %d to %llu and add cast to unsigned long long for size_t arguments,
otherwise compilation will fail with errors like:

test1.c:70:15: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Werror=format=]

%zu is avoided to stay compatible with old libc versions (like old Visual
Studio).
2016-06-07 10:49:42 +02:00
Eric Haszlakiewicz
996be85843 Fix a few places that needed adjustment for the size_t changes, including updating the range checks to use a calculated SIZE_T_MAX. 2016-05-23 02:10:58 +00:00
Eric Haszlakiewicz
3345b25962 Add tests for the json_object_array_del_idx() function. 2016-04-30 19:09:45 +00:00
chenha0
dffdee966f Fix issue #221: JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly
Tests added.
2016-01-21 20:12:48 +08:00
Eric Haszlakiewicz
316da85818 Fix issue #201: add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off escaping of forward slashes. 2015-11-28 20:00:30 -06:00
Michael Vetter
fcf5ad1bd6 Remove trailing whitespace 2014-08-26 14:48:59 +02: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
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
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
1e89ba68af Create a tests subdirectory and move one of the test to there. 2012-04-22 10:27:50 -05:00