[Lldb-commits] [lldb] r131970 - in /lldb/trunk/test: array_types/ bitfields/ breakpoint_conditions/ breakpoint_ignore_count/ class_static/ class_types/ conditional_break/ cpp/dynamic-value/ expression_command/test/ foundation/ hello_world/ inferior-crashing/ macosx/universal/ objc-dynamic-value/ objc-stepping/ python_api/event/ python_api/frame/ python_api/function_symbol/ python_api/interpreter/ python_api/process/ python_api/symbol-context/ python_api/target/ python_api/thread/ source-manager/

Johnny Chen johnny.chen at apple.com
Tue May 24 11:22:45 PDT 2011


Author: johnny
Date: Tue May 24 13:22:45 2011
New Revision: 131970

URL: http://llvm.org/viewvc/llvm-project?rev=131970&view=rev
Log:
Now that we have added a post-processing step for adding truth value testing to
those lldb objects which implement the IsValid() method, let's change the rest of
the test suite to use the more compact truth value testing pattern (the Python way).

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/bitfields/TestBitfields.py
    lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/trunk/test/class_static/TestStaticVariables.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/class_types/TestClassTypesDisassembly.py
    lldb/trunk/test/conditional_break/TestConditionalBreak.py
    lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/foundation/TestObjCMethods.py
    lldb/trunk/test/foundation/TestSymbolTable.py
    lldb/trunk/test/hello_world/TestHelloWorld.py
    lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/test/macosx/universal/TestUniversal.py
    lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py
    lldb/trunk/test/objc-stepping/TestObjCStepping.py
    lldb/trunk/test/python_api/event/TestEvents.py
    lldb/trunk/test/python_api/frame/TestFrames.py
    lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
    lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
    lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.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/source-manager/TestSourceManager.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Tue May 24 13:22:45 2011
@@ -95,10 +95,10 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.c", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Sanity check the print representation of breakpoint.
         bp = repr(breakpoint)
@@ -113,7 +113,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Sanity check the print representation of process.
         proc = repr(self.process)

Modified: lldb/trunk/test/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bitfields/TestBitfields.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/bitfields/TestBitfields.py Tue May 24 13:22:45 2011
@@ -89,13 +89,13 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.c", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         self.process = target.LaunchSimple(None, None, os.getcwd())
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         thread = target.GetProcess().GetThreadAtIndex(0)

Modified: lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py Tue May 24 13:22:45 2011
@@ -104,12 +104,12 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
         #print "breakpoint:", breakpoint
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -129,7 +129,7 @@
         # Get the breakpoint location from breakpoint after we verified that,
         # indeed, it has one location.
         location = breakpoint.GetLocationAtIndex(0)
