summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate unnecessary cast that was added to test_double_serializer.Eric Haszlakiewicz2020-06-071-1/+1
|
* The split of json_object into type-specific sub-structures is now ↵Eric Haszlakiewicz2020-06-072-5/+5
| | | | | | functionally complete. Remove all of the temporary defines, structures, old compat fuctions, extra fields, etc... that were needed during the conversion to a split set of json_object_* structures.
* Kick json_type_string out of struct json_object.Eric Haszlakiewicz2020-06-071-0/+4
| | | | | The default is now that string data is stored inline at the end of json_object, though to allow for json_object_set_string() to set a _longer_ string, we still need to allow for the possibility of a separate char * pointer. All json types have been split out now, next step it cleanup.
* Kick json_type_int and json_type_double out of struct json_object.Eric Haszlakiewicz2020-05-261-1/+1
| | | | Clean up the code in json_object_new_* a bit by dropping unnecesary json_object_base variables.
* Kick json_type_array out of struct json_object; re-enable the test_deep_copy ↵Eric Haszlakiewicz2020-05-251-2/+1
| | | | test.
* Start splitting struct json_object into multiple sub-types, as descibed at ↵Eric Haszlakiewicz2020-05-251-1/+2
| | | | | | | | | | | | https://github.com/json-c/json-c/wiki/Proposal:-struct-json_object-split The current changes split out _only_ json_type_object, and thus have a number of hacks to allow the code to continue to build and work. Originally mentioned in issue #535. When complete, this will probably invalidate #552. This is likely to cause notable conflicts in any other significant un-merged changes, such as PR#620.
* test_deep_copy: Fix assertion value.Björn Esser2020-05-181-1/+1
|
* tests: Fix test_double_serializer without thread-local storage.Björn Esser2020-05-181-0/+1
|
* Prevent truncation on custom double formatters.Tobias Stoeckmann2020-05-162-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | A custom double formatter can lead to truncation of the rest of the JSON document. If a custom formatter completely fills the buffer used by snprintf with a trailing dot or comma and the formatting option JSON_C_TO_STRING_NOZERO has been specified, then an iterator moves past the ending '\0' (off-by-one buffer overflow) to set an additional '\0' and adds the first '\0' into the printbuf. Since '\0' will eventually be considered the terminating character of the complete printbuf result, all trailing characters are lost. This leads to an incomplete JSON string as can be seen with the test case. The off-by-one can be noticed if compiled with address sanitizer. Since this is a very special case and a malformed formatter could do way more harm and is the responsibility of the user of this library, this is just a protective measure to keep json-c code as robust as possible.
* Improved support for IBM operating systemsDavid McCann2020-05-143-10/+10
| | | | Fix compiler errors and warnings when building on IBM operating systems such as AIX and IBM i.
* fix json_parse_uint64() usage of errnoPierce Lopez2020-05-101-4/+4
| | | | | introduced in #542 fixes #601
* Fix snprintf on windows problem for test4.Eric Haszlakiewicz2020-05-101-0/+1
|
* Re-format after recent change to fix linkhash.Eric Haszlakiewicz2020-05-101-2/+1
|
* Issue #599: Fix the backwards check in lh_table_insert_w_hash() that was ↵Eric Haszlakiewicz2020-05-102-0/+30
| | | | | | preventing adding more than 11 objects. Add a test to check for this too.
* Add a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to ↵Eric Haszlakiewicz2020-04-212-1/+11
| | | | allow multiple objects to be parsed from input even when JSON_TOKENER_STRICT is set.
* Add an tok_flags field to explicitly specify tokener flags in test_parse and ↵Eric Haszlakiewicz2020-04-211-38/+26
| | | | eliminate the previous bogus calls to json_tokener_set_flags()
* Merge pull request #524 from dota17/addTestCase_obj_tokenEric Haszlakiewicz2020-04-156-3/+90
|\ | | | | Increase coverage
| * remove unsuitable casedota172020-04-151-17/+0
| |
| * clang-format two test_util_file.c and test_object_iterator.cdota172020-04-142-16/+17
| |
| * Increased the test coverage of json_util.c from 76% to 90.3%.chenguoping2020-04-142-0/+47
| |
| * Increased the test coverage of json_object_iterator.c from 0% to 100%chenguoping2020-04-144-1/+57
| |
* | clang-format test1.cdota172020-04-141-11/+12
| |
* | fix valgrind errorschenguoping2020-04-141-2/+9
| |
* | testcase for array_listchenguoping2020-04-147-0/+130
|/
* Be verbose on failing json_c_version test.Björn Esser2020-04-111-0/+8
|
* Merge pull request #576 from besser82/topic/besser82/increase_coverageEric Haszlakiewicz2020-04-111-0/+6
|\ | | | | Test coverage for json_c_version.
| * Test coverage for json_c_version.Björn Esser2020-04-111-0/+6
| |
* | Remove multiple trailing newlines at EOF.Björn Esser2020-04-111-1/+0
| |
* | Clean trailing white-space.Björn Esser2020-04-112-2/+2
|/
* Remove autoconf machinery, we're using cmake now. Update the release ↵Eric Haszlakiewicz2020-04-091-69/+0
| | | | checklist to account for that, plus fill in other tasks and clean it up a bit.
* clang-format the filesdota172020-04-0322-629/+610
|
* add the disabling formatting coments and adjust the partial code manulydota172020-04-032-28/+34
|
* add test casesdota172020-03-318-0/+87
|
* Merge pull request #547 from dota17/assert_testEric Haszlakiewicz2020-03-033-5/+6
|\ | | | | modify json-c default build type, and fix up the assert() errors in t…
| * update testcase and delete debug -O0 builddota172020-03-022-6/+2
| |
| * modify json-c default build type, and fix up the assert() errors in testcasedota172020-02-293-5/+10
| |
* | update json_object.c and testcase, delete json_object_uint_inc()dota172020-02-282-26/+0
| |
* | modify partial functions and testcase, in order to support automatic ↵dota172020-02-284-3/+84
| | | | | | | | conversion for int64/uint64
* | modify the json_object, replace c_int64/c_uint64 with struct{union{int64, ↵dota172020-02-272-14/+12
| | | | | | | | uint64},...}
* | add uint64 data to json-cdota172020-02-2512-26/+225
|/
* Issue #539: be sure to clean up at the end of test_set_value.Eric Haszlakiewicz2020-02-141-0/+1
|
* Issue #539: reset the serializer when json_object_set_double() is called and ↵Eric Haszlakiewicz2020-02-132-2/+9
| | | | the current serializer is the one that json_object_new_double_s() used.
* Merge pull request #531 from dota17/utf8testEric Haszlakiewicz2020-02-052-3/+68
|\ | | | | validate utf-8 string
| * update codedota172020-01-202-24/+30
| |
| * test utf8dota172020-01-102-1/+60
| |
* | add json_object_new_nulldota172020-01-207-1/+11
| |
* | Fix make checkPo-Chuan Hsieh2020-01-111-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../tests -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Werror -Wcast-qual -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -D_GNU_SOURCE -D_REENTRANT -MT test_parse.o -MD -MP -MF .deps/test_parse.Tpo -c -o test_parse.o test_parse.c test_parse.c:256:14: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] { "null123" + 4, 4, 3, json_tokener_success, 1 }, ~~~~~~~~~~^~~ test_parse.c:256:14: note: use array indexing to silence this warning { "null123" + 4, 4, 3, json_tokener_success, 1 }, ^ & [ ] test_parse.c:258:12: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] { "nullx" + 4, 2, 0, json_tokener_error_parse_unexpected, 1 }, ~~~~~~~~^~~ test_parse.c:258:12: note: use array indexing to silence this warning { "nullx" + 4, 2, 0, json_tokener_error_parse_unexpected, 1 }, ^ & [ ] test_parse.c:260:25: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] { "{\"a\":1}{\"b\":2}" + 7, ~~~~~~~~~~~~~~~~~~~~~^~~ test_parse.c:260:25: note: use array indexing to silence this warning { "{\"a\":1}{\"b\":2}" + 7, ^ & [ ] 3 errors generated. *** Error code 1 Stop.
* Merge pull request #526 from dota17/addTestCase_printbufEric Haszlakiewicz2020-01-032-0/+7
|\ | | | | Increased the test coverage of printbuf.c 82% to 92%.
| * Increased the test coverage of printbuf.c 82% to 92%.chenguoping2020-01-032-0/+7
| |
* | Merge pull request #525 from dota17/addPointerTestcaseEric Haszlakiewicz2020-01-032-0/+30
|\ \ | |/ |/| update pointer test case