From 5a0bee7c5f06333b68740fce3311b1a164ef93ea Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 15 Jun 2011 22:14:12 +0000 Subject: 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 --- lldb/test/python_api/thread/TestThreadAPI.py | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lldb/test/python_api/thread/TestThreadAPI.py') diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py index 103e1c14ce3..58e157f68e6 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -116,15 +116,15 @@ class ThreadAPITestCase(TestBase): self.runCmd("breakpoint list") # Launch the process, and do not stop at the entry point. - self.process = target.LaunchSimple(None, None, os.getcwd()) + process = target.LaunchSimple(None, None, os.getcwd()) - 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") self.runCmd("process status") proc_of_thread = thread.GetProcess() #print "proc_of_thread:", proc_of_thread - self.assertTrue(proc_of_thread.GetProcessID() == self.process.GetProcessID()) + self.assertTrue(proc_of_thread.GetProcessID() == process.GetProcessID()) def get_stop_description(self): """Test Python SBThread.GetStopDescription() API.""" @@ -138,9 +138,9 @@ class ThreadAPITestCase(TestBase): #self.runCmd("breakpoint list") # Launch the process, and do not stop at the entry point. - self.process = target.LaunchSimple(None, None, os.getcwd()) + process = target.LaunchSimple(None, None, os.getcwd()) - 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") #self.runCmd("process status") @@ -163,10 +163,10 @@ class ThreadAPITestCase(TestBase): self.runCmd("breakpoint list") # Launch the process, and do not stop at the entry point. - self.process = target.LaunchSimple(None, None, os.getcwd()) + process = target.LaunchSimple(None, None, os.getcwd()) while True: - 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") caller_symbol = get_caller_symbol(thread) #print "caller symbol of malloc:", caller_symbol @@ -176,7 +176,7 @@ class ThreadAPITestCase(TestBase): break #self.runCmd("thread backtrace") #self.runCmd("process status") - self.process.Continue() + process.Continue() thread.StepOut() self.runCmd("thread backtrace") @@ -196,13 +196,13 @@ class ThreadAPITestCase(TestBase): self.runCmd("breakpoint list") # Launch the process, and do not stop at the entry point. - self.process = target.LaunchSimple(None, None, os.getcwd()) + process = target.LaunchSimple(None, None, os.getcwd()) - self.assertTrue(self.process, PROCESS_IS_VALID) + self.assertTrue(process, PROCESS_IS_VALID) # Frame #0 should be on self.line2. - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint) + self.assertTrue(process.GetState() == lldb.eStateStopped) + thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) @@ -237,13 +237,13 @@ class ThreadAPITestCase(TestBase): self.runCmd("breakpoint list") # Launch the process, and do not stop at the entry point. - self.process = target.LaunchSimple(None, None, os.getcwd()) + process = target.LaunchSimple(None, None, os.getcwd()) - self.assertTrue(self.process, PROCESS_IS_VALID) + self.assertTrue(process, PROCESS_IS_VALID) # Frame #0 should be on self.line2. - self.assertTrue(self.process.GetState() == lldb.eStateStopped) - thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint) + self.assertTrue(process.GetState() == lldb.eStateStopped) + thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) -- cgit v1.2.3