PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 188 - Rounding error on 32 bit systems in qtgui_qcolor testGetHsl()
: Rounding error on 32 bit systems in qtgui_qcolor testGetHsl()
Status: CLOSED WORKSFORME
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-03-19 16:30 EET by Bruno Araujo
Modified: 2010-08-13 11:23 EEST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Araujo 2010-03-19 16:30:39 EET
73: ======================================================================
73: FAIL: testGetHsl (__main__.QColorGetTest)
73: ----------------------------------------------------------------------
73: Traceback (most recent call last):
73:   File "qcolor_test.py", line 23, in testGetHsl
73:     self.assertEqual(self.color.getHsl(), hsla)
73: AssertionError: (210, 127, 40, 80) != (210.0, 128.0, 40.0, 80)
73: 
73: ----------------------------------------------------------------------

The test that causes this is below:

def testGetHsl(self):
        hls = colorsys.rgb_to_hls(20.0/255, 40.0/255, 60.0/255)
        hsla = hls[0]*360.0, hls[2]*256, hls[1]*255, self.color.alpha()
        self.assertEqual(self.color.getHsl(), hsla)

This error does not occur on 64 bit systems, probably because of the larger
precision.
Comment 1 renato filho 2010-05-21 09:35:53 EEST
works fine on Fedora 12 (32 bits)