On 10/10/22 17:13, Dumitru Ceara wrote: > On 7/1/22 13:11, Ilya Maximets wrote: >> When reference counting for json objects was introduced the >> old json_clone() function became json_deep_clone(), but it >> still calls shallow json_clone() while cloning objects and >> arrays not really producing a deep copy. >> >> Fixing that by making other functions to perform a deep copy >> as well. There are no users for this functionality inside >> OVS right now, but OVS exports this functionality externally. >> >> 'ovstest test-json' extended to test both versions of a clone >> on provided inputs. >> >> Fixes: 9854d473adea ("json: Use reference counting in JSON objects") >> Signed-off-by: Ilya Maximets <i.maxim...@ovn.org> >> --- >> lib/json.c | 16 +++--- >> tests/test-json.c | 125 ++++++++++++++++++++++++++++++++++++++++++++-- >> 2 files changed, 129 insertions(+), 12 deletions(-) >>
... >> diff --git a/tests/test-json.c b/tests/test-json.c >> index a2f4332e7..225badf70 100644 >> --- a/tests/test-json.c >> +++ b/tests/test-json.c >> @@ -34,8 +34,124 @@ static int pretty = 0; >> * instead of exactly one object or array. */ >> static int multiple = 0; >> >> + > > Nit: newline not really needed. Sure. > >> +static void test_json_equal(const struct json *a, const struct json *b, >> + bool allow_the_same); >> + > > Nit: not needed here either I think. I kept this one as it is the only empty line between the prototype and the next function. > > Anyway, these can be fixed at apply time if you agree, the fix itself > makes sense: > Acked-by: Dumitru Ceara <dce...@redhat.com> Thanks! Applied and backported down to 2.17. Best regards, Ilya Maximets. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev