#!/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)