Revamp Python regression tests suite (#2022)
* Fix Python regression test suite (partial) * Fix Python regression test suite * Add a test for mapping at high addresses * Add ctl tests
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import regress
|
||||
|
||||
from unicorn import *
|
||||
from unicorn.arm_const import *
|
||||
|
||||
import regress
|
||||
|
||||
class VldrPcInsn(regress.RegressTest):
|
||||
|
||||
def runTest(self):
|
||||
uc = Uc(UC_ARCH_ARM, UC_MODE_ARM)
|
||||
|
||||
uc.mem_map(0x1000, 0x1000)
|
||||
uc.mem_write(0x1000, 'ed9f8a3d'.decode('hex')) # vldr s16, [pc, #244]
|
||||
# this will raise invalid insn
|
||||
uc.emu_start(0x1000, 0x1004)
|
||||
uc.mem_write(0x1000, b'\xed\x9f\x8a\x3d') # vldr s16, [pc, #244]
|
||||
|
||||
with self.assertRaises(UcError) as ex:
|
||||
uc.emu_start(0x1000, 0x1004)
|
||||
|
||||
self.assertEqual(UC_ERR_INSN_INVALID, ex.exception.errno)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
regress.main()
|
||||
|
||||
Reference in New Issue
Block a user