diff options
author | Corey Farrell <git@cfware.com> | 2018-02-13 04:35:37 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2018-02-15 10:12:31 -0500 |
commit | 73c22de51672cb40fdc29c95331923d4dcebb6fa (patch) | |
tree | cc7dae71f9f2fff1c0066adf12b3def6337c2e56 /test/suites/api/Makefile.am | |
parent | 6dddf687d84306ea5d4ff9b13a28dc22282c77e6 (diff) | |
download | jansson-73c22de51672cb40fdc29c95331923d4dcebb6fa.zip jansson-73c22de51672cb40fdc29c95331923d4dcebb6fa.tar.gz jansson-73c22de51672cb40fdc29c95331923d4dcebb6fa.tar.bz2 |
Improve test coverage.
* Test equality of different length strings.
* Add tab to json_pack whitespace test.
* Test json_sprintf with empty result and invalid UTF.
* Test json_get_alloc_funcs with NULL arguments.
* Test invalid arguments.
* Add test_chaos to test allocation failure code paths.
* Remove redundant json_is_string checks from json_string_equal and
json_string_copy. Both functions are static and can only be called
with a json string.
Fixes to issues found by test_chaos:
* Fix crash on OOM in pack_unpack.c:read_string().
* Unconditionally free string in string_create upon allocation failure.
Update load.c:parse_value() to reflect this. This resolves a leak on
allocation failure for pack_unpack.c:pack_string() and
value.c:json_sprintf().
Although not visible from CodeCoverage these changes significantly
increase branch coverage. Especially in src/value.c where we previously
covered 67.4% of branches and now cover 96.3% of branches.
Diffstat (limited to 'test/suites/api/Makefile.am')
-rw-r--r-- | test/suites/api/Makefile.am | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/suites/api/Makefile.am b/test/suites/api/Makefile.am index a1bc4d3..63548ac 100644 --- a/test/suites/api/Makefile.am +++ b/test/suites/api/Makefile.am @@ -2,6 +2,7 @@ EXTRA_DIST = run check-exports check_PROGRAMS = \ test_array \ + test_chaos \ test_copy \ test_dump \ test_dump_callback \ @@ -18,6 +19,7 @@ check_PROGRAMS = \ test_unpack test_array_SOURCES = test_array.c util.h +test_chaos_SOURCES = test_chaos.c util.h test_copy_SOURCES = test_copy.c util.h test_dump_SOURCES = test_dump.c util.h test_dump_callback_SOURCES = test_dump_callback.c util.h |