diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-24 17:48:35 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-26 16:02:04 -0300 |
commit | 817e90dab1c2727bf4e5b96fdf1ba8a39dfd0736 (patch) | |
tree | 02999ab5e48a0559c61f38cfa21bed227fe13332 /tests | |
parent | 03525843adab2fceda8c1e3aa2d9f1ad72bcda89 (diff) |
Adds test case for libsample's Size class copy constructor.
Also fixes samplebinding type system indentation.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/samplebinding/size_test.py | 9 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/tests/samplebinding/size_test.py b/tests/samplebinding/size_test.py index 0d44828bf..e85cb766c 100755 --- a/tests/samplebinding/size_test.py +++ b/tests/samplebinding/size_test.py @@ -26,7 +26,6 @@ '''Test cases for operator overloads on Size class''' -import sys import unittest from sample import Size @@ -42,6 +41,14 @@ class PointTest(unittest.TestCase): self.assertEqual(size.height(), height) self.assertEqual(size.calculateArea(), width * height) + def testCopyConstructor(self): + '''Test Size class copy constructor.''' + width, height = (5.0, 2.3) + s1 = Size(width, height) + s2 = Size(s1) + self.assertFalse(s1 is s2) + self.assertEqual(s1, s2) + def testPlusOperator(self): '''Test Size class + operator.''' s1 = Size(5.0, 2.3) diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 14ce1e18a..8a36ec057 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -876,12 +876,12 @@ <value-type name="Time"/> <value-type name="Size"> <add-function signature="Size(const char*)"> - <inject-code class="target" position="beginning"> - %0 = new %TYPE(); - </inject-code> - <inject-code class="target" position="end"> - Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "setHeight", "i", 2)); - </inject-code> + <inject-code class="target" position="beginning"> + %0 = new %TYPE(); + </inject-code> + <inject-code class="target" position="end"> + Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "setHeight", "i", 2)); + </inject-code> </add-function> </value-type> <value-type name="MapUser"/> |