[Lldb-commits] [lldb] r294737 - Improve asserts in TestWatchpointIgnoreCount
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 10 03:49:25 PST 2017
Author: labath
Date: Fri Feb 10 05:49:25 2017
New Revision: 294737
URL: http://llvm.org/viewvc/llvm-project?rev=294737&view=rev
Log:
Improve asserts in TestWatchpointIgnoreCount
This test is flaky on the windows->android bot. Change assertTrue to
assertEqual in the hope better error messages will direct us to the
problem.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py?rev=294737&r1=294736&r2=294737&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py Fri Feb 10 05:49:25 2017
@@ -56,7 +56,7 @@ class WatchpointIgnoreCountTestCase(Test
# We should be stopped due to the breakpoint. Get frame #0.
process = target.GetProcess()
- self.assertTrue(process.GetState() == lldb.eStateStopped,
+ self.assertEqual(process.GetState(), lldb.eStateStopped,
PROCESS_STOPPED)
thread = lldbutil.get_stopped_thread(
process, lldb.eStopReasonBreakpoint)
@@ -75,12 +75,12 @@ class WatchpointIgnoreCountTestCase(Test
self.HideStdout()
# There should be only 1 watchpoint location under the target.
- self.assertTrue(target.GetNumWatchpoints() == 1)
+ self.assertEqual(target.GetNumWatchpoints(), 1)
watchpoint = target.GetWatchpointAtIndex(0)
self.assertTrue(watchpoint.IsEnabled())
- self.assertTrue(watchpoint.GetIgnoreCount() == 0)
+ self.assertEqual(watchpoint.GetIgnoreCount(), 0)
watch_id = watchpoint.GetID()
- self.assertTrue(watch_id != 0)
+ self.assertNotEqual(watch_id, 0)
print(watchpoint)
# Now immediately set the ignore count to 2. When we continue, expect the
@@ -90,12 +90,10 @@ class WatchpointIgnoreCountTestCase(Test
process.Continue()
# At this point, the inferior process should have exited.
- self.assertTrue(
- process.GetState() == lldb.eStateExited,
- PROCESS_EXITED)
+ self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED)
# Verify some vital statistics.
self.assertTrue(watchpoint)
- self.assertTrue(watchpoint.GetWatchSize() == 4)
- self.assertTrue(watchpoint.GetHitCount() == 2)
+ self.assertEqual(watchpoint.GetWatchSize(), 4)
+ self.assertEqual(watchpoint.GetHitCount(), 2)
print(watchpoint)
More information about the lldb-commits
mailing list