Commit Graph

27 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
e00a07b885 Clean up *.vg.out files too to "make distcheck" works. 2017-11-30 18:17:04 -05:00
Alexandru Ardelean
1eab22f0da tests: add test_deep_copy test
Seems to perform better than outputting to string
and re-parsing it.

BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 20 seconds
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 7 seconds

It should make a difference on embedded systems.
The test was performed on a i5 desktop CPU [~3.5 years of age].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-11-27 16:17:48 +02:00
Juraj Vijtiuk
1110e84cce Add json_object_add_int functions 2017-09-14 09:36:12 -04:00
Alexandru Ardelean
fb72160caf build: make strerror() override-able
If we want to override `strerror()` in libjson-c
to make tests consistent across platforms, we
need to do it build-wide as configure/build
option.

Apple linkers make it really hard to override functions
at link-time, and this seems to be locked down on travis-ci.org
[ for security reasons I assume ].
While I got it to work locally, it did not work
when running on travis.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:24 +03:00
Jan Gerhards
61db4cfac5 testbench: add test for floating point representation 2016-11-27 11:50:48 +01:00
Alexandru Ardelean
ee7fc26de1 tests: add test_json_pointer test
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-04 09:59:43 +02:00
Eric Haszlakiewicz
ecdc14f535 Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects. 2016-10-29 15:01:20 -04:00
Stoian Ivanov
6a0667567d some simple tests 2016-10-06 23:16:29 +03:00
Eric Haszlakiewicz
1071385896 Issue #113: add "new" files to appropriate variables in Makefile, and note the need to run "make distcheck" as part of the release process.
Fix issues with the test script so it works under distcheck too.
2016-06-27 04:15:30 +00:00
Eric Haszlakiewicz
29ef73f21d Issue #189: Eliminate use of MC_ERROR from json_util.c, and add a json_util_get_last_err() function to retrieve the error for those callers that care about it.
Add tests and descriptions for the functions in json_util.c
2016-06-26 02:20:33 +00:00
Matthias Schiffer
c2b004ba0e Make default double serializer ignore userdata again
The user might want to use the userdata for something different, so the
serializer should ignore it by default.

Explicitly setting the serializer to json_object_double_to_json_string will
still make it interpret the userdata as a format string.
2016-05-29 11:24:55 +02:00
Helmut Schaa
dec5fcd50b Add some basic tests for verifying json_object_equal behavior
Do some basic checks on ints, doubles, strings, arrays and "complex" objects.
2016-01-13 15:56:39 +01:00
Eric Haszlakiewicz
80c1f69b9e Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, such as -Wall, to ensure the compile supports. 2015-10-23 02:16:40 +00:00
Eric Haszlakiewicz
936d036ea3 Simplify the tests Makefile to avoid repeating the name of each test. 2014-03-22 21:40:37 -04:00
Eric Haszlakiewicz
e2bbb5664c Rename the "test_case" test to "test_charcase" to make it slightly less confusing. 2014-03-22 21:15:41 -04:00
Andrea Faulds
bda0540cb9 Only allow lowercase literals in STRICT mode 2013-11-14 21:13:32 +00:00
Eric Haszlakiewicz
94aeed2ecd Include the test_locale test in the tests that run. 2013-02-26 21:14:07 -06:00
Eric Haszlakiewicz
5b36a432c8 Merge branch 'remicollet-issue-float'
Conflicts:
	json_util.c
2013-02-26 21:09:10 -06:00
Alexander Klauer
b1d61d10e1 Library is now called libjson-c 2012-12-18 18:46:24 +01:00
Remi Collet
a01b659ace move locale change to be global for perf 2012-12-13 09:47:33 +01:00
Eric Haszlakiewicz
38f421a2e7 Add a json_set_serializer() function to allow the string output of a json_object to be customized. 2012-09-02 15:21:56 -05:00
Eric Haszlakiewicz
6988f53fcb Rewrite json_object_object_add to replace just the value if the key already exists so keys remain valid.
This is particularly useful when replacing values in a loop, since it allows
 the key used by json_object_object_foreach to continue to be used.
2012-07-24 23:27:41 -05: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
e5c1e87f05 Add a test for the printbuf functions. 2012-04-22 14:13:01 -05:00
Eric Haszlakiewicz
b80772a0f5 Use a different variable when referring to the json.la file, since the original lib_LTLIBRARIES means something special to automake. 2012-04-22 10:48:30 -05:00
Eric Haszlakiewicz
c1b8891a13 Move the rest of the tests into the tests subdirectory. 2012-04-22 10:33:41 -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