diff options
author | John Ehresman <jpe@wingware.com> | 2012-06-07 20:44:19 -0400 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2012-06-14 20:20:21 +0200 |
commit | e40e993cecd1663636e2f0d33b3e2a6204d64984 (patch) | |
tree | 172ed7dbfc535fd6113c8707a82e02647aaec7dc /tests/samplebinding | |
parent | 54cce10fa8a9942450c9e1a9d9a9d2a1b688f243 (diff) |
Find function modifications defined in the 2nd+ base class.
Fixes bug PYSIDE-54
Change-Id: Ic5c341741170cc77e8ebb59c46c746211582ddeb
Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/samplebinding/ownership_invalidate_after_use_test.py | 20 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 4 |
3 files changed, 25 insertions, 1 deletions
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt index 601b12692..f0d973088 100644 --- a/tests/samplebinding/CMakeLists.txt +++ b/tests/samplebinding/CMakeLists.txt @@ -50,6 +50,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/objectmodel_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttype_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypebyvalue_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypeholder_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypederived_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypelayout_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypeptrlist_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypeoperators_wrapper.cpp @@ -57,6 +58,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/objectview_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objtypereference_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/oddbooluser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/onlycopy_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/sample/otherbase_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/overload_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/overload2_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/pairuser_wrapper.cpp diff --git a/tests/samplebinding/ownership_invalidate_after_use_test.py b/tests/samplebinding/ownership_invalidate_after_use_test.py index 5a03fc470..194c7e77e 100644 --- a/tests/samplebinding/ownership_invalidate_after_use_test.py +++ b/tests/samplebinding/ownership_invalidate_after_use_test.py @@ -29,7 +29,7 @@ import sys import unittest -from sample import ObjectType, Event +from sample import ObjectType, ObjectTypeDerived, Event class ExtObjectType(ObjectType): @@ -59,6 +59,16 @@ class MyObjectType (ObjectType): def invalidateEvent(self, ev): pass +class ExtObjectTypeDerived(ObjectTypeDerived): + def __init__(self): + ObjectTypeDerived.__init__(self) + self.type_of_last_event = None + self.last_event = None + def event(self, event): + self.last_event = event + self.type_of_last_event = event.eventType() + return True + class OwnershipInvalidateAfterUseTest(unittest.TestCase): '''Ownership tests for cases of invalidation of Python wrapper after use.''' @@ -82,6 +92,14 @@ class OwnershipInvalidateAfterUseTest(unittest.TestCase): obj.causeEvent(Event.BASIC_EVENT) self.assertFalse(obj.fail) + def testInvalidateAfterUseInDerived(self): + '''Invalidate was failing in a derived C++ class that also inherited + other base classes''' + eot = ExtObjectTypeDerived() + eot.causeEvent(Event.SOME_EVENT) + self.assertEqual(eot.type_of_last_event, Event.SOME_EVENT) + self.assertRaises(RuntimeError, eot.last_event.eventType) + if __name__ == '__main__': unittest.main() diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index ac9202a16..f7c0645d8 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -727,6 +727,10 @@ </modify-argument> </modify-function> </object-type> + + <object-type name="OtherBase" /> + <object-type name="ObjectTypeDerived" /> + <object-type name="ObjectTypeLayout"> <modify-function signature="create()"> <modify-argument index="return"> |