diff options
author | Renato Araujo Oliveira Filho <renato.filho@openbossa.org> | 2011-01-12 19:26:27 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:51:45 -0300 |
commit | 3ac4080bfe3052b8ee805a0a983a68cf142241b2 (patch) | |
tree | f909f4710cd33efd39613413a33c0f62746eb1e1 /tests | |
parent | 7e667036d58a0549dd08a152149e1ba1f410bfb7 (diff) |
Create a new parent test.
Check if the parent does not increase the reference if you set the
parent twice.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtCore/qobject_parent_test.py | 7 |
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) |