Skip to content

Commit 1351672

Browse files
committed
[lldb] s/assertTrue/assertEqual in TestStepTarget.py
this improves error messages.
1 parent 28e4942 commit 1351672

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lldb/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_to_start(self):
3232
break_in_main = target.BreakpointCreateBySourceRegex(
3333
'Break here to try targetted stepping', self.main_source_spec)
3434
self.assertTrue(break_in_main, VALID_BREAKPOINT)
35-
self.assertTrue(break_in_main.GetNumLocations() > 0, "Has locations.")
35+
self.assertGreater(break_in_main.GetNumLocations(), 0, "Has locations.")
3636

3737
# Now launch the process, and do not stop at entry point.
3838
process = target.LaunchSimple(
@@ -60,7 +60,7 @@ def test_with_end_line(self):
6060
thread.StepInto("lotsOfArgs", self.end_line, error)
6161
frame = thread.frames[0]
6262

63-
self.assertTrue(frame.name == "lotsOfArgs", "Stepped to lotsOfArgs.")
63+
self.assertEqual(frame.name, "lotsOfArgs", "Stepped to lotsOfArgs.")
6464

6565
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
6666
def test_with_end_line_bad_name(self):
@@ -71,8 +71,7 @@ def test_with_end_line_bad_name(self):
7171
error = lldb.SBError()
7272
thread.StepInto("lotsOfArgssss", self.end_line, error)
7373
frame = thread.frames[0]
74-
self.assertTrue(
75-
frame.line_entry.line == self.end_line,
74+
self.assertEqual(frame.line_entry.line, self.end_line,
7675
"Stepped to the block end.")
7776

7877
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
@@ -84,7 +83,7 @@ def test_with_end_line_deeper(self):
8483
error = lldb.SBError()
8584
thread.StepInto("modifyInt", self.end_line, error)
8685
frame = thread.frames[0]
87-
self.assertTrue(frame.name == "modifyInt", "Stepped to modifyInt.")
86+
self.assertEqual(frame.name, "modifyInt", "Stepped to modifyInt.")
8887

8988
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
9089
def test_with_command_and_block(self):
@@ -100,7 +99,7 @@ def test_with_command_and_block(self):
10099
"thread step-in command succeeded.")
101100

102101
frame = thread.frames[0]
103-
self.assertTrue(frame.name == "lotsOfArgs", "Stepped to lotsOfArgs.")
102+
self.assertEqual(frame.name, "lotsOfArgs", "Stepped to lotsOfArgs.")
104103

105104
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
106105
def test_with_command_and_block_and_bad_name(self):
@@ -117,9 +116,8 @@ def test_with_command_and_block_and_bad_name(self):
117116

118117
frame = thread.frames[0]
119118

120-
self.assertTrue(frame.name == "main", "Stepped back out to main.")
119+
self.assertEqual(frame.name, "main", "Stepped back out to main.")
121120
# end_line is set to the line after the containing block. Check that
122121
# we got there:
123-
self.assertTrue(
124-
frame.line_entry.line == self.end_line,
122+
self.assertEqual(frame.line_entry.line, self.end_line,
125123
"Got out of the block")

0 commit comments

Comments
 (0)