diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-05-24 18:22:45 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-05-24 18:22:45 +0000 |
| commit | 4ebd019b977b7d0bb5b9dc6fd10562e7a47c8de1 (patch) | |
| tree | 7c017fb66ee57a8982cf69b765ffa0a1232b034e /lldb/test/python_api/event | |
| parent | 97019c709db572b78e5e60a0c4eb13a03de8b709 (diff) | |
| download | bcm5719-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/event')
| -rw-r--r-- | lldb/test/python_api/event/TestEvents.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py index 74da057463c..7b21df16dd0 100644 --- a/lldb/test/python_api/event/TestEvents.py +++ b/lldb/test/python_api/event/TestEvents.py @@ -50,12 +50,12 @@ class EventAPITestCase(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 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 @@ class EventAPITestCase(TestBase): 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 @@ class EventAPITestCase(TestBase): # 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 @@ class EventAPITestCase(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 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 @@ class EventAPITestCase(TestBase): # 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") |

