chenguoping
76e1472808
testcase for array_list
5 years ago
dota17
8b162c4b89
clang-format the files
5 years ago
dota17
010f33d460
add json_object_new_null
5 years ago
Eric Haszlakiewicz
fd9b3b2260
Issue #332 : fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length.
Add a test that triggers the problem to ensure it stays fixed.
8 years ago
Eric Haszlakiewicz
3948fcad2d
Issue #300 : Cast size_t values to int instead of unsigned long long to work around broken behavior of MinGW.
8 years ago
Eric Haszlakiewicz
75825a9f01
Use strdup instead of strndup in test1.c, there's no need for the latter because json_object_to_json_string_length() will always return a properly sized string.
8 years ago
Eric Haszlakiewicz
5fccfed4f4
Issue #260 : add a check to prevent trivial loops in the object tree, even though it is up to the callers to avoid doing so in more complex cases.
9 years ago
Eric Haszlakiewicz
61cd433131
Merge branch 'tests' of https://github.com/RyDroid/json-c into RyDroid-tests
Conflicts:
tests/test_util_file.c
9 years ago
Nicola Spanti (RyDroid)
8215c0ac0e
Very minor changes to some tests
9 years ago
José Bollo
1fceb2207a
test: add test of 'json_object_to_json_string_length'
The test is implied in test1.
The idea is to check that the returned lengths and strings
are identical to what is expected to return the already
tested function 'json_object_to_json_string_ext'.
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
9 years ago
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).
9 years ago
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.
9 years ago
Eric Haszlakiewicz
3345b25962
Add tests for the json_object_array_del_idx() function.
9 years ago
chenha0
dffdee966f
Fix issue #221 : JSON_C_TO_STRING_NOSLASHESCAPE works incorrectly
Tests added.
9 years ago
Eric Haszlakiewicz
316da85818
Fix issue #201 : add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off escaping of forward slashes.
9 years ago
Michael Vetter
fcf5ad1bd6
Remove trailing whitespace
11 years ago
Eric Haszlakiewicz
aec876357c
Add a missing json_object_get() so we don't try to use a freed object in test1.
13 years ago
Eric Haszlakiewicz
c3d1d597ab
Fix a memory leak in test1 with respect to how json_object_object_del was used.
13 years ago
Eric Haszlakiewicz
c3068bfd09
Reformat the test sources. No functional change.
13 years ago
Mateusz Loskot
271c53ebdd
Missing explicit casts from void* to specific pointers required. Added #define strcasecmp for Visual C++.
13 years ago
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).
13 years ago
Eric Haszlakiewicz
1e89ba68af
Create a tests subdirectory and move one of the test to there.
13 years ago