summaryrefslogtreecommitdiff
path: root/tests/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-08-16 11:30:35 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-08-16 11:30:35 (GMT)
commit161c0f8ab227af5033b1b6456607b9b9c3bc60df (patch)
treecadf14ab1bfe857ac9a7904fe9ea98de554751d8 /tests/arch
parent56ee4d3ecddeee05f11083fcc1595e3756b91790 (diff)
Improved the code for handling vmpa_t definitions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@388 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tests/arch')
-rwxr-xr-xtests/arch/vmpa.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/arch/vmpa.py b/tests/arch/vmpa.py
new file mode 100755
index 0000000..9814b20
--- /dev/null
+++ b/tests/arch/vmpa.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python3-dbg
+# -*- coding: utf-8 -*-
+
+import pychrysalide
+from pychrysalide.arch import vmpa
+from test import TestSuite
+
+
+########################
+
+TestSuite.print_sep()
+
+addr = vmpa()
+
+print('repr():', repr(addr))
+print('str(): ', str(addr))
+
+########################
+
+TestSuite.print_sep()
+
+TestSuite.check_true('Create a virtual memory or physical address', lambda: vmpa())
+
+v = vmpa()
+
+TestSuite.check_true('VMPA values are left uninitialized by default', lambda: v.phy == None and v.virt == None)
+
+a = vmpa(0, 0) + 1
+
+b = 1 + vmpa(0, 0)
+
+TestSuite.check_true('Verify the commutative property of addition', lambda: a == b)