[pygobject] Add a test to check for regular object reference count



commit b6737b91938d527872eff1d645a205cacf94e15d
Author: Steve Frécinaux <code istique net>
Date:   Wed Jan 19 14:52:41 2011 +0100

    Add a test to check for regular object reference count
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639949

 tests/test_gobject.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index f3cdf29..b445be9 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -11,10 +11,16 @@ class TestGObjectAPI(unittest.TestCase):
         obj = gobject.GObject()
         self.assertEquals(obj.__module__,
                           'gobject._gobject')
+
+
+class TestReferenceCounting(unittest.TestCase):
+    def testRegularObject(self):
+        obj = gobject.GObject()
         self.assertEquals(obj.__grefcount__, 1)
 
+        obj = gobject.new(gobject.GObject)
+        self.assertEquals(obj.__grefcount__, 1)
 
-class TestFloating(unittest.TestCase):
     def testFloatingWithSinkFunc(self):
         obj = testhelper.FloatingWithSinkFunc()
         self.assertEquals(obj.__grefcount__, 1)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]