diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-10-18 16:59:55 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:18:30 -0300 |
commit | 01acb23113d4a22eae474bcb9be30e4d661b505e (patch) | |
tree | d57b0b8d79349725de1a49387156234d947176b3 /tests/samplebinding | |
parent | 7dc999dab8eccfbee983206d70f7925fb1f629df (diff) |
Updates std::list methods writer to use the new converters.
Also added a couple of related unit tests.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/samplebinding/intlist_test.py | 12 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 6 |
3 files changed, 21 insertions, 1 deletions
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt index 671a4a043..d7734592c 100644 --- a/tests/samplebinding/CMakeLists.txt +++ b/tests/samplebinding/CMakeLists.txt @@ -51,6 +51,7 @@ ${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/objecttypeptrlist_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objecttypeoperators_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objectview_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/objtypereference_wrapper.cpp @@ -65,8 +66,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/photon_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/photon_valueidentity_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/photon_valueduplicator_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/point_wrapper.cpp -${CMAKE_CURRENT_BINARY_DIR}/sample/pointf_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/pointerholder_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/sample/pointf_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/sample/pointvaluelist_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/polygon_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/primitivestructpointerholder_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/sample/privatector_wrapper.cpp diff --git a/tests/samplebinding/intlist_test.py b/tests/samplebinding/intlist_test.py index 683de9944..3a9755052 100644 --- a/tests/samplebinding/intlist_test.py +++ b/tests/samplebinding/intlist_test.py @@ -77,5 +77,17 @@ class IntListTest(unittest.TestCase): self.assertEqual(il[i], ints[i]) self.assertEqual(il.constructorUsed(), IntList.ListOfIntCtor) + def testIntListAttributeTypeCheck(self): + '''Attribute values to IntList.''' + il = IntList([0, 1, 2]) + self.assertEqual(len(il), 3) + il[0] = 123 + self.assertEqual(len(il), 3) + self.assertEqual(il[0], 123) + il[1] = 432.1 + self.assertEqual(len(il), 3) + self.assertEqual(il[1], int(432.1)) + self.assertRaises(TypeError, il.__setitem__, 2, '78') + if __name__ == '__main__': unittest.main() diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 3fdeabdef..2d3339842 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -434,6 +434,12 @@ <value-type name="IntList"> <enum-type name="CtorEnum"/> </value-type> + <value-type name="PointValueList"> + <enum-type name="CtorEnum"/> + </value-type> + <value-type name="ObjectTypePtrList"> + <enum-type name="CtorEnum"/> + </value-type> <object-type name="Abstract"> <enum-type name="Type"/> |