diff options
author | Greg Clayton <gclayton@apple.com> | 2013-03-19 17:59:30 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-03-19 17:59:30 +0000 |
commit | 53c5ddf0d7a9a37b6a73d078d42ecaeb8b76427f (patch) | |
tree | 9ec4eda39f1eb37caaa9735722e6ea7c25844db6 /lldb/test/python_api | |
parent | afcef33de7b9931a9e98f4b83274a7869728ecac (diff) | |
download | bcm5719-llvm-53c5ddf0d7a9a37b6a73d078d42ecaeb8b76427f.tar.gz bcm5719-llvm-53c5ddf0d7a9a37b6a73d078d42ecaeb8b76427f.zip |
Fixed incorrect python that was trying to validate that we got a valid lldb.SBThread object by checking to see if it is equal to "None".
This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes.
llvm-svn: 177416
Diffstat (limited to 'lldb/test/python_api')
10 files changed, 20 insertions, 20 deletions
diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py index ac7bd3fe7c8..11e68162ea8 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -61,7 +61,7 @@ class DisasmAPITestCase(TestBase): # Frame #0 should be on self.line1. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() self.assertTrue(lineEntry.GetLine() == self.line1) @@ -80,7 +80,7 @@ class DisasmAPITestCase(TestBase): process.Continue() self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() self.assertTrue(lineEntry.GetLine() == self.line2) diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py index 5242ff08b99..60d4ffb1d7c 100644 --- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py +++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py @@ -61,7 +61,7 @@ class SymbolAPITestCase(TestBase): # Frame #0 should be on self.line1. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) symbol_line1 = frame0.GetSymbol() # We should have a symbol type of code. @@ -74,7 +74,7 @@ class SymbolAPITestCase(TestBase): process.Continue() self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) symbol_line2 = frame0.GetSymbol() # We should have a symbol type of code. diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py index 4718b278619..1d8c9e16847 100644 --- a/lldb/test/python_api/process/TestProcessAPI.py +++ b/lldb/test/python_api/process/TestProcessAPI.py @@ -90,7 +90,7 @@ class ProcessAPITestCase(TestBase): process = target.LaunchSimple(None, None, os.getcwd()) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") frame = thread.GetFrameAtIndex(0) # Get the SBValue for the global variable 'my_char'. @@ -172,7 +172,7 @@ class ProcessAPITestCase(TestBase): process = target.LaunchSimple(None, None, os.getcwd()) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") frame = thread.GetFrameAtIndex(0) # Get the SBValue for the global variable 'my_char'. @@ -223,7 +223,7 @@ class ProcessAPITestCase(TestBase): process = target.LaunchSimple(None, None, os.getcwd()) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") frame = thread.GetFrameAtIndex(0) # Get the SBValue for the global variable 'my_int'. diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py index cb608d11d83..30d62acab45 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -55,7 +55,7 @@ class SymbolContextAPITestCase(TestBase): # Frame #0 should be on self.line. from lldbutil import get_stopped_thread thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") frame0 = thread.GetFrameAtIndex(0) self.assertTrue(frame0.GetLineEntry().GetLine() == self.line) diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py index 355e0f27e80..27dd3799709 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -262,7 +262,7 @@ class TargetAPITestCase(TestBase): # Frame #0 should be on self.line1. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") #self.runCmd("process status") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() @@ -274,7 +274,7 @@ class TargetAPITestCase(TestBase): process.Continue() self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") #self.runCmd("process status") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py index 85cb61581bb..83b5155814d 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -133,7 +133,7 @@ class ThreadAPITestCase(TestBase): process = target.LaunchSimple(None, None, os.getcwd()) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") self.runCmd("process status") proc_of_thread = thread.GetProcess() @@ -155,7 +155,7 @@ class ThreadAPITestCase(TestBase): process = target.LaunchSimple(None, None, os.getcwd()) thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") #self.runCmd("process status") # Due to the typemap magic (see lldb.swig), we pass in an (int)length to GetStopDescription @@ -181,7 +181,7 @@ class ThreadAPITestCase(TestBase): while True: thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint") caller_symbol = get_caller_symbol(thread) #print "caller symbol of malloc:", caller_symbol if not caller_symbol: @@ -217,7 +217,7 @@ class ThreadAPITestCase(TestBase): # Frame #0 should be on self.step_out_of_malloc. 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.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() @@ -258,7 +258,7 @@ class ThreadAPITestCase(TestBase): # Frame #0 should be on self.step_out_of_malloc. 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.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") self.runCmd("thread backtrace") frame0 = thread.GetFrameAtIndex(0) lineEntry = frame0.GetLineEntry() diff --git a/lldb/test/python_api/type/TestTypeList.py b/lldb/test/python_api/type/TestTypeList.py index d0e4dd6c449..a06259dc85d 100644 --- a/lldb/test/python_api/type/TestTypeList.py +++ b/lldb/test/python_api/type/TestTypeList.py @@ -59,7 +59,7 @@ class TypeAndTypeListTestCase(TestBase): # Get Frame #0. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) # Get the type 'Task'. diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py index 6659a2f926a..0d6d341bf0f 100644 --- a/lldb/test/python_api/value/TestValueAPI.py +++ b/lldb/test/python_api/value/TestValueAPI.py @@ -58,7 +58,7 @@ class ValueAPITestCase(TestBase): # Get Frame #0. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) # Get global variable 'days_of_week'. diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py index b84b3dc29e1..1578b582155 100644 --- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py +++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py @@ -68,7 +68,7 @@ class ChangeValueAPITestCase(TestBase): # Get Frame #0. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) self.assertTrue (frame0.IsValid(), "Got a valid frame.") @@ -128,7 +128,7 @@ class ChangeValueAPITestCase(TestBase): self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") expected_value = "Val - 12345 Mine - 55, 98765, 55555555. Ptr - 66, 98765, 66666666" stdout = process.GetSTDOUT(1000) diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py index d6da194f463..f022ec43e4d 100644 --- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py +++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py @@ -59,7 +59,7 @@ class ValueAsLinkedListTestCase(TestBase): # Get Frame #0. self.assertTrue(process.GetState() == lldb.eStateStopped) thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition") + self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) # Get variable 'task_head'. |