Skip to content

Commit

Permalink
Fix broken key-order test in test_compare.
Browse files Browse the repository at this point in the history
  • Loading branch information
hawicz committed Oct 10, 2016
1 parent 80150a1 commit 7e12b9f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7e12b9f

Please sign in to comment.