aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-09 18:24:56 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 16:50:33 -0300
commiteb2614d3ac818a6e2dfe85b1d1b98408f2d37f06 (patch)
tree67f2dcc1c1339ad0104b78cb9fac918b2185b55e /tests/samplebinding
parent633836a403355d2bc245819aab07f29b05ac901f (diff)
Fix BUG #1105 - "Spyder fails with HEAD"
When handling typedef'd primitive types we don't need to create indices for them, nor converters. Instead, we must use the underlying primitive type converters. See http://bugs.pyside.org/show_bug.cgi?id=1105. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/handleholder_test.py18
-rw-r--r--tests/samplebinding/typesystem_sample.xml2
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/samplebinding/handleholder_test.py b/tests/samplebinding/handleholder_test.py
index 65f3d0cce..a7a64bdbd 100644
--- a/tests/samplebinding/handleholder_test.py
+++ b/tests/samplebinding/handleholder_test.py
@@ -3,7 +3,7 @@
#
# This file is part of the Shiboken Python Bindings Generator project.
#
-# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
@@ -21,17 +21,17 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-'''Test case for a class that holds a unknown handle object.'''
+''' Test case for a class that holds a unknown handle object.
+ Test case for BUG #1105.
+'''
import unittest
from sample import HandleHolder
class HandleHolderTest(unittest.TestCase):
-
def testCreation(self):
holder = HandleHolder(HandleHolder.createHandle())
holder2 = HandleHolder(HandleHolder.createHandle())
@@ -39,9 +39,13 @@ class HandleHolderTest(unittest.TestCase):
def testTransfer(self):
holder = HandleHolder()
- holder2 = HandleHolder(holder.get())
+ holder2 = HandleHolder(holder.handle())
self.assertTrue(holder.compare(holder2))
+ def testUseDefinedType(self):
+ holder = HandleHolder(8)
+ holder2 = HandleHolder(holder.handle2())
+ self.assertTrue(holder.compare2(holder2))
+
if __name__ == '__main__':
unittest.main()
-
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 0389d8520..ac9202a16 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -24,6 +24,8 @@
<primitive-type name="unsigned long"/>
<primitive-type name="std::string"/>
+ <primitive-type name="Foo::HANDLE" target-lang-api-name="PyLong"/>
+
<primitive-type name="std::size_t" target-lang-api-name="PyLong">
<conversion-rule>
<native-to-target>