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,12 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
from unicorn import *
|
||||
from unicorn.x86_const import *
|
||||
|
||||
import regress
|
||||
|
||||
X86_CODE64 = "\x90" # NOP
|
||||
from unicorn import *
|
||||
from unicorn.x86_const import *
|
||||
|
||||
|
||||
X86_CODE64 = b"\x90" # NOP
|
||||
|
||||
|
||||
class WriteBeforeMap(regress.RegressTest):
|
||||
@@ -18,7 +18,10 @@ class WriteBeforeMap(regress.RegressTest):
|
||||
ADDRESS = 0x1000000
|
||||
|
||||
# write machine code to be emulated to memory
|
||||
mu.mem_write(ADDRESS, X86_CODE64)
|
||||
with self.assertRaises(UcError) as raisedEx:
|
||||
mu.mem_write(ADDRESS, X86_CODE64)
|
||||
|
||||
self.assertEqual(UC_ERR_WRITE_UNMAPPED, raisedEx.exception.errno)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user