diff options
| author | Ajax <commial@gmail.com> | 2015-11-16 12:46:42 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-11-16 12:46:42 +0100 |
| commit | 35822fc551ce0c881c7e5216e2a2119cbed0a162 (patch) | |
| tree | 13af39242090b9d400e679ad496ccb440b34eb57 | |
| parent | a014d17db74a0de84efbf7a8a21ea58739dbb39d (diff) | |
| download | miasm-35822fc551ce0c881c7e5216e2a2119cbed0a162.tar.gz miasm-35822fc551ce0c881c7e5216e2a2119cbed0a162.zip | |
Test/QEMU: emulate puts, enabling test_self_modifying_code
Diffstat (limited to '')
| -rw-r--r-- | test/arch/x86/qemu/testqemu.py | 16 | ||||
| -rw-r--r-- | test/test_all.py | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/test/arch/x86/qemu/testqemu.py b/test/arch/x86/qemu/testqemu.py index d04308e4..7cf2ab75 100644 --- a/test/arch/x86/qemu/testqemu.py +++ b/test/arch/x86/qemu/testqemu.py @@ -84,6 +84,22 @@ def xxx___printf_chk(jitter): nb_tests += 1 jitter.func_ret_cdecl(ret_ad, 0) +def xxx_puts(jitter): + ''' + #include <stdio.h> + int puts(const char *s); + + writes the string s and a trailing newline to stdout. + ''' + ret_addr, args = jitter.func_args_cdecl(['target']) + output = jitter.get_str_ansi(args.target) + # Check with expected result + line = expected.next() + if output != line.rstrip(): + print "Expected:", line + print "Obtained:", output + raise RuntimeError("Bad semantic") + return jitter.func_ret_cdecl(ret_addr, 1) # Parse arguments parser = Sandbox_Linux_x86_32.parser(description="ELF sandboxer") diff --git a/test/test_all.py b/test/test_all.py index 4dff7ed7..6288466a 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -105,10 +105,11 @@ QEMU_TESTS = { "jcc": ("tcc", "python"), "loop": ("tcc", "python"), "lea": ("tcc", "python"), + "self_modifying_code": ("tcc", "python"), "conv": ("tcc", "python"), # Unsupported # "floats", "bcd", "xchg", "string", "misc", "segs", "code16", "exceptions", - # "self_modifying_code", "single_step" + # "single_step" } |