summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-15 14:47:02 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-06-15 15:13:55 -0300
commitc2683738a2c42447a03f0a6f369e89447374ab54 (patch)
treed9dda084f8af1d90c60f98d77b77719bdf5cdc2a /tests/samplebinding
parent34c5a73107e90e874e3f392a7effb4c598882190 (diff)
downloadshiboken-c2683738a2c42447a03f0a6f369e89447374ab54.tar.gz
shiboken-c2683738a2c42447a03f0a6f369e89447374ab54.tar.xz
shiboken-c2683738a2c42447a03f0a6f369e89447374ab54.zip
Added test function with an integer argument that have an enum as default value.
Diffstat (limited to 'tests/samplebinding')
-rwxr-xr-xtests/samplebinding/enum_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py
index 0d4be229..65ec1af3 100755
--- a/tests/samplebinding/enum_test.py
+++ b/tests/samplebinding/enum_test.py
@@ -66,6 +66,12 @@ class EnumTest(unittest.TestCase):
'''Calling the constructor of non-extensible enum with a string.'''
self.assertRaises(TypeError, SampleNamespace.InValue, '1')
+ def testEnumItemAsDefaultValueToIntArgument(self):
+ '''Calls function with an enum item as default value to an int argument.'''
+ self.assertEqual(SampleNamespace.enumItemAsDefaultValueToIntArgument(), SampleNamespace.ZeroIn)
+ self.assertEqual(SampleNamespace.enumItemAsDefaultValueToIntArgument(SampleNamespace.ZeroOut), SampleNamespace.ZeroOut)
+ self.assertEqual(SampleNamespace.enumItemAsDefaultValueToIntArgument(123), 123)
+
class EnumOverloadTest(unittest.TestCase):
'''Test case for overloads involving enums'''