cJSON/tests
PeterAlfredLee c95332c58c feat: add int64 support
This commit adds int64 support for cjson. To enable int64, you need to
define the macro ENABLE_INT64. To make it more clear, you need to build
cjson like this:

mkdir build
cd build
cmake -DENABLE_INT64=ON ..
make

This implementation changed the type of valueint in struct cJSON: from
int to long long(int64), and added a new flag cJSON_IsInt64.
For a int64 cJSON item, the value of item->type would be cJSON_Number |
cJSON_IsInt64.

The existing functions parse_number and print_number can handle int64
now.

Considering I have added a new type cJSON_IsInt64, some new functions
have been added:
CJSON_PUBLIC(long long *) cJSON_GetInt64NumberValue(cJSON * const item)
CJSON_PUBLIC(cJSON_bool) cJSON_IsInt64Number(const cJSON * const item)
CJSON_PUBLIC(cJSON *) cJSON_CreateInt64Number(long long integer)
CJSON_PUBLIC(cJSON*) cJSON_AddInt64NumberToObject(cJSON * const object, const char * const name, const long long integer)
CJSON_PUBLIC(long long) cJSON_SetInt64NumberValue(cJSON * const object, const long long integer)

And some existing functions are also adjusted for int64, including
parse_number, cJSON_SetNumberHelper, print_number, cJSON_CreateNumber,
cJSON_Compare and compare_json(in cJSON_Utils).

Besides the code changes, we have also added some testcases for int64.
These tests will run if ENABLE_INT64 is turned on.
2022-05-19 16:01:30 +08:00
..
inputs Remove trailing space 2017-11-04 21:19:15 +08:00
json-patch-tests Update json-patch-tests 2018-10-11 00:30:43 +02:00
unity eliminate warning when compiling cJSON 2019-08-12 17:06:29 +08:00
cjson_add.c feat: add int64 support 2022-05-19 16:01:30 +08:00
CMakeLists.txt feat: add int64 support 2022-05-19 16:01:30 +08:00
common.h Fix tests when building as static library 2017-11-28 16:44:24 +01:00
compare_tests.c feat: add int64 support 2022-05-19 16:01:30 +08:00
json_patch_tests.c Typos found by codespell (#607) 2021-08-25 15:01:12 +08:00
minify_tests.c Fix infinite loop in cJSON_Minify 2019-05-16 20:01:02 +02:00
misc_int64_tests.c feat: add int64 support 2022-05-19 16:01:30 +08:00
misc_tests.c feat: add int64 support 2022-05-19 16:01:30 +08:00
misc_utils_tests.c misc_utils_tests: call all utils function with NULL pointers 2017-06-28 16:01:20 +02:00
old_utils_tests.c fix encode_string_as_pointer 2020-03-18 16:04:58 +08:00
parse_array.c array's item should be in the list 2020-05-06 17:18:42 +08:00
parse_examples.c Added cJSON_ParseWithLength (#358) 2020-04-02 19:24:36 +08:00
parse_hex4.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
parse_number.c feat: add int64 support 2022-05-19 16:01:30 +08:00
parse_object.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
parse_string.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
parse_value.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
parse_with_opts.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
print_array.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
print_number.c feat: add int64 support 2022-05-19 16:01:30 +08:00
print_object.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
print_string.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
print_value.c Support default __stdcall calling convention on tests as well 2018-09-12 15:32:30 -05:00
readme_examples.c docs: fix simple typo, transfering -> transferring (#527) 2020-11-16 08:57:02 +08:00
unity_setup.c Add newline to end of unity_setup.c 2018-09-17 09:10:20 -05:00