summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/protected_test.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-07-27 10:07:18 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-07-27 10:08:29 -0300
commit1b4094837f983d6273a81daffc5bbffedc82cf2c (patch)
treeb780d13e3aa566df6e9287584f96023fb4f71bac /tests/samplebinding/protected_test.py
parent8a16ff951633c3755cf370228709afaf416b0407 (diff)
downloadshiboken-1b4094837f983d6273a81daffc5bbffedc82cf2c.tar.gz
shiboken-1b4094837f983d6273a81daffc5bbffedc82cf2c.tar.xz
shiboken-1b4094837f983d6273a81daffc5bbffedc82cf2c.zip
Fix char* converter
Fix tests. Created warnning about return last ref of python object. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/samplebinding/protected_test.py')
-rw-r--r--tests/samplebinding/protected_test.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/samplebinding/protected_test.py b/tests/samplebinding/protected_test.py
index 356df1f7..88ac5b59 100644
--- a/tests/samplebinding/protected_test.py
+++ b/tests/samplebinding/protected_test.py
@@ -40,7 +40,8 @@ class ExtendedProtectedPolymorphic(ProtectedPolymorphic):
self.protectedName_called = False
def protectedName(self):
self.protectedName_called = True
- return 'Extended' + ProtectedPolymorphic.protectedName(self)
+ self._name = 'Extended' + ProtectedPolymorphic.protectedName(self)
+ return self._name
class ExtendedProtectedPolymorphicDaughter(ProtectedPolymorphicDaughter):
def __init__(self, name):
@@ -48,7 +49,8 @@ class ExtendedProtectedPolymorphicDaughter(ProtectedPolymorphicDaughter):
ProtectedPolymorphicDaughter.__init__(self, name)
def protectedName(self):
self.protectedName_called = True
- return 'ExtendedDaughter' + ProtectedPolymorphicDaughter.protectedName(self)
+ self._name = 'ExtendedDaughter' + ProtectedPolymorphicDaughter.protectedName(self)
+ return self._name
class ExtendedProtectedPolymorphicGrandDaughter(ProtectedPolymorphicGrandDaughter):
def __init__(self, name):
@@ -56,7 +58,8 @@ class ExtendedProtectedPolymorphicGrandDaughter(ProtectedPolymorphicGrandDaughte
ProtectedPolymorphicGrandDaughter.__init__(self, name)
def protectedName(self):
self.protectedName_called = True
- return 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName(self)
+ self._name = 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName(self)
+ return self._name
class ExtendedProtectedVirtualDestructor(ProtectedVirtualDestructor):
def __init__(self):
@@ -125,6 +128,7 @@ class ProtectedPolymorphicDaugherTest(unittest.TestCase):
original_name = 'Poly'
p = ExtendedProtectedPolymorphicDaughter(original_name)
name = p.callProtectedName()
+ print "MyName:", name
self.assert_(p.protectedName_called)
self.assertEqual(p.protectedName(), name)
self.assertEqual(ProtectedPolymorphicDaughter.protectedName(p), original_name)