summaryrefslogtreecommitdiff
path: root/tests/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'tests/analysis')
-rw-r--r--tests/analysis/types/basic.py4
-rw-r--r--tests/analysis/types/cse.py30
2 files changed, 32 insertions, 2 deletions
diff --git a/tests/analysis/types/basic.py b/tests/analysis/types/basic.py
index 7b7403b..65700bd 100644
--- a/tests/analysis/types/basic.py
+++ b/tests/analysis/types/basic.py
@@ -6,8 +6,8 @@ from chrysacase import ChrysalideTestCase
from pychrysalide.analysis.types import BasicType
-class TestDataType(ChrysalideTestCase):
- """TestCase for analysis.DataType."""
+class TestBasicType(ChrysalideTestCase):
+ """TestCase for analysis.BasicType."""
def testBasicTypeConstructor(self):
diff --git a/tests/analysis/types/cse.py b/tests/analysis/types/cse.py
new file mode 100644
index 0000000..9b6b016
--- /dev/null
+++ b/tests/analysis/types/cse.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python3-dbg
+# -*- coding: utf-8 -*-
+
+
+from chrysacase import ChrysalideTestCase
+from pychrysalide.analysis.types import ClassEnumType
+
+
+class TestClassEnumType(ChrysalideTestCase):
+ """TestCase for analysis.ClassEnumType."""
+
+
+ def testClassEnumTypeConstructor(self):
+ """Build some class/enum types."""
+
+ tp = ClassEnumType(ClassEnumType.ClassEnumKind.STRUCT)
+
+ self.assertEqual(str(tp), '')
+
+ tp = ClassEnumType(ClassEnumType.ClassEnumKind.STRUCT, 'XXX')
+
+ self.assertEqual(str(tp), 'XXX')
+
+ with self.assertRaisesRegex(TypeError, 'Bad class/enum kind.'):
+
+ tp = ClassEnumType(ClassEnumType.ClassEnumKind.COUNT)
+
+ with self.assertRaisesRegex(TypeError, 'invalid value for ClassEnumKind'):
+
+ tp = ClassEnumType(0x1234)