After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639955 - [PATCH] Fix ReadOnlyCollectionTests.test_immutable_iterator
[PATCH] Fix ReadOnlyCollectionTests.test_immutable_iterator
Status: RESOLVED FIXED
Product: libgee
Classification: Platform
Component: general
0.6.x
Other Linux
: Normal normal
: ---
Assigned To: libgee-maint
libgee-maint
Depends on:
Blocks:
 
 
Reported: 2011-01-19 15:10 UTC by Michael Terry
Modified: 2011-01-20 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (922 bytes, patch)
2011-01-19 15:10 UTC, Michael Terry
none Details | Review

Description Michael Terry 2011-01-19 15:10:14 UTC
Created attachment 178732 [details] [review]
Proposed patch

In Ubuntu, we were noticing that libgee started failing rebuild tests recently (we're not sure when it first started).  This is without an update on libgee's part.  Rather something changed in one of its dependencies.

The problem was that ReadOnlyCollectionTests.test_immutable_iterator was failing with:

ERROR:testreadonlycollection.c:293:read_only_collection_tests_test_immutable_iterator: assertion failed: (g_strcmp0 (_tmp9_, "one") == 0)

Looking into it, it seems that for HashMultiSet<string>, the order of the two elements was being iterated differently than the order they were added.  Which seems to be a fine and proper thing for a HashMultiSet to do, but the test isn't expecting it.

So I have a patch to make the test a little more forgiving of whatever the underlying implementation wants to do.

But I haven't yet tracked down *why* it changed.  Do you all have any ideas?  glib's g_string_hash didn't change.  I compiled with an older version of valac (0.11.2) so I don't believe vala changed anything on us.
Comment 1 Maciej (Matthew) Piechotka 2011-01-19 15:30:51 UTC
(In reply to comment #0)
> Created an attachment (id=178732) [details] [review]
> Proposed patch
> 
> In Ubuntu, we were noticing that libgee started failing rebuild tests recently
> (we're not sure when it first started).  This is without an update on libgee's
> part.  Rather something changed in one of its dependencies.
> 
> The problem was that ReadOnlyCollectionTests.test_immutable_iterator was
> failing with:
> 
> ERROR:testreadonlycollection.c:293:read_only_collection_tests_test_immutable_iterator:
> assertion failed: (g_strcmp0 (_tmp9_, "one") == 0)
> 
> Looking into it, it seems that for HashMultiSet<string>, the order of the two
> elements was being iterated differently than the order they were added.  Which
> seems to be a fine and proper thing for a HashMultiSet to do, but the test
> isn't expecting it.
> 
> So I have a patch to make the test a little more forgiving of whatever the
> underlying implementation wants to do.
> 
> But I haven't yet tracked down *why* it changed.  Do you all have any ideas? 
> glib's g_string_hash didn't change.  I compiled with an older version of valac
> (0.11.2) so I don't believe vala changed anything on us.

No. I have no idea but the code is wrong anyway. I've fixed this in master (https://bugzilla.gnome.org/show_bug.cgi?id=639955) but I believed it is vala change so I haven't backported it.
Comment 2 Maciej (Matthew) Piechotka 2011-01-20 11:02:15 UTC
I'm sorry but I've decided to backport a patch to keep both branches in some sort of sync.

commit b004e916eff71621ce4f635f8ef683253eb9721e
Author: Maciej Piechotka <uzytkownik2@gmail.com>
Date:   Mon Dec 27 15:37:43 2010 +0100

    Remove depending on order of iteration in read-only collections' test