summaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/enum_test.py11
-rw-r--r--tests/samplebinding/typesystem_sample.xml3
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py
index 65ec1af3..71ebef60 100644
--- a/tests/samplebinding/enum_test.py
+++ b/tests/samplebinding/enum_test.py
@@ -28,6 +28,7 @@
import unittest
+import sample
from sample import SampleNamespace, ObjectType, Event
class EnumTest(unittest.TestCase):
@@ -72,6 +73,16 @@ class EnumTest(unittest.TestCase):
self.assertEqual(SampleNamespace.enumItemAsDefaultValueToIntArgument(SampleNamespace.ZeroOut), SampleNamespace.ZeroOut)
self.assertEqual(SampleNamespace.enumItemAsDefaultValueToIntArgument(123), 123)
+ def testAnonymousGlobalEnums(self):
+ '''Checks availability of anonymous global enum items.'''
+ self.assertEqual(sample.AnonymousGlobalEnum_Value0, 0)
+ self.assertEqual(sample.AnonymousGlobalEnum_Value1, 1)
+
+ def testAnonymousClassEnums(self):
+ '''Checks availability of anonymous class enum items.'''
+ self.assertEqual(SampleNamespace.AnonymousClassEnum_Value0, 0)
+ self.assertEqual(SampleNamespace.AnonymousClassEnum_Value1, 1)
+
class EnumOverloadTest(unittest.TestCase):
'''Test case for overloads involving enums'''
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 4f98dff4..88cf7689 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -87,6 +87,9 @@
<enum-type name="Event::EventType"/>
<enum-type name="Abstract::Type"/>
+ <enum-type identified-by-value="AnonymousGlobalEnum_Value0"/>
+ <enum-type identified-by-value="SampleNamespace::AnonymousClassEnum_Value1"/>
+
<namespace-type name="SampleNamespace">
<modify-function signature="doSomethingWithArray(const unsigned char*, unsigned int, const char*)">
<modify-argument index="1">