summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGustavo J. A. M. Carneiro <gjc@src.gnome.org>2005-07-31 15:16:39 +0000
committerGustavo J. A. M. Carneiro <gjc@src.gnome.org>2005-07-31 15:16:39 +0000
commit6863d33f6592e42d9eed360ca7ec52493ee2dbf3 (patch)
treec20934e4d8622f4046305df58ffe3f3cc1aaa31d /tests
parentf49a7c9a336f038540025aa869161948111e347c (diff)
downloadpygtk-6863d33f6592e42d9eed360ca7ec52493ee2dbf3.tar.gz
Fix reference count of gtk.Window's from gobject.new
Diffstat (limited to 'tests')
-rw-r--r--tests/test_subtype.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_subtype.py b/tests/test_subtype.py
index a48452ce..630344c7 100644
--- a/tests/test_subtype.py
+++ b/tests/test_subtype.py
@@ -52,3 +52,21 @@ class TestSubType(unittest.TestCase):
continue
subname = name + "PyGtkTestSubclass"
sub = type(subname, (cls,), {'__gtype_name__': subname })
+
+ def testGtkWindowObjNewRefcount(self):
+ foo = gobject.new(gtk.Window)
+ self.assertEqual(foo.__grefcount__, 2)
+
+ def testGtkWindowFactoryRefcount(self):
+ foo = gtk.Window()
+ self.assertEqual(foo.__grefcount__, 2)
+
+ def testPyWindowObjNewRefcount(self):
+ PyWindow = type('PyWindow', (gtk.Window,), dict(__gtype_name__='PyWindow1'))
+ foo = gobject.new(PyWindow)
+ self.assertEqual(foo.__grefcount__, 2)
+
+ def testGtkWindowFactoryRefcount(self):
+ PyWindow = type('PyWindow', (gtk.Window,), dict(__gtype_name__='PyWindow2'))
+ foo = PyWindow()
+ self.assertEqual(foo.__grefcount__, 2)