GNOME Bugzilla – Bug 787581
tests: Add tests for g_slist_copy() and g_slist_copy_deep()
Last modified: 2017-09-13 12:37:42 UTC
Fairly trivial patch.
Created attachment 359613 [details] [review] tests: Add tests for g_slist_copy() and g_slist_copy_deep() This gives us 100% coverage of GSList (when running `make lcov`). Signed-off-by: Philip Withnall <withnall@endlessm.com>
Review of attachment 359613 [details] [review]: Looks good. ::: glib/tests/slist.c @@ +336,3 @@ + /* Copy and test a many-element list. */ + for (i = 0; i < 10; i++) + slist = g_slist_append (slist, &nums[i]); GUINT_TO_POINTER()?
(In reply to Bastien Nocera from comment #2) > Review of attachment 359613 [details] [review] [review]: > > Looks good. > > ::: glib/tests/slist.c > @@ +336,3 @@ > + /* Copy and test a many-element list. */ > + for (i = 0; i < 10; i++) > + slist = g_slist_append (slist, &nums[i]); > > GUINT_TO_POINTER()? Thanks for the review! Using GUINT_TO_POINTER() here doesn’t really matter — we still end up with some unique pointers for comparison. I went with this approach since that’s what the rest of the test suite uses. I think consistency trumps having readable integers.
Attachment 359613 [details] pushed as a2cf480 - tests: Add tests for g_slist_copy() and g_slist_copy_deep()