]> granicus.if.org Git - json-c/commitdiff
Fix broken key-order test in test_compare.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 10 Oct 2016 04:13:39 +0000 (00:13 -0400)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 10 Oct 2016 04:13:39 +0000 (00:13 -0400)
tests/test_compare.c

index 30c6e50b367ea0f7562e03e2dbcc11856c0d8416..c7e44f6ea6edd748e2578632188e14295fc17b6e 100644 (file)
@@ -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))