mirror of
https://github.com/json-c/json-c.git
synced 2026-04-01 03:19:06 +08:00
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.
This commit is contained in:
@@ -6,6 +6,7 @@ LIBJSON_LA=$(top_builddir)/libjson.la
|
||||
check_PROGRAMS = test1 test1Formatted
|
||||
check_PROGRAMS += test2 test2Formatted
|
||||
check_PROGRAMS += test4
|
||||
check_PROGRAMS += testReplaceExisting
|
||||
check_PROGRAMS += test_parse_int64
|
||||
check_PROGRAMS += test_null
|
||||
check_PROGRAMS += test_cast
|
||||
@@ -25,6 +26,8 @@ test2Formatted_CPPFLAGS = -DTEST_FORMATTED
|
||||
|
||||
test4_LDADD = $(LIBJSON_LA)
|
||||
|
||||
testReplaceExisting_LDADD = $(LIBJSON_LA)
|
||||
|
||||
test_parse_int64_LDADD = $(LIBJSON_LA)
|
||||
|
||||
test_null_LDADD = $(LIBJSON_LA)
|
||||
@@ -33,7 +36,7 @@ test_cast_LDADD = $(LIBJSON_LA)
|
||||
|
||||
test_parse_LDADD = $(LIBJSON_LA)
|
||||
|
||||
TESTS = test1.test test2.test test4.test parse_int64.test test_null.test test_cast.test test_parse.test
|
||||
TESTS = test1.test test2.test test4.test testReplaceExisting.test parse_int64.test test_null.test test_cast.test test_parse.test
|
||||
|
||||
TESTS+= test_printbuf.test
|
||||
check_PROGRAMS+=test_printbuf
|
||||
|
||||
Reference in New Issue
Block a user