From: Eric Haszlakiewicz Date: Mon, 10 Oct 2016 04:13:39 +0000 (-0400) Subject: Fix broken key-order test in test_compare. X-Git-Tag: json-c-0.13-20171207~119 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e12b9f47cc3222c5e1abdf1cb391fc07ea2043b;p=thirdparty%2Fjson-c.git Fix broken key-order test in test_compare. --- diff --git a/tests/test_compare.c b/tests/test_compare.c index 30c6e50b..c7e44f6e 100644 --- a/tests/test_compare.c +++ b/tests/test_compare.c @@ -121,9 +121,15 @@ int main() json_object_object_add(obj1, "test1", json_object_new_int(123)); json_object_object_add(obj1, "test2", json_object_new_int(321)); - - json_object_object_add(obj2, "test2", json_object_new_int(123)); - json_object_object_add(obj2, "test1", json_object_new_int(321)); + json_object_object_add(obj1, "test3", json_object_new_int(320)); + json_object_object_add(obj1, "test4", json_object_new_int(319)); + json_object_object_add(obj1, "test5", json_object_new_int(318)); + + json_object_object_add(obj2, "test5", json_object_new_int(318)); + json_object_object_add(obj2, "test4", json_object_new_int(319)); + json_object_object_add(obj2, "test3", json_object_new_int(320)); + json_object_object_add(obj2, "test2", json_object_new_int(321)); + json_object_object_add(obj2, "test1", json_object_new_int(123)); /* key-order is different between obj1 and obj2, should still be equal */ if (json_object_equal(obj1, obj2))