Commit Graph

10 Commits

Author SHA1 Message Date
Björn Esser
3008401b2a test_deep_copy: Fix assertion value. 2020-05-18 17:06:37 +02:00
dota17
8b162c4b89 clang-format the files 2020-04-03 11:39:30 +08:00
dota17
3822177473 add test cases 2020-03-31 19:12:45 +08:00
dota17
e56ab0146f update testcase and delete debug -O0 build 2020-03-02 20:19:35 +08:00
dota17
2d44f865c3 modify json-c default build type, and fix up the assert() errors in testcase 2020-02-29 15:32:42 +08:00
chenguoping
1446572997 add testcases of object and token 2019-12-27 15:07:00 +08:00
Pierce Lopez
634900d270 tests: appease -Wwrite-strings 2019-06-09 12:17:06 -04:00
Eric Haszlakiewicz
5dae561d33 In json_object_deep_copy(), copy over _userdata, at least for json_type_string's with the default serializer set, and provide a way for people using custom serializers to provide a custom shallow_copy method. 2017-11-29 23:35:38 -05:00
Eric Haszlakiewicz
96efeadd6e Always build the json_object_deep_copy() code, but conditionalize running it on a --benchmark command line option. 2017-11-29 17:58:57 -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