73c22de516
* 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.
39 lines
1.0 KiB
Makefile
39 lines
1.0 KiB
Makefile
EXTRA_DIST = run check-exports
|
|
|
|
check_PROGRAMS = \
|
|
test_array \
|
|
test_chaos \
|
|
test_copy \
|
|
test_dump \
|
|
test_dump_callback \
|
|
test_equal \
|
|
test_load \
|
|
test_loadb \
|
|
test_load_callback \
|
|
test_memory_funcs \
|
|
test_number \
|
|
test_object \
|
|
test_pack \
|
|
test_simple \
|
|
test_sprintf \
|
|
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
|
|
test_load_SOURCES = test_load.c util.h
|
|
test_loadb_SOURCES = test_loadb.c util.h
|
|
test_memory_funcs_SOURCES = test_memory_funcs.c util.h
|
|
test_number_SOURCES = test_number.c util.h
|
|
test_object_SOURCES = test_object.c util.h
|
|
test_pack_SOURCES = test_pack.c util.h
|
|
test_simple_SOURCES = test_simple.c util.h
|
|
test_sprintf_SOURCES = test_sprintf.c util.h
|
|
test_unpack_SOURCES = test_unpack.c util.h
|
|
|
|
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
|
|
LDFLAGS = -static # for speed and Valgrind
|
|
LDADD = $(top_builddir)/src/libjansson.la
|