From 4ebd019b977b7d0bb5b9dc6fd10562e7a47c8de1 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Tue, 24 May 2011 18:22:45 +0000 Subject: 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 --- lldb/test/python_api/thread/TestThreadAPI.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lldb/test/python_api/thread/TestThreadAPI.py') diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py index 50bab95c787..aee34f04ea4 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -109,10 +109,10 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): 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) -- cgit v1.2.3