diff options
Diffstat (limited to 'test/os_dep/linux')
| -rwxr-xr-x | test/os_dep/linux/stdlib.py | 8 | ||||
| -rw-r--r-- | test/os_dep/linux/test_env.py | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/os_dep/linux/stdlib.py b/test/os_dep/linux/stdlib.py index ab39a487..80b99969 100755 --- a/test/os_dep/linux/stdlib.py +++ b/test/os_dep/linux/stdlib.py @@ -19,12 +19,12 @@ class TestLinuxStdlib(unittest.TestCase): def test_xxx_sprintf(self): def alloc_str(s): - s += "\x00" + s += b"\x00" ptr = heap.alloc(jit, len(s)) jit.vm.set_mem(ptr, s) return ptr - fmt = alloc_str("'%s' %d") - str_ = alloc_str("coucou") + fmt = alloc_str(b"'%s' %d") + str_ = alloc_str(b"coucou") buf = heap.alloc(jit,1024) jit.push_uint32_t(1111) @@ -34,7 +34,7 @@ class TestLinuxStdlib(unittest.TestCase): jit.push_uint32_t(0) # ret_ad stdlib.xxx_sprintf(jit) ret = jit.get_str_ansi(buf) - self.assertEqual(ret, "'coucou' 1111") + self.assertEqual(ret, b"'coucou' 1111") if __name__ == '__main__': diff --git a/test/os_dep/linux/test_env.py b/test/os_dep/linux/test_env.py index 0c80571f..1e8e7678 100644 --- a/test/os_dep/linux/test_env.py +++ b/test/os_dep/linux/test_env.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os import sys from pdb import pm @@ -6,7 +7,7 @@ from miasm2.analysis.sandbox import Sandbox_Linux_x86_32, Sandbox_Linux_x86_64,\ Sandbox_Linux_arml, Sandbox_Linux_aarch64l if len(sys.argv) < 2: - print "Usage: %s <arch> ..." % sys.argv[0] + print("Usage: %s <arch> ..." % sys.argv[0]) exit(0) arch = sys.argv[1] |