-        self.assertTrue(location.IsValid() and
+        self.assertTrue(location and
                         location.IsEnabled(),
                         VALID_BREAKPOINT_LOCATION)
 
@@ -142,7 +142,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1 and the break condition should hold.
         from lldbutil import get_stopped_thread

Modified: lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Tue May 24 13:22:45 2011
@@ -80,18 +80,18 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
         # Get the breakpoint location from breakpoint after we verified that,
         # indeed, it has one location.
         location = breakpoint.GetLocationAtIndex(0)
-        self.assertTrue(location.IsValid() and
+        self.assertTrue(location and
                         location.IsEnabled(),
                         VALID_BREAKPOINT_LOCATION)
 
@@ -104,7 +104,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame#0 should be on main.c:37, frame#1 should be on main.c:25, and
         # frame#2 should be on main.c:48.

Modified: lldb/trunk/test/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_static/TestStaticVariables.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/class_static/TestStaticVariables.py Tue May 24 13:22:45 2011
@@ -74,16 +74,16 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Tue May 24 13:22:45 2011
@@ -97,10 +97,10 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         filespec = target.GetExecutable()
-        self.assertTrue(filespec.IsValid(), VALID_FILESPEC)
+        self.assertTrue(filespec, VALID_FILESPEC)
 
         fsDir = filespec.GetDirectory()
         fsFile = filespec.GetFilename()
@@ -111,7 +111,7 @@
         bpfilespec = lldb.SBFileSpec("main.cpp", False)
 
         breakpoint = target.BreakpointCreateByLocation(bpfilespec, self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Verify the breakpoint just created.
         self.expect(repr(breakpoint), BREAKPOINT_CREATED, exe=False,
@@ -123,7 +123,7 @@
         self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
         #self.breakAfterLaunch(self.process, "C::C(int, int, int)")
 
-        if not error.Success() or not self.process.IsValid():
+        if not error.Success() or not self.process:
             self.fail("SBTarget.Launch() failed")
 
         if self.process.GetState() != lldb.eStateStopped:

Modified: lldb/trunk/test/class_types/TestClassTypesDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypesDisassembly.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/class_types/TestClassTypesDisassembly.py Tue May 24 13:22:45 2011
@@ -100,7 +100,7 @@
             if self.TraceOn():
                 print
                 print function
-            if function.IsValid():
+            if function:
                 # Get all instructions for this function and print them out.
                 insts = function.GetInstructions(target)
                 for inst in insts:

Modified: lldb/trunk/test/conditional_break/TestConditionalBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/conditional_break/TestConditionalBreak.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/conditional_break/TestConditionalBreak.py (original)
+++ lldb/trunk/test/conditional_break/TestConditionalBreak.py Tue May 24 13:22:45 2011
@@ -46,16 +46,16 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByName("c", exe)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
         error = lldb.SBError()
         self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        self.assertTrue(error.Success() and self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(error.Success() and self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped,

Modified: lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py (original)
+++ lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py Tue May 24 13:22:45 2011
@@ -41,12 +41,12 @@
 
         # Get "this" as its static value
         
-        self.assertTrue (this_static.IsValid())
+        self.assertTrue (this_static)
         this_static_loc = int (this_static.GetValue(), 16)
         
         # Get "this" as its dynamic value
         
-        self.assertTrue (this_dynamic.IsValid())
+        self.assertTrue (this_dynamic)
         this_dynamic_typename = this_dynamic.GetTypeName()
         self.assertTrue (this_dynamic_typename.find('B') != -1)
         this_dynamic_loc = int (this_dynamic.GetValue(), 16)
@@ -65,7 +65,7 @@
         no_dynamic  = lldb.eNoDynamicValues
 
         this_dynamic_m_b_value = this_dynamic.GetChildMemberWithName('m_b_value', use_dynamic)
-        self.assertTrue (this_dynamic_m_b_value.IsValid())
+        self.assertTrue (this_dynamic_m_b_value)
         
         m_b_value = int (this_dynamic_m_b_value.GetValue(), 0)
         self.assertTrue (m_b_value == 10)
@@ -73,17 +73,17 @@
         # Make sure it is not in the static version
 
         this_static_m_b_value = this_static.GetChildMemberWithName('m_b_value', no_dynamic)
-        self.assertTrue (this_static_m_b_value.IsValid() == False)
+        self.assertFalse (this_static_m_b_value)
 
         # Okay, now let's make sure that we can get the dynamic type of a child element:
 
         contained_auto_ptr = this_dynamic.GetChildMemberWithName ('m_client_A', use_dynamic)
-        self.assertTrue (contained_auto_ptr.IsValid())
+        self.assertTrue (contained_auto_ptr)
         contained_b = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', use_dynamic)
-        self.assertTrue (contained_b.IsValid())
+        self.assertTrue (contained_b)
         
         contained_b_static = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', no_dynamic)
-        self.assertTrue (contained_b_static.IsValid())
+        self.assertTrue (contained_b_static)
         
         contained_b_addr = int (contained_b.GetValue(), 16)
         contained_b_static_addr = int (contained_b_static.GetValue(), 16)
@@ -97,20 +97,20 @@
         # Create a target from the debugger.
 
         target = self.dbg.CreateTarget (exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Set up our breakpoints:
 
         do_something_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.do_something_line)
-        self.assertTrue(do_something_bpt.IsValid(),
+        self.assertTrue(do_something_bpt,
                         VALID_BREAKPOINT)
 
         first_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_first_call_line)
-        self.assertTrue(first_call_bpt.IsValid(),
+        self.assertTrue(first_call_bpt,
                         VALID_BREAKPOINT)
 
         second_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_second_call_line)
-        self.assertTrue(second_call_bpt.IsValid(),
+        self.assertTrue(second_call_bpt,
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at the entry point.
@@ -132,11 +132,11 @@
         no_dynamic  = lldb.eNoDynamicValues
 
         myB = frame.FindVariable ('myB', no_dynamic);
-        self.assertTrue (myB.IsValid())
+        self.assertTrue (myB)
         myB_loc = int (myB.GetLocation(), 16)
 
         otherB = frame.FindVariable('otherB', no_dynamic)
-        self.assertTrue (otherB.IsValid())
+        self.assertTrue (otherB)
         otherB_loc = int (otherB.GetLocation(), 16)
 
         # Okay now run to doSomething:
@@ -173,11 +173,11 @@
         # Now make sure we also get it right for a reference as well:
 
         anotherA_static = frame.FindVariable ('anotherA', False)
-        self.assertTrue (anotherA_static.IsValid())
+        self.assertTrue (anotherA_static)
         anotherA_static_addr = int (anotherA_static.GetValue(), 16)
 
         anotherA_dynamic = frame.FindVariable ('anotherA', True)
-        self.assertTrue (anotherA_dynamic.IsValid())
+        self.assertTrue (anotherA_dynamic)
         anotherA_dynamic_addr = int (anotherA_dynamic.GetValue(), 16)
         anotherA_dynamic_typename = anotherA_dynamic.GetTypeName()
         self.assertTrue (anotherA_dynamic_typename.find('B') != -1)
@@ -185,12 +185,12 @@
         self.assertTrue(anotherA_dynamic_addr < anotherA_static_addr)
 
         anotherA_m_b_value_dynamic = anotherA_dynamic.GetChildMemberWithName('m_b_value', True)
-        self.assertTrue (anotherA_m_b_value_dynamic.IsValid())
+        self.assertTrue (anotherA_m_b_value_dynamic)
         anotherA_m_b_val = int (anotherA_m_b_value_dynamic.GetValue(), 10)
         self.assertTrue (anotherA_m_b_val == 300)
 
         anotherA_m_b_value_static = anotherA_static.GetChildMemberWithName('m_b_value', True)
-        self.assertTrue (anotherA_m_b_value_static.IsValid() == False)
+        self.assertFalse (anotherA_m_b_value_static)
 
         # Okay, now continue again, and when we hit the second breakpoint in main
 
@@ -200,7 +200,7 @@
 
         frame = thread.GetFrameAtIndex(0)
         reallyA_value = frame.FindVariable ('reallyA', False)
-        self.assertTrue(reallyA_value.IsValid())
+        self.assertTrue(reallyA_value)
         reallyA_loc = int (reallyA_value.GetLocation(), 16)
         
         # Finally continue to doSomething again, and make sure we get the right value for anotherA,
@@ -212,7 +212,7 @@
 
         frame = thread.GetFrameAtIndex(0)
         anotherA_value = frame.FindVariable ('anotherA', True)
-        self.assertTrue(anotherA_value.IsValid())
+        self.assertTrue(anotherA_value)
         anotherA_loc = int (anotherA_value.GetValue(), 16)
         self.assertTrue (anotherA_loc == reallyA_loc)
         self.assertTrue (anotherA_value.GetTypeName().find ('B') == -1)

Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Tue May 24 13:22:45 2011
@@ -86,12 +86,12 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Create the breakpoint.
         filespec = lldb.SBFileSpec("main.cpp", False)
         breakpoint = target.BreakpointCreateByLocation(filespec, self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Verify the breakpoint just created.
         self.expect(repr(breakpoint), BREAKPOINT_CREATED, exe=False,
@@ -103,7 +103,7 @@
         error = lldb.SBError()
         self.process = target.Launch(self.dbg.GetListener(), ['X', 'Y', 'Z'], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        if not error.Success() or not self.process.IsValid():
+        if not error.Success() or not self.process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         if self.process.GetState() != lldb.eStateStopped:

Modified: lldb/trunk/test/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/foundation/TestObjCMethods.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/foundation/TestObjCMethods.py Tue May 24 13:22:45 2011
@@ -206,16 +206,16 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         break1 = target.BreakpointCreateByLocation(self.main_source, self.line)
-        self.assertTrue(break1.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break1, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
         error = lldb.SBError()
         self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
@@ -232,15 +232,15 @@
         self.assertTrue (line_number == self.line, "Hit the first breakpoint.")
 
         my_var = cur_frame.FindVariable("my")
-        self.assertTrue(my_var.IsValid(), "Made a variable object for my")
+        self.assertTrue(my_var, "Made a variable object for my")
 
         str_var = cur_frame.FindVariable("str")
-        self.assertTrue(str_var.IsValid(), "Made a variable object for str")
+        self.assertTrue(str_var, "Made a variable object for str")
 
         # Now make sure that the my->str == str:
 
         my_str_var = my_var.GetChildMemberWithName("str")
-        self.assertTrue(my_str_var.IsValid(), "Found a str ivar in my")
+        self.assertTrue(my_str_var, "Found a str ivar in my")
 
         str_value = int(str_var.GetValue(cur_frame), 0)
 

Modified: lldb/trunk/test/foundation/TestSymbolTable.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/foundation/TestSymbolTable.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/foundation/TestSymbolTable.py (original)
+++ lldb/trunk/test/foundation/TestSymbolTable.py Tue May 24 13:22:45 2011
@@ -42,7 +42,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Launch the process, and do not stop at the entry point.
         process = target.LaunchSimple(None, None, os.getcwd())
@@ -55,13 +55,13 @@
         filespec = lldb.SBFileSpec(exe, False)
 
         module = target.FindModule(filespec)
-        self.assertTrue(module.IsValid(), VALID_MODULE)
+        self.assertTrue(module, VALID_MODULE)
 
         # Create the set of known symbols.  As we iterate through the symbol
         # table, remove the symbol from the set if it is a known symbol.
         expected_symbols = set(self.symbols_list)
         for symbol in module:
-            self.assertTrue(symbol.IsValid(), VALID_SYMBOL)
+            self.assertTrue(symbol, VALID_SYMBOL)
             #print "symbol:", symbol
             name = symbol.GetName()
             if name in expected_symbols:

Modified: lldb/trunk/test/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/hello_world/TestHelloWorld.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/hello_world/TestHelloWorld.py Tue May 24 13:22:45 2011
@@ -67,7 +67,7 @@
         #self.runCmd("thread list")
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         thread = self.process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:

Modified: lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py Tue May 24 13:22:45 2011
@@ -54,7 +54,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now launch the process, and do not stop at entry point.
         # Both argv and envp are null.

Modified: lldb/trunk/test/macosx/universal/TestUniversal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/macosx/universal/TestUniversal.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/macosx/universal/TestUniversal.py (original)
+++ lldb/trunk/test/macosx/universal/TestUniversal.py Tue May 24 13:22:45 2011
@@ -45,7 +45,7 @@
         # Check whether we have a 64-bit process launched.
         target = self.dbg.GetSelectedTarget()
         process = target.GetProcess()
-        self.assertTrue(target.IsValid() and process.IsValid() and
+        self.assertTrue(target and process and
                         self.invoke(process, 'GetAddressByteSize') == 8,
                         "64-bit process launched")
 
@@ -73,7 +73,7 @@
         # Check whether we have a 32-bit process launched.
         target = self.dbg.GetSelectedTarget()
         process = target.GetProcess()
-        self.assertTrue(target.IsValid() and process.IsValid(),
+        self.assertTrue(target and process,
                         "32-bit process launched")
 
         pointerSize = self.invoke(process, 'GetAddressByteSize')

Modified: lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py (original)
+++ lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py Tue May 24 13:22:45 2011
@@ -39,10 +39,10 @@
                                                        '// Break here to see if we can step into real method.')
 
     def examine_SourceDerived_ptr (self, object):
-        self.assertTrue (object.IsValid())
+        self.assertTrue (object)
         self.assertTrue (object.GetTypeName().find ('SourceDerived') != -1)
         derivedValue = object.GetChildMemberWithName ('_derivedValue')
-        self.assertTrue (derivedValue.IsValid())
+        self.assertTrue (derivedValue)
         self.assertTrue (int (derivedValue.GetValue(), 0) == 30)
 
     def do_get_dynamic_vals(self):
@@ -52,17 +52,17 @@
         # Create a target from the debugger.
 
         target = self.dbg.CreateTarget (exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Set up our breakpoints:
 
         handle_SourceBase_bkpt = target.BreakpointCreateByLocation(self.source_name, self.handle_SourceBase)
-        self.assertTrue(handle_SourceBase_bkpt.IsValid() and
+        self.assertTrue(handle_SourceBase_bkpt and
                         handle_SourceBase_bkpt.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
         main_before_setProperty_bkpt = target.BreakpointCreateByLocation(self.source_name, self.main_before_setProperty_line)
-        self.assertTrue(main_before_setProperty_bkpt.IsValid() and
+        self.assertTrue(main_before_setProperty_bkpt and
                         main_before_setProperty_bkpt.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -82,7 +82,7 @@
 
         frame = thread.GetFrameAtIndex(0)
         myObserver = frame.FindVariable('myObserver', lldb.eDynamicCanRunTarget)
-        self.assertTrue (myObserver.IsValid())
+        self.assertTrue (myObserver)
         myObserver_source = myObserver.GetChildMemberWithName ('_source', lldb.eDynamicCanRunTarget)
         self.examine_SourceDerived_ptr (myObserver_source)
 

Modified: lldb/trunk/test/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-stepping/TestObjCStepping.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/objc-stepping/TestObjCStepping.py (original)
+++ lldb/trunk/test/objc-stepping/TestObjCStepping.py Tue May 24 13:22:45 2011
@@ -43,30 +43,30 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         break1 = target.BreakpointCreateByLocation(self.main_source, self.line1)
-        self.assertTrue(break1.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break1, VALID_BREAKPOINT)
 
         break2 = target.BreakpointCreateByLocation(self.main_source, self.line2)
-        self.assertTrue(break2.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break2, VALID_BREAKPOINT)
 
         break3 = target.BreakpointCreateByLocation(self.main_source, self.line3)
-        self.assertTrue(break3.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break3, VALID_BREAKPOINT)
 
         break4 = target.BreakpointCreateByLocation(self.main_source, self.line4)
-        self.assertTrue(break4.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break4, VALID_BREAKPOINT)
 
         break5 = target.BreakpointCreateByLocation(self.main_source, self.line5)
-        self.assertTrue(break5.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break5, VALID_BREAKPOINT)
 
         break_returnStruct_call_super = target.BreakpointCreateByLocation(self.main_source, self.source_returnsStruct_call_line)
-        self.assertTrue(break_returnStruct_call_super.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(break_returnStruct_call_super, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
         self.process = target.LaunchSimple (None, None, os.getcwd())
 
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         thread = self.process.GetThreadAtIndex(0)
@@ -81,9 +81,9 @@
         self.assertTrue (line_number == self.line1, "Hit the first breakpoint.")
 
         mySource = thread.GetFrameAtIndex(0).FindVariable("mySource")
-        self.assertTrue(mySource.IsValid(), "Found mySource local variable.")
+        self.assertTrue(mySource, "Found mySource local variable.")
         mySource_isa = mySource.GetChildMemberWithName ("isa")
-        self.assertTrue(mySource_isa.IsValid(), "Found mySource->isa local variable.")
+        self.assertTrue(mySource_isa, "Found mySource->isa local variable.")
         mySource_isa.GetValue (thread.GetFrameAtIndex(0))
 
         # Lets delete mySource so we can check that after stepping a child variable

Modified: lldb/trunk/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/event/TestEvents.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/test/python_api/event/TestEvents.py Tue May 24 13:22:45 2011
@@ -50,12 +50,12 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
         #print "breakpoint:", breakpoint
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -67,15 +67,15 @@
         self.process = target.Launch (listener, None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Get a handle on the process's broadcaster.
         broadcaster = self.process.GetBroadcaster()
-        self.assertTrue(broadcaster.IsValid(), "Process with valid broadcaster")
+        self.assertTrue(broadcaster, "Process with valid broadcaster")
 
         # Create an empty event object.
         event = lldb.SBEvent()
-        self.assertFalse(event.IsValid(), "Event should not be valid initially")
+        self.assertFalse(event, "Event should not be valid initially")
 
         # Create MyListeningThread to wait for any kind of event.
         import threading
@@ -103,7 +103,7 @@
         # Wait until the 'MyListeningThread' terminates.
         my_thread.join()
 
-        self.assertTrue(event.IsValid(),
+        self.assertTrue(event,
                         "My listening thread successfully received an event")
 
     def do_add_listener_to_broadcaster(self):
@@ -112,12 +112,12 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
         #print "breakpoint:", breakpoint
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -130,11 +130,11 @@
 
         # Get a handle on the process's broadcaster.
         broadcaster = self.process.GetBroadcaster()
-        self.assertTrue(broadcaster.IsValid(), "Process with valid broadcaster")
+        self.assertTrue(broadcaster, "Process with valid broadcaster")
 
         # Create an empty event object.
         event = lldb.SBEvent()
-        self.assertFalse(event.IsValid(), "Event should not be valid initially")
+        self.assertFalse(event, "Event should not be valid initially")
 
         # Create a listener object and register with the broadcaster.
         listener = lldb.SBListener("TestEvents.listener")

Modified: lldb/trunk/test/python_api/frame/TestFrames.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/frame/TestFrames.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/frame/TestFrames.py (original)
+++ lldb/trunk/test/python_api/frame/TestFrames.py Tue May 24 13:22:45 2011
@@ -31,12 +31,12 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
         #print "breakpoint:", breakpoint
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -87,10 +87,10 @@
                 # but they should be valid.  Uses get_GPRs() from the lldbutil module.
                 gpr_reg_set = lldbutil.get_GPRs(frame)
                 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
-                self.assertTrue (pc_value.IsValid(), "We should have a valid PC.")
+                self.assertTrue (pc_value, "We should have a valid PC.")
                 self.assertTrue (int(pc_value.GetValue(frame), 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
                 sp_value = gpr_reg_set.GetChildMemberWithName("sp")
-                self.assertTrue (sp_value.IsValid(), "We should have a valid Stack Pointer.")
+                self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
                 self.assertTrue (int(sp_value.GetValue(frame), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
 
             print >> session, "---"

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py Tue May 24 13:22:45 2011
@@ -38,17 +38,17 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
         #print "breakpoint1:", breakpoint1
         #print "breakpoint2:", breakpoint2
-        self.assertTrue(breakpoint1.IsValid() and
+        self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
-        self.assertTrue(breakpoint2.IsValid() and
+        self.assertTrue(breakpoint2 and
                         breakpoint2.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -56,7 +56,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped)
@@ -72,7 +72,7 @@
         # Now call SBTarget.ResolveSymbolContextForAddress() with address1.
         context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything)
 
-        self.assertTrue(context1.IsValid())
+        self.assertTrue(context1)
         if self.TraceOn():
             print "context1:", context1
 
@@ -88,7 +88,7 @@
         # Verify that the symbol and the function has the same address range per function 'a'.
         symbol = context1.GetSymbol()
         function = frame0.GetFunction()
-        self.assertTrue(symbol.IsValid() and function.IsValid())
+        self.assertTrue(symbol and function)
 
         disasm_output = lldbutil.disassemble(target, symbol)
         if self.TraceOn():

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py Tue May 24 13:22:45 2011
@@ -38,17 +38,17 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
         #print "breakpoint1:", breakpoint1
         #print "breakpoint2:", breakpoint2
-        self.assertTrue(breakpoint1.IsValid() and
+        self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
-        self.assertTrue(breakpoint2.IsValid() and
+        self.assertTrue(breakpoint2 and
                         breakpoint2.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -56,7 +56,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped)

Modified: lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py (original)
+++ lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py Tue May 24 13:22:45 2011
@@ -35,11 +35,11 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Retrieve the associated command interpreter from our debugger.
         ci = self.dbg.GetCommandInterpreter()
-        self.assertTrue(ci.IsValid(), VALID_COMMAND_INTERPRETER)
+        self.assertTrue(ci, VALID_COMMAND_INTERPRETER)
 
         # Exercise some APIs....
 
@@ -61,7 +61,7 @@
 
         # Assigning to self.process so it gets cleaned up during test tear down.
         self.process = ci.GetProcess()
-        self.assertTrue(self.process.IsValid())
+        self.assertTrue(self.process)
 
         import lldbutil
         if self.process.GetState() != lldb.eStateStopped:

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Tue May 24 13:22:45 2011
@@ -69,10 +69,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
@@ -111,10 +111,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
@@ -162,10 +162,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
@@ -251,7 +251,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py (original)
+++ lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py Tue May 24 13:22:45 2011
@@ -37,12 +37,12 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create a breakpoint on main.c by name 'c'.
         breakpoint = target.BreakpointCreateByName('c', 'a.out')
         #print "breakpoint:", breakpoint
-        self.assertTrue(breakpoint.IsValid() and
+        self.assertTrue(breakpoint and
                         breakpoint.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -50,7 +50,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line.
         from lldbutil import get_stopped_thread
@@ -61,7 +61,7 @@
 
         # Now get the SBSymbolContext from this frame.  We want everything. :-)
         context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
-        self.assertTrue(context.IsValid())
+        self.assertTrue(context)
 
         # Get the description of this module.
         module = context.GetModule()
@@ -74,11 +74,11 @@
             substrs = [os.path.join(self.mydir, 'main.c')])
 
         function = context.GetFunction()
-        self.assertTrue(function.IsValid())
+        self.assertTrue(function)
         #print "function:", function
 
         block = context.GetBlock()
-        self.assertTrue(block.IsValid())
+        self.assertTrue(block)
         #print "block:", block
 
         lineEntry = context.GetLineEntry()

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/target/TestTargetAPI.py (original)
+++ lldb/trunk/test/python_api/target/TestTargetAPI.py Tue May 24 13:22:45 2011
@@ -64,7 +64,7 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         from lldbutil import get_description
 
@@ -91,7 +91,7 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Add an extra twist of stopping the inferior in a breakpoint, and then continue till it's done.
         # We should still see the entire stdout redirected once the process is finished.
@@ -131,17 +131,17 @@
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Now create the two breakpoints inside function 'a'.
         breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1)
         breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2)
         #print "breakpoint1:", breakpoint1
         #print "breakpoint2:", breakpoint2
-        self.assertTrue(breakpoint1.IsValid() and
+        self.assertTrue(breakpoint1 and
                         breakpoint1.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
-        self.assertTrue(breakpoint2.IsValid() and
+        self.assertTrue(breakpoint2 and
                         breakpoint2.GetNumLocations() == 1,
                         VALID_BREAKPOINT)
 
@@ -149,7 +149,7 @@
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped)
@@ -181,14 +181,14 @@
         context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything)
         context2 = target.ResolveSymbolContextForAddress(address2, lldb.eSymbolContextEverything)
 
-        self.assertTrue(context1.IsValid() and context2.IsValid())
+        self.assertTrue(context1 and context2)
         #print "context1:", context1
         #print "context2:", context2
 
         # Verify that the context point to the same function 'a'.
         symbol1 = context1.GetSymbol()
         symbol2 = context2.GetSymbol()
-        self.assertTrue(symbol1.IsValid() and symbol2.IsValid())
+        self.assertTrue(symbol1 and symbol2)
         #print "symbol1:", symbol1
         #print "symbol2:", symbol2
 

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=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original)
+++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Tue May 24 13:22:45 2011
@@ -109,10 +109,10 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
@@ -131,10 +131,10 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
         #self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
@@ -156,10 +156,10 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByName('malloc')
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
@@ -189,16 +189,16 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.line2)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line2.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped)
@@ -230,16 +230,16 @@
         exe = os.path.join(os.getcwd(), "a.out")
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         breakpoint = target.BreakpointCreateByLocation('main2.cpp', self.line2)
-        self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
+        self.assertTrue(breakpoint, VALID_BREAKPOINT)
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
         self.process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
+        self.assertTrue(self.process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line2.
         self.assertTrue(self.process.GetState() == lldb.eStateStopped)

Modified: lldb/trunk/test/source-manager/TestSourceManager.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/source-manager/TestSourceManager.py?rev=131970&r1=131969&r2=131970&view=diff
==============================================================================
--- lldb/trunk/test/source-manager/TestSourceManager.py (original)
+++ lldb/trunk/test/source-manager/TestSourceManager.py Tue May 24 13:22:45 2011
@@ -40,7 +40,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
-        self.assertTrue(target.IsValid(), VALID_TARGET)
+        self.assertTrue(target, VALID_TARGET)
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()





More information about the lldb-commits mailing list