aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-12 19:26:27 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:51:45 -0300
commit3ac4080bfe3052b8ee805a0a983a68cf142241b2 (patch)
treef909f4710cd33efd39613413a33c0f62746eb1e1
parent7e667036d58a0549dd08a152149e1ba1f410bfb7 (diff)
Create a new parent test.
Check if the parent does not increase the reference if you set the parent twice.
-rw-r--r--tests/QtCore/qobject_parent_test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/QtCore/qobject_parent_test.py b/tests/QtCore/qobject_parent_test.py
index eb8cae2d8..df8121666 100644
--- a/tests/QtCore/qobject_parent_test.py
+++ b/tests/QtCore/qobject_parent_test.py
@@ -25,6 +25,13 @@ class ParentRefCountCase(unittest.TestCase):
self.child.setParent(self.parent)
self.assertEqual(getrefcount(self.child), 3)
+ def testSetParentTwice(self):
+ self.assertEqual(getrefcount(self.child), 2)
+ self.child.setParent(self.parent)
+ self.assertEqual(getrefcount(self.child), 3)
+ self.child.setParent(self.parent)
+ self.assertEqual(getrefcount(self.child), 3)
+
def testConstructor(self):
#QObject(QObject) refcount changes
child = QObject(self.parent)