diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-10-11 18:04:08 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:18:28 -0300 |
commit | 836ebb910f0dec27ae20f25dab4e9041780fccd7 (patch) | |
tree | 8076256a574fc82d319392a15ebe94509c843d30 /tests/samplebinding | |
parent | f6128fb64a591afaa22ed82cc1419ffbbd991583 (diff) |
Added unit test for bug 969.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/samplebinding/global.h | 1 | ||||
-rw-r--r-- | tests/samplebinding/objecttypebyvalue_test.py | 14 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 3 |
4 files changed, 19 insertions, 0 deletions
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt index 4322c3dd9..671a4a043 100644 --- a/tests/samplebinding/CMakeLists.txt +++ b/tests/samplebinding/CMakeLists.txt @@ -48,6 +48,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/noimplicitconversion_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/nondefaultctor_wrapper.cpp ${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/objecttypelayout_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypeoperators_wrapper.cpp diff --git a/tests/samplebinding/global.h b/tests/samplebinding/global.h index 5f9179138..37e00b372 100644 --- a/tests/samplebinding/global.h +++ b/tests/samplebinding/global.h @@ -24,6 +24,7 @@ #include "nondefaultctor.h" #include "objectmodel.h" #include "objecttype.h" +#include "objecttypebyvalue.h" #include "objecttypeholder.h" #include "objecttypelayout.h" #include "objecttypereference.h" diff --git a/tests/samplebinding/objecttypebyvalue_test.py b/tests/samplebinding/objecttypebyvalue_test.py new file mode 100644 index 000000000..a9c6bb302 --- /dev/null +++ b/tests/samplebinding/objecttypebyvalue_test.py @@ -0,0 +1,14 @@ +from sample import * +import unittest + +class ObjectTypeByValueTest (unittest.TestCase): + def testIt(self): + factory = ObjectTypeByValue() + obj = factory.returnSomeKindOfMe() + # This should crash! + obj.prop.protectedValueTypeProperty.setX(1.0) + # just to make sure it will segfault + obj.prop.protectedValueTypeProperty.setY(2.0) + +if __name__ == "__main__": + unittest.main() diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 22848c4b3..3fdeabdef 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -2133,6 +2133,9 @@ <rejection class="ListUser" function-name="sumList(std::list<double>)"/> <value-type name="ValueAndVirtual" /> + + <object-type name="ObjectTypeByValue" /> + <suppress-warning text="horribly broken type '__off64_t'" /> <suppress-warning text="enum '__codecvt_result' does not have a type entry or is not an enum" /> <suppress-warning text="Pure virtual method "Abstract::hideFunction(HideType*)" must be implement but was completely removed on typesystem." /> |