[lldb] Convert assertTrue(a == b) to assertEqual(a, b)

Convert `assertTrue(a == b)` to `assertEqual(a, b)` to produce better failure messages.

These were mostly done via regex search & replace, with some manual fixes.

Differential Revision: https://reviews.llvm.org/D95813
This commit is contained in:
Dave Lee
2021-02-01 12:01:32 -08:00
parent ff1147c363
commit 619e2e095f
55 changed files with 206 additions and 205 deletions

View File

@@ -203,7 +203,7 @@ class ThreadAPITestCase(TestBase):
self.assertTrue(process, PROCESS_IS_VALID)
# Frame #0 should be on self.step_out_of_malloc.
self.assertTrue(process.GetState() == lldb.eStateStopped)
self.assertEqual(process.GetState(), lldb.eStateStopped)
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(
thread.IsValid(),
@@ -211,7 +211,7 @@ class ThreadAPITestCase(TestBase):
self.runCmd("thread backtrace")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
self.assertTrue(lineEntry.GetLine() == self.step_out_of_malloc)
self.assertEqual(lineEntry.GetLine(), self.step_out_of_malloc)
thread.StepOver()
thread.StepOver()
@@ -222,13 +222,13 @@ class ThreadAPITestCase(TestBase):
# main2.cpp.
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
self.assertTrue(thread.GetStopReason() == lldb.eStopReasonPlanComplete)
self.assertEqual(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
# Expected failure with clang as the compiler.
# rdar://problem/9223880
#
# Which has been fixed on the lldb by compensating for inaccurate line
# table information with r140416.
self.assertTrue(lineEntry.GetLine() == self.after_3_step_overs)
self.assertEqual(lineEntry.GetLine(), self.after_3_step_overs)
def run_to_address(self, exe_name):
"""Test Python SBThread.RunToAddress() API."""
@@ -249,7 +249,7 @@ class ThreadAPITestCase(TestBase):
self.assertTrue(process, PROCESS_IS_VALID)
# Frame #0 should be on self.step_out_of_malloc.
self.assertTrue(process.GetState() == lldb.eStateStopped)
self.assertEqual(process.GetState(), lldb.eStateStopped)
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(
thread.IsValid(),
@@ -257,7 +257,7 @@ class ThreadAPITestCase(TestBase):
self.runCmd("thread backtrace")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
self.assertTrue(lineEntry.GetLine() == self.step_out_of_malloc)
self.assertEqual(lineEntry.GetLine(), self.step_out_of_malloc)
# Get the start/end addresses for this line entry.
start_addr = lineEntry.GetStartAddress().GetLoadAddress(target)