From 7e12b9f47cc3222c5e1abdf1cb391fc07ea2043b Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Mon, 10 Oct 2016 00:13:39 -0400 Subject: [PATCH] Fix broken key-order test in test_compare. --- tests/test_compare.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_compare.c b/tests/test_compare.c index 30c6e50..c7e44f6 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))