diff options
author | Pavel Labath <pavel@labath.sk> | 2019-04-05 07:56:26 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-04-05 07:56:26 +0000 |
commit | 546bccf61c620893c0f94c84adf542b0bbad24bb (patch) | |
tree | 0ea72ed9d733346c7e75cff2b01cbbd7d1960bdb /lldb/packages/Python/lldbsuite/test/tools | |
parent | 0376ac1d946466eb346c2055554153e11b0fc3cf (diff) | |
download | bcm5719-llvm-546bccf61c620893c0f94c84adf542b0bbad24bb.tar.gz bcm5719-llvm-546bccf61c620893c0f94c84adf542b0bbad24bb.zip |
TestVCCode_step: replace assertTrue with more specific assertions
When this test fails (flakes) all we get is an error message like "False
is not True". This replaces patterns like assertTrue(a == b) with
assertEqual(a, b), so we get a better error message (and hopefully a
hint as to why the test is flaky).
llvm-svn: 357747
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py index 87ec71a513f..b671d956acf 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py @@ -32,7 +32,7 @@ class TestVSCode_step(lldbvscode_testcase.VSCodeTestCaseBase): lines = [breakpoint1_line] # Set breakoint in the thread function so we can step the threads breakpoint_ids = self.set_source_breakpoints(source, lines) - self.assertTrue(len(breakpoint_ids) == len(lines), + self.assertEqual(len(breakpoint_ids), len(lines), "expect correct number of breakpoints") self.continue_to_breakpoints(breakpoint_ids) threads = self.vscode.get_threads() @@ -56,24 +56,24 @@ class TestVSCode_step(lldbvscode_testcase.VSCodeTestCaseBase): self.stepIn(threadId=tid, waitForStop=True) x2 = self.get_local_as_int('x', threadId=tid) (src2, line2) = self.get_source_and_line(threadId=tid) - self.assertTrue(x1 == x2 + 1, 'verify step in variable') - self.assertTrue(line2 < line1, 'verify step in line') - self.assertTrue(src1 == src2, 'verify step in source') + self.assertEqual(x1, x2 + 1, 'verify step in variable') + self.assertLess(line2, line1, 'verify step in line') + self.assertEqual(src1, src2, 'verify step in source') # Now step out and verify self.stepOut(threadId=tid, waitForStop=True) x3 = self.get_local_as_int('x', threadId=tid) (src3, line3) = self.get_source_and_line(threadId=tid) - self.assertTrue(x1 == x3, 'verify step out variable') - self.assertTrue(line3 >= line1, 'verify step out line') - self.assertTrue(src1 == src3, 'verify step in source') + self.assertEqual(x1, x3, 'verify step out variable') + self.assertGreaterEqual(line3, line1, 'verify step out line') + self.assertEqual(src1, src3, 'verify step in source') # Step over and verify self.stepOver(threadId=tid, waitForStop=True) x4 = self.get_local_as_int('x', threadId=tid) (src4, line4) = self.get_source_and_line(threadId=tid) - self.assertTrue(x4 == x3, 'verify step over variable') - self.assertTrue(line4 > line3, 'verify step over line') - self.assertTrue(src1 == src4, 'verify step over source') + self.assertEqual(x4, x3, 'verify step over variable') + self.assertGreater(line4, line3, 'verify step over line') + self.assertEqual(src1, src4, 'verify step over source') # only step one thread that is at the breakpoint and stop break |