summaryrefslogtreecommitdiff
path: root/tests/analysis/contents/endian.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-04 18:50:07 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-04 18:50:07 (GMT)
commitb9fe3a839e9212b809d64c11bf92b703adb18fb2 (patch)
tree86a1c42f305265372bb4d697dad9c99f2ea3715a /tests/analysis/contents/endian.py
parent0b2cada60941d109bde2f54a198f4c3a799e0606 (diff)
Updated the test suite for the current API.
Diffstat (limited to 'tests/analysis/contents/endian.py')
-rw-r--r--tests/analysis/contents/endian.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/analysis/contents/endian.py b/tests/analysis/contents/endian.py
index 209600a..77ed77a 100644
--- a/tests/analysis/contents/endian.py
+++ b/tests/analysis/contents/endian.py
@@ -6,6 +6,7 @@
from chrysacase import ChrysalideTestCase
+from pychrysalide import arch
from pychrysalide.analysis.contents import FileContent, RestrictedContent
from pychrysalide.arch import vmpa
import tempfile
@@ -54,36 +55,36 @@ class TestEndianness(ChrysalideTestCase):
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u16(start, vmpa.SRE_LITTLE_WORD)
+ val = fcnt.read_u16(start, arch.SRE_LITTLE_WORD)
self.assertEqual(val, 0x1516)
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u16(start, vmpa.SRE_BIG_WORD)
+ val = fcnt.read_u16(start, arch.SRE_BIG_WORD)
self.assertEqual(val, 0x1615)
# 32 bits
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u32(start, vmpa.SRE_LITTLE_WORD)
+ val = fcnt.read_u32(start, arch.SRE_LITTLE_WORD)
self.assertEqual(val, 0x17181516)
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u32(start, vmpa.SRE_BIG_WORD)
+ val = fcnt.read_u32(start, arch.SRE_BIG_WORD)
self.assertEqual(val, 0x16151817)
# 64 bits
start = vmpa(0, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u64(start, vmpa.SRE_LITTLE_WORD)
+ val = fcnt.read_u64(start, arch.SRE_LITTLE_WORD)
self.assertEqual(val, 0x0708050603040102)
start = vmpa(0, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u64(start, vmpa.SRE_BIG_WORD)
+ val = fcnt.read_u64(start, arch.SRE_BIG_WORD)
self.assertEqual(val, 0x0201040306050807)
@@ -96,34 +97,34 @@ class TestEndianness(ChrysalideTestCase):
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u16(start, vmpa.SRE_LITTLE)
+ val = fcnt.read_u16(start, arch.SRE_LITTLE)
self.assertEqual(val, 0x1615)
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u16(start, vmpa.SRE_BIG)
+ val = fcnt.read_u16(start, arch.SRE_BIG)
self.assertEqual(val, 0x1516)
# 32 bits
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u32(start, vmpa.SRE_LITTLE)
+ val = fcnt.read_u32(start, arch.SRE_LITTLE)
self.assertEqual(val, 0x18171615)
start = vmpa(12, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u32(start, vmpa.SRE_BIG)
+ val = fcnt.read_u32(start, arch.SRE_BIG)
self.assertEqual(val, 0x15161718)
# 64 bits
start = vmpa(0, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u64(start, vmpa.SRE_LITTLE)
+ val = fcnt.read_u64(start, arch.SRE_LITTLE)
self.assertEqual(val, 0x0807060504030201)
start = vmpa(0, vmpa.VMPA_NO_VIRTUAL)
- val = fcnt.read_u64(start, vmpa.SRE_BIG)
+ val = fcnt.read_u64(start, arch.SRE_BIG)
self.assertEqual(val, 0x0102030405060708)