Commit Graph

4 Commits

Author SHA1 Message Date
dota17
3822177473 add test cases 2020-03-31 19:12:45 +08:00
chenguoping
1446572997 add testcases of object and token 2019-12-27 15:07:00 +08: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
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