summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/process/TestProcessAPI.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-15 22:14:12 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-15 22:14:12 +0000
commit5a0bee7c5f06333b68740fce3311b1a164ef93ea (patch)
treea9d71b63ed6ea0f4ace535b54d30c2daa8762f2c /lldb/test/python_api/process/TestProcessAPI.py
parentc20b1393e18eb88e150b013671d0c493ac2091b7 (diff)
downloadbcm5719-llvm-5a0bee7c5f06333b68740fce3311b1a164ef93ea.tar.gz
bcm5719-llvm-5a0bee7c5f06333b68740fce3311b1a164ef93ea.zip
The extra burden for the Python API test case to assign its process object to self.process
in order to have its process cleaned up (terminated) upon tearDown is gone for good. Let's simplify a bunch of Python API test cases. llvm-svn: 133097
Diffstat (limited to 'lldb/test/python_api/process/TestProcessAPI.py')
-rw-r--r--lldb/test/python_api/process/TestProcessAPI.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 4e014cc3b3e..a9bdec546c8 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -76,9 +76,9 @@ class ProcessAPITestCase(TestBase):
# Launch the process, and do not stop at the entry point.
error = lldb.SBError()
- self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+ process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
- thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+ thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
@@ -95,7 +95,7 @@ class ProcessAPITestCase(TestBase):
# Due to the typemap magic (see lldb.swig), we pass in 1 to ReadMemory and
# expect to get a Python string as the result object!
- content = self.process.ReadMemory(location, 1, error)
+ content = process.ReadMemory(location, 1, error)
if not error.Success():
self.fail("SBProcess.ReadMemory() failed")
if self.TraceOn():
@@ -118,9 +118,9 @@ class ProcessAPITestCase(TestBase):
# Launch the process, and do not stop at the entry point.
error = lldb.SBError()
- self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+ process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
- thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+ thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
@@ -139,14 +139,14 @@ class ProcessAPITestCase(TestBase):
# But we want to use the WriteMemory() API to assign 'a' to the variable.
# Now use WriteMemory() API to write 'a' into the global variable.
- result = self.process.WriteMemory(location, 'a', error)
+ result = process.WriteMemory(location, 'a', error)
if not error.Success() or result != 1:
self.fail("SBProcess.WriteMemory() failed")
# Read from the memory location. This time it should be 'a'.
# Due to the typemap magic (see lldb.swig), we pass in 1 to ReadMemory and
# expect to get a Python string as the result object!
- content = self.process.ReadMemory(location, 1, error)
+ content = process.ReadMemory(location, 1, error)
if not error.Success():
self.fail("SBProcess.ReadMemory() failed")
if self.TraceOn():
@@ -169,9 +169,9 @@ class ProcessAPITestCase(TestBase):
# Launch the process, and do not stop at the entry point.
error = lldb.SBError()
- self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+ process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
- thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+ thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
@@ -192,7 +192,7 @@ class ProcessAPITestCase(TestBase):
byteSize = val.GetByteSize()
bytes = int_to_bytearray(256, byteSize)
- byteOrder = self.process.GetByteOrder()
+ byteOrder = process.GetByteOrder()
if byteOrder == lldb.eByteOrderBig:
bytes.reverse()
elif byteOrder == lldb.eByteOrderLittle:
@@ -207,7 +207,7 @@ class ProcessAPITestCase(TestBase):
# Now use WriteMemory() API to write 256 into the global variable.
new_value = str(bytes)
- result = self.process.WriteMemory(location, new_value, error)
+ result = process.WriteMemory(location, new_value, error)
if not error.Success() or result != byteSize:
self.fail("SBProcess.WriteMemory() failed")
@@ -225,7 +225,7 @@ class ProcessAPITestCase(TestBase):
startstr = '256')
# Now read the memory content. The bytearray should have (byte)1 as the second element.
- content = self.process.ReadMemory(location, byteSize, error)
+ content = process.ReadMemory(location, byteSize, error)
if not error.Success():
self.fail("SBProcess.ReadMemory() failed")
OpenPOWER on IntegriCloud