diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-06-02 13:33:59 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-06-03 08:46:38 -0300 |
commit | e2738233c5bffb1fd0ad0f44c1a930c366329faa (patch) | |
tree | 5c40c7a0b498297da24cb69d0cab971fd571271b /tests/samplebinding/protected_test.py | |
parent | 7bc6f1512b1febc026d81917f33b1ea90d23fe24 (diff) | |
download | shiboken-e2738233c5bffb1fd0ad0f44c1a930c366329faa.tar.gz shiboken-e2738233c5bffb1fd0ad0f44c1a930c366329faa.tar.xz shiboken-e2738233c5bffb1fd0ad0f44c1a930c366329faa.zip |
Added support for protected fields when not using the "protected hack".
Tests were also added.
Diffstat (limited to 'tests/samplebinding/protected_test.py')
-rwxr-xr-x | tests/samplebinding/protected_test.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/samplebinding/protected_test.py b/tests/samplebinding/protected_test.py index fa477c42..356df1f7 100755 --- a/tests/samplebinding/protected_test.py +++ b/tests/samplebinding/protected_test.py @@ -30,7 +30,7 @@ import unittest from sample import ProtectedNonPolymorphic, ProtectedVirtualDestructor from sample import ProtectedPolymorphic, ProtectedPolymorphicDaughter, ProtectedPolymorphicGrandDaughter -from sample import ProtectedEnumClass +from sample import ProtectedProperty, ProtectedEnumClass from sample import PrivateDtor from sample import Point @@ -243,6 +243,17 @@ class ProtectedEnumTest(unittest.TestCase): self.assertEqual(obj.callPublicEnumMethod(ProtectedEnumClass.PublicItem1), ProtectedEnumClass.PublicItem0) +class ProtectedPropertyTest(unittest.TestCase): + '''Test cases for a class with a protected property (or field in C++).''' + + def testProtectedProperty(self): + '''Writes and reads a protected property.''' + obj = ProtectedProperty() + + obj.protectedProperty = 3 + self.assertEqual(obj.protectedProperty, 3) + + class PrivateDtorProtectedMethodTest(unittest.TestCase): '''Test cases for classes with private destructors and protected methods.''' |