Fixed cyclic dependency on duck punching test.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
ee7b4826c0
commit
1920130fc9
1 changed files with 12 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication):
|
||||||
child = QObject()
|
child = QObject()
|
||||||
child.setParent(parent)
|
child.setParent(parent)
|
||||||
self.assert_(self.duck_childEvent_called)
|
self.assert_(self.duck_childEvent_called)
|
||||||
|
# This is done to decrease the refcount of the vm object
|
||||||
|
# allowing the object wrapper to be deleted before the
|
||||||
|
# BindingManager. This is useful when compiling Shiboken
|
||||||
|
# for debug, since the BindingManager destructor has an
|
||||||
|
# assert that checks if the wrapper mapper is empty.
|
||||||
|
parent.childEvent = None
|
||||||
|
|
||||||
def testChildEventMonkeyPatchWithInheritance(self):
|
def testChildEventMonkeyPatchWithInheritance(self):
|
||||||
#Test if the new childEvent injected on a QObject's extension class instance is called from C++
|
#Test if the new childEvent injected on a QObject's extension class instance is called from C++
|
||||||
|
|
@ -50,6 +56,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication):
|
||||||
child = QObject()
|
child = QObject()
|
||||||
child.setParent(parent)
|
child.setParent(parent)
|
||||||
self.assert_(self.duck_childEvent_called)
|
self.assert_(self.duck_childEvent_called)
|
||||||
|
# This is done to decrease the refcount of the vm object
|
||||||
|
# allowing the object wrapper to be deleted before the
|
||||||
|
# BindingManager. This is useful when compiling Shiboken
|
||||||
|
# for debug, since the BindingManager destructor has an
|
||||||
|
# assert that checks if the wrapper mapper is empty.
|
||||||
|
parent.childEvent = None
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue