diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/python_api/process | |
parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/process')
-rw-r--r-- | packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py | 20 | ||||
-rw-r--r-- | packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py | 8 |
2 files changed, 16 insertions, 12 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py b/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py index f312bc8a92474..d5f407155b29e 100644 --- a/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py +++ b/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb -from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str class ProcessAPITestCase(TestBase): @@ -56,7 +57,7 @@ class ProcessAPITestCase(TestBase): self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'x'", exe=False, - startstr = 'x') + startstr = b'x') # Read (char *)my_char_ptr. val = frame.FindValue("my_char_ptr", lldb.eValueTypeVariableGlobal) @@ -154,7 +155,7 @@ class ProcessAPITestCase(TestBase): self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'a'", exe=False, - startstr = 'a') + startstr = b'a') @add_test_categories(['pyapi']) def test_access_my_int(self): @@ -206,9 +207,8 @@ class ProcessAPITestCase(TestBase): # But we want to use the WriteMemory() API to assign 256 to the variable. # Now use WriteMemory() API to write 256 into the global variable. - new_value = str(bytes) error = lldb.SBError() - result = process.WriteMemory(location, new_value, error) + result = process.WriteMemory(location, bytes, error) if not error.Success() or result != byteSize: self.fail("SBProcess.WriteMemory() failed") @@ -230,20 +230,18 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadMemory() failed") - # Use "ascii" as the encoding because each element of 'content' is in the range [0..255]. - new_bytes = bytearray(content, "ascii") - # The bytearray_to_int utility function expects a little endian bytearray. if byteOrder == lldb.eByteOrderBig: - new_bytes.reverse() + content = bytearray(content, 'ascii') + content.reverse() - new_value = bytearray_to_int(new_bytes, byteSize) + new_value = bytearray_to_int(content, byteSize) if new_value != 256: self.fail("Memory content read from 'my_int' does not match (int)256") # Dump the memory content.... if self.TraceOn(): - for i in new_bytes: + for i in content: print("byte:", i) @add_test_categories(['pyapi']) diff --git a/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py b/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py index 2944ee78acf1a..1a194035f4ded 100644 --- a/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py +++ b/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py @@ -6,8 +6,9 @@ from __future__ import print_function import os, sys, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class ProcessIOTestCase(TestBase): @@ -29,6 +30,7 @@ class ProcessIOTestCase(TestBase): @skipIfWindows # stdio manipulation unsupported on Windows @add_test_categories(['pyapi']) + @expectedFlakeyLinux(bugnumber="llvm.org/pr26437") def test_stdin_by_api(self): """Exercise SBProcess.PutSTDIN().""" self.build() @@ -39,6 +41,7 @@ class ProcessIOTestCase(TestBase): @skipIfWindows # stdio manipulation unsupported on Windows @add_test_categories(['pyapi']) + @expectedFlakeyLinux(bugnumber="llvm.org/pr26437") def test_stdin_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDIN without specifying STDOUT or STDERR.""" self.build() @@ -50,6 +53,7 @@ class ProcessIOTestCase(TestBase): @skipIfWindows # stdio manipulation unsupported on Windows @add_test_categories(['pyapi']) + @expectedFlakeyLinux(bugnumber="llvm.org/pr26437") def test_stdout_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR.""" self.build() @@ -62,6 +66,7 @@ class ProcessIOTestCase(TestBase): @skipIfWindows # stdio manipulation unsupported on Windows @add_test_categories(['pyapi']) + @expectedFlakeyLinux(bugnumber="llvm.org/pr26437") def test_stderr_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT.""" self.build() @@ -74,6 +79,7 @@ class ProcessIOTestCase(TestBase): @skipIfWindows # stdio manipulation unsupported on Windows @add_test_categories(['pyapi']) + @expectedFlakeyLinux(bugnumber="llvm.org/pr26437") def test_stdout_stderr_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR without redirecting STDIN.""" self.build() |