about summary refs log tree commit diff stats
path: root/test/os_dep/linux/stdlib.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2019-03-07 14:37:07 +0100
committerGitHub <noreply@github.com>2019-03-07 14:37:07 +0100
commit4c2320b46250a8d6f8774e1218544b72a154cd8e (patch)
treeb67e7b072439f84109bd39dad8ed7f3f135224f8 /test/os_dep/linux/stdlib.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
parent26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff)
downloadmiasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz
miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'test/os_dep/linux/stdlib.py')
-rwxr-xr-xtest/os_dep/linux/stdlib.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/os_dep/linux/stdlib.py b/test/os_dep/linux/stdlib.py
index ab39a487..a205002b 100755
--- a/test/os_dep/linux/stdlib.py
+++ b/test/os_dep/linux/stdlib.py
@@ -3,10 +3,10 @@
 
 import unittest
 import logging
-from miasm2.analysis.machine import Machine
-import miasm2.os_dep.linux_stdlib as stdlib
-from miasm2.core.utils import pck32
-from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE
+from miasm.analysis.machine import Machine
+import miasm.os_dep.linux_stdlib as stdlib
+from miasm.core.utils import pck32
+from miasm.jitter.csts import PAGE_READ, PAGE_WRITE
 
 machine = Machine("x86_32")
 
@@ -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__':