summaryrefslogtreecommitdiff
path: root/tests/arch/vmpa.py
blob: 9814b20c5c2c105d5059c41af4053286d2e0c1a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)