[Lldb-commits] [lldb] r177416 - 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".

Greg Clayton gclayton at apple.com
Tue Mar 19 10:59:31 PDT 2013


Author: gclayton
Date: Tue Mar 19 12:59:30 2013
New Revision: 177416

URL: http://llvm.org/viewvc/llvm-project?rev=177416&view=rev
Log:
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. 


Modified:
    lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
    lldb/trunk/test/lang/cpp/stl/TestSTL.py
    lldb/trunk/test/lldbutil.py
    lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
    lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
    lldb/trunk/test/python_api/process/TestProcessAPI.py
    lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py
    lldb/trunk/test/python_api/target/TestTargetAPI.py
    lldb/trunk/test/python_api/thread/TestThreadAPI.py
    lldb/trunk/test/python_api/type/TestTypeList.py
    lldb/trunk/test/python_api/value/TestValueAPI.py
    lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py
    lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Tue Mar 19 12:59:30 2013
@@ -165,7 +165,7 @@ class BreakpointConditionsTestCase(TestB
         # Frame #0 should be on self.line1 and the break condition should hold.
         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 condition")
+        self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         var = frame0.FindValue('val', lldb.eValueTypeVariableArgument)
         self.assertTrue(frame0.GetLineEntry().GetLine() == self.line1 and

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Tue Mar 19 12:59:30 2013
@@ -134,7 +134,7 @@ class BreakpointIgnoreCountTestCase(Test
         #lldbutil.print_stacktraces(process)
         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)
         frame1 = thread.GetFrameAtIndex(1)
         frame2 = thread.GetFrameAtIndex(2)

Modified: lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py (original)
+++ lldb/trunk/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py Tue Mar 19 12:59:30 2013
@@ -58,7 +58,7 @@ class ExprDoesntDeadlockTestCase(TestBas
         # Frame #0 should be on self.line1 and the break condition should hold.
         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 condition")
+        self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
 
         frame0 = thread.GetFrameAtIndex(0)
 

Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestSTL.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/stl/TestSTL.py (original)
+++ lldb/trunk/test/lang/cpp/stl/TestSTL.py Tue Mar 19 12:59:30 2013
@@ -111,7 +111,7 @@ class STLTestCase(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 for variable 'associative_array'.

Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Tue Mar 19 12:59:30 2013
@@ -479,7 +479,7 @@ def get_stopped_thread(process, reason):
     ...
         from lldbutil import get_stopped_thread
         thread = get_stopped_thread(process, lldb.eStopReasonPlanComplete)
-        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")
     ...
 
     2. Get the thread stopped due to a breakpoint
@@ -487,7 +487,7 @@ def get_stopped_thread(process, reason):
     ...
         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")
     ...
 
     """

Modified: lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py Tue Mar 19 12:59:30 2013
@@ -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)

Modified: lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py Tue Mar 19 12:59:30 2013
@@ -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.

Modified: lldb/trunk/test/python_api/process/TestProcessAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/TestProcessAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Tue Mar 19 12:59:30 2013
@@ -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'.

Modified: lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py (original)
+++ lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py Tue Mar 19 12:59:30 2013
@@ -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)
 

Modified: lldb/trunk/test/python_api/target/TestTargetAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/target/TestTargetAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/target/TestTargetAPI.py (original)
+++ lldb/trunk/test/python_api/target/TestTargetAPI.py Tue Mar 19 12:59:30 2013
@@ -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()

Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/thread/TestThreadAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original)
+++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Tue Mar 19 12:59:30 2013
@@ -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()

Modified: lldb/trunk/test/python_api/type/TestTypeList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/type/TestTypeList.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/type/TestTypeList.py (original)
+++ lldb/trunk/test/python_api/type/TestTypeList.py Tue Mar 19 12:59:30 2013
@@ -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'.

Modified: lldb/trunk/test/python_api/value/TestValueAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/value/TestValueAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/value/TestValueAPI.py (original)
+++ lldb/trunk/test/python_api/value/TestValueAPI.py Tue Mar 19 12:59:30 2013
@@ -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'.

Modified: lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py (original)
+++ lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py Tue Mar 19 12:59:30 2013
@@ -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)

Modified: lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py?rev=177416&r1=177415&r2=177416&view=diff
==============================================================================
--- lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py (original)
+++ lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py Tue Mar 19 12:59:30 2013
@@ -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'.





More information about the lldb-commits mailing list