blob: def61eaeffc250ef58eec303ab72539384d2be87 (
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
33
34
35
|
#!/usr/bin/python3-dbg
# -*- coding: utf-8 -*-
# Tests minimalistes pour valider l'intégration des adresses et espaces mémoire
# depuis Python.
from chrysacase import ChrysalideTestCase
from pychrysalide.arch import vmpa
class TestVmpa(ChrysalideTestCase):
"""TestCase for arch.vmpa."""
def testInit(self):
"""VMPA values are left uninitialized by default."""
v = vmpa()
self.assertIsNone(v.phys)
self.assertIsNone(v.virt)
def testAdd(self):
"""Verify the commutative property of addition."""
a = vmpa(0, 0) + 1
b = 1 + vmpa(0, 0)
c = vmpa(1, 1)
self.assertEqual(a, b)
self.assertEqual(a, c)
|