summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2007-08-29 20:14:37 +0000
committerJohan Dahlin <johan@src.gnome.org>2007-08-29 20:14:37 +0000
commitfef627a81410ee832b832e4fe5f341d815fa099b (patch)
tree7ff9767917013619dfe55e0c36f5cb92668b9a9d
parentfb5f535dd9ade14ea0cb129fb548a3afd4dcfb96 (diff)
downloadpygtk-fef627a81410ee832b832e4fe5f341d815fa099b.tar.gz
Fix bug in hash() implementation and test it properly
svn path=/trunk/; revision=2898
-rw-r--r--pango.override4
-rw-r--r--tests/test_pango.py21
2 files changed, 12 insertions, 13 deletions
diff --git a/pango.override b/pango.override
index 80a8e114..81d72d3a 100644
--- a/pango.override
+++ b/pango.override
@@ -2037,10 +2037,10 @@ _wrap_pango_font_description_tp_str(PyObject *self)
}
%%
override-slot PangoFontDescription.tp_hash
-static PyObject *
+static int
_wrap_pango_font_description_tp_hash(PyObject *self)
{
- return _wrap_pango_font_description_hash(self);
+ return pango_font_description_hash(pyg_boxed_get(self, PangoFontDescription));
}
%%
override-slot PangoFontDescription.tp_compare
diff --git a/tests/test_pango.py b/tests/test_pango.py
index a0aeb82a..c7459c2a 100644
--- a/tests/test_pango.py
+++ b/tests/test_pango.py
@@ -23,18 +23,17 @@ class TestLanguage(unittest.TestCase):
class TestFontDescription(unittest.TestCase):
def testStr(self):
- font = pango.FontDescription('monospace 10')
- self.assertEqual(str(font), 'monospace 10')
+ fontdescr = pango.FontDescription('monospace 10')
+ self.assertEqual(str(fontdescr), 'monospace 10')
def testHash(self):
- font = pango.FontDescription('monospace 10')
- font2 = pango.FontDescription('monospace 10')
- self.assertNotEqual(hash(font), hash(font2))
- # FIXME: How to test this properly?
+ fontdescr = pango.FontDescription('monospace 10')
+ fontdescr2 = pango.FontDescription('monospace 10')
+ self.assertEqual(hash(fontdescr), hash(fontdescr2))
def testEquals(self):
- font = pango.FontDescription('monospace 10')
- font2 = pango.FontDescription('monospace 10')
- font3 = pango.FontDescription('monospace 12')
- self.assertEqual(font, font2)
- self.assertNotEqual(font, font3)
+ fontdescr = pango.FontDescription('monospace 10')
+ fontdescr2 = pango.FontDescription('monospace 10')
+ fontdescr3 = pango.FontDescription('monospace 12')
+ self.assertEqual(fontdescr, fontdescr2)
+ self.assertNotEqual(fontdescr, fontdescr3)