Commit Graph

856 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
4bf7ffa984 Issue #539: be sure to clean up at the end of test_set_value. 2020-02-14 03:25:46 +00:00
Eric Haszlakiewicz
ae13ca524a Issue #539: reset the serializer when json_object_set_double() is called and the current serializer is the one that json_object_new_double_s() used. 2020-02-13 03:11:10 +00:00
Eric Haszlakiewicz
0ffdbb2395 Merge pull request #531 from dota17/utf8test
validate utf-8 string
2020-02-05 21:56:06 -05:00
Eric Haszlakiewicz
1934eddf29 Merge pull request #536 from dota17/new_null
add json_object_new_null()
2020-01-21 23:23:53 -05:00
dota17
7ad72b81c5 update comment 2020-01-22 09:56:52 +08:00
dota17
010f33d460 add json_object_new_null 2020-01-20 16:46:46 +08:00
dota17
787a8b3f1c update code 2020-01-20 10:41:24 +08:00
Eric Haszlakiewicz
360d28b961 Merge pull request #533 from sunpoet/master
Fix "make check"
2020-01-12 22:42:02 -05:00
Po-Chuan Hsieh
bb5971ba2a Fix make check
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.
2020-01-11 07:20:44 +00:00
dota17
eca74dcccf test utf8 2020-01-10 18:33:14 +08:00
Eric Haszlakiewicz
e651e96a5b Merge pull request #526 from dota17/addTestCase_printbuf
Increased the test coverage of printbuf.c 82% to 92%.
2020-01-03 08:32:53 -05:00
Eric Haszlakiewicz
a255510cca Merge pull request #525 from dota17/addPointerTestcase
update pointer test case
2020-01-03 08:31:41 -05:00
chenguoping
8c0cb0bd28 Increased the test coverage of printbuf.c 82% to 92%. 2020-01-03 14:34:35 +08:00
Eric Haszlakiewicz
0421772bbc Merge pull request #523 from dota17/updatetestcase
update tsetcase for tokener_c
2020-01-02 22:22:57 -05:00
Eric Haszlakiewicz
4bfed6eb2f Merge pull request #522 from dota17/addVisitTestcase
update json_visit testcase
2020-01-02 22:22:09 -05:00
dota17
5fe4448541 update tsetcase for tokener_c 2020-01-02 19:19:12 +08:00
dota17
a5089f5a79 update json_visit testcase 2020-01-02 16:41:37 +08:00
dota17
48ae9e8874 update pointer test case 2020-01-02 10:49:29 +08:00
Eric Haszlakiewicz
ee34939e74 Merge pull request #519 from dota17/addTestCase_obj_token
Add test case obj token
2019-12-29 16:02:04 -05:00
chenguoping
424b315ce0 pointer types discards qualifiers 2019-12-27 15:39:31 +08:00
chenguoping
1446572997 add testcases of object and token 2019-12-27 15:07:00 +08:00
Eric Haszlakiewicz
d6b968dff7 Merge pull request #512 from JaapKeuter/cmake_test
Properly append to CMAKE_C_FLAGS string
2019-12-12 22:30:15 -05:00
Jaap Keuter
78d8e5c3d5 Properly append to CMAKE_C_FLAGS string
Contrary to other CMAKE variables the CMAKE_C_FLAGS variable is the
composed string of flags for the C compiler. It is therefore not a list
to append to. Current implementation results in these incorrect CFLAGS,
e.g., "-O2 -g -fblahblah;-UNDEBUG". Extending the CFLAGS this way
results in the proper CFLAGS, e.g., "-O2 -g -fblahblah -UNDEBUG".
2019-12-12 21:28:03 +01:00
Eric Haszlakiewicz
6c55f65d07 Set cmake policy CMP0075, to have check_include_file use the value of CMAKE_REQUIRED_LIBRARIES (currently, adds -lm). See issue #510. 2019-12-06 00:15:14 -05:00
Eric Haszlakiewicz
0819a55ffb Undefine NDEBUG for tests - cmake version. See issue #501. 2019-12-05 23:18:59 -05:00
Eric Haszlakiewicz
37b4da6b92 Merge pull request #501 from andy5995/iss_406-2
undefine NDEBUG for tests
2019-12-05 23:18:46 -05:00
Eric Haszlakiewicz
581b94b3bd Add a shim script to ease shift from autoconf to cmake. 2019-12-01 23:42:40 -05:00
Eric Haszlakiewicz
11a638048d Add a few missing features to the cmake setup that are present in configure.ac:
Include all compiler warnings, and provide DISABLE_WERROR to make them not be errors.
 Define _REENTRANT, if setting it works.
 Set -Bsymbolic-functions, and provide DISABLE_BSYMBOLIC to turn that off.
 Implement the check for HAS_GNU_WARNING_LONG
