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 690837 - test for GBytes.compare must match definition
test for GBytes.compare must match definition
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-28 21:35 UTC by Dan Horák
Modified: 2012-12-30 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix test (1.23 KB, patch)
2012-12-28 21:35 UTC, Dan Horák
none Details | Review

Description Dan Horák 2012-12-28 21:35:09 UTC
Created attachment 232352 [details] [review]
fix test

memcmp() as underlaying function for the GBytes.compare method can return other values than the "expected" -1, 0 and 1. The result is defined as equal to, less than or greater than zero. The result for the compare() method in glib's GBytes is defined in the same way.

a test failure from s390/s390x architecture in Fedora 19

FAIL: test_compare (test_gi.TestGBytes)
----------------------------------------------------------------------
Traceback (most recent call last):
  • File "/builddir/build/BUILD/pygobject-3.7.3/tests/test_gi.py", line 1046 in test_compare
    self.assertEqual(-1, b.compare(a1))
AssertionError: -1 != -2

Comment 1 Martin Pitt 2012-12-30 10:35:33 UTC
Thank you! I modified the patch to use the richer unittest comparison functions:

http://git.gnome.org/browse/pygobject/commit/?id=692c80e11a05e2fb0515580acb22fd6fe65cede1