summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/function_symbol
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-05-24 18:22:45 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-05-24 18:22:45 +0000
commit4ebd019b977b7d0bb5b9dc6fd10562e7a47c8de1 (patch)
tree7c017fb66ee57a8982cf69b765ffa0a1232b034e /lldb/test/python_api/function_symbol
parent97019c709db572b78e5e60a0c4eb13a03de8b709 (diff)
downloadbcm5719-llvm-4ebd019b977b7d0bb5b9dc6fd10562e7a47c8de1.tar.gz
bcm5719-llvm-4ebd019b977b7d0bb5b9dc6fd10562e7a47c8de1.zip
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). llvm-svn: 131970
Diffstat (limited to 'lldb/test/python_api/function_symbol')
-rw-r--r--lldb/test/python_api/function_symbol/TestDisasmAPI.py12
-rw-r--r--lldb/test/python_api/function_symbol/TestSymbolAPI.py8
2 files changed, 10 insertions, 10 deletions
diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
index 662860564e1..1ac0d206650 100644
--- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
@@ -38,17 +38,17 @@ class DisasmAPITestCase(TestBase):
# 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 @@ class DisasmAPITestCase(TestBase):
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 @@ class DisasmAPITestCase(TestBase):
# 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 @@ class DisasmAPITestCase(TestBase):
# 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():
diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
index df3759d436c..913543781bf 100644
--- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
@@ -38,17 +38,17 @@ class SymbolAPITestCase(TestBase):
# 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 @@ class SymbolAPITestCase(TestBase):
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)
OpenPOWER on IntegriCloud