2019-11-26 23:02:15 -05:00
Eric Haszlakiewicz
a92e6d2c28 Set the soversion in the cmake built library, and arrange for the file name to be generated appropriately too. 2019-11-25 23:26:48 -05:00
Eric Haszlakiewicz
41f434e89f Fix test_util_file for VS2013 too, but skip all the tests for anything older than that because the limitations are too inconvenient. 2019-11-23 23:55:04 -05:00
Eric Haszlakiewicz
b99be9cf4e Fix up the test_util_file test for builds on Windows VS2015. 2019-11-23 23:14:24 -05:00
Eric Haszlakiewicz
7f30afc6e5 Fix some Windows compile issues, add JSON_EXPORT's, fix bogus character escapes, define __func__ and omit unistd.h if needed. 2019-11-23 20:31:14 -05:00
Eric Haszlakiewicz
f19abcf981 Get the cmake build a bit closer to the autoconf one: include json_visit.h, and fix the version stamped in json-c.pc. 2019-11-23 15:34:23 -05:00
Eric Haszlakiewicz
bdaff94e9a Build and run the tests as part of the cmake build. 2019-11-23 15:15:48 -05:00
Eric Haszlakiewicz
25aedddcdf Fix memory leaks in test_double_serializer, and make sure all tests return 0 at the end of main(). 2019-11-23 12:05:28 -05:00
Eric Haszlakiewicz
3d3b014971 Add a quick way (JSONC_TEST_TRACE=1) to turn on shell tracing in tests. 2019-11-23 12:03:27 -05:00
Eric Haszlakiewicz
b1ad748842 Extend test_double_serializer to check NaN and Infinity handling. 2019-11-22 22:56:33 -05:00
Eric Haszlakiewicz
af8dd4a307 Define vars earlier to fix old Windows builds. 2019-11-10 20:35:30 -05:00
Eric Haszlakiewicz
baed9983b3 Add a json_object_from_fd_ex() function, to allow the max nesting depth to be specified. 2019-11-10 00:14:44 -05:00
Eric Haszlakiewicz
ac26ea9c5b Add a test for serializing the double value -1.0. 2019-11-10 00:13:00 -05:00
Eric Haszlakiewicz
ddd049045d Merge pull request #505 from grdowns/vcpkg-instructions
Add vcpkg installation instructions
2019-09-26 22:23:52 -04:00
grdowns
7ef51239a9 Update dependencies 2019-09-26 17:11:49 -07:00
grdowns
760c1e284c Add vcpkg installation instructions 2019-09-26 17:09:39 -07:00
Eric Haszlakiewicz
eae040a84a Issue #488: use JSON_EXPORT on functions so they are properly exported on Windows. 2019-09-08 22:42:36 -04:00
Eric Haszlakiewicz
374ffe87c6 Issue #463: fix newlocale() call to use LC_NUMERIC_MASK instead of LC_NUMERIC, and remove incorrect comment.
The second call to newlocale() with LC_TIME accidentally made things
 work because LC_TIME == LC_NUMERIC_MASK on some platforms.
2019-09-08 22:27:30 -04:00
Eric Haszlakiewicz
05b41b159e Add a json_tokener_get_parse_end() function to replace direct access of tok->char_offset. 2019-09-08 21:35:37 -04:00
Eric Haszlakiewicz
087534c030 Minor cleanup of includes in a couple of tests. 2019-09-08 21:34:13 -04:00
Eric Haszlakiewicz
d0b87ee87b Add an explicit cast to double to squash a -Wimplicit-int-float-conversion warning.
Though we will no longer be comparing exactly against INT64_MAX, this is ok
because any value of that magnitude stored in a double will *also* have been
rounded up, so the comparison will work appropriately.
2019-08-12 00:30:45 +00:00
andy5995
8799623806 undefine NDEBUG for tests
(closes #406)
2019-07-30 14:34:51 -05:00
Eric Haszlakiewicz
a91aa5e35d Merge pull request #499 from andy5995/travis_valgrind
.travis.yml:test on more recent clang and gcc versions
2019-07-27 09:29:57 -04:00