diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-11-25 23:26:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-11-25 23:26:53 (GMT) |
commit | 545d0490f6fbb397da66410f534670c52bfcc5da (patch) | |
tree | b6923de79a4b406e51b906b76a737d93ea74b73c /tests/arch | |
parent | 355a7140932b77d351bc6ddd965608b0011af855 (diff) |
Implemented restricted contents and created test cases.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@608 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tests/arch')
-rw-r--r-- | tests/arch/__init__.py | 0 | ||||
-rwxr-xr-x | tests/arch/vmpa.py | 35 |
2 files changed, 19 insertions, 16 deletions
diff --git a/tests/arch/__init__.py b/tests/arch/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/arch/__init__.py diff --git a/tests/arch/vmpa.py b/tests/arch/vmpa.py index 9814b20..def61ea 100755 --- a/tests/arch/vmpa.py +++ b/tests/arch/vmpa.py @@ -1,32 +1,35 @@ #!/usr/bin/python3-dbg # -*- coding: utf-8 -*- -import pychrysalide -from pychrysalide.arch import vmpa -from test import TestSuite + +# Tests minimalistes pour valider l'intégration des adresses et espaces mémoire +# depuis Python. -######################## +from chrysacase import ChrysalideTestCase +from pychrysalide.arch import vmpa -TestSuite.print_sep() -addr = vmpa() +class TestVmpa(ChrysalideTestCase): + """TestCase for arch.vmpa.""" -print('repr():', repr(addr)) -print('str(): ', str(addr)) + def testInit(self): + """VMPA values are left uninitialized by default.""" -######################## + v = vmpa() -TestSuite.print_sep() + self.assertIsNone(v.phys) + self.assertIsNone(v.virt) -TestSuite.check_true('Create a virtual memory or physical address', lambda: vmpa()) -v = vmpa() + def testAdd(self): + """Verify the commutative property of addition.""" -TestSuite.check_true('VMPA values are left uninitialized by default', lambda: v.phy == None and v.virt == None) + a = vmpa(0, 0) + 1 -a = vmpa(0, 0) + 1 + b = 1 + vmpa(0, 0) -b = 1 + vmpa(0, 0) + c = vmpa(1, 1) -TestSuite.check_true('Verify the commutative property of addition', lambda: a == b) + self.assertEqual(a, b) + self.assertEqual(a, c) |