[lldb] Convert more assertTrue to assertEqual (NFC)

Follow up to D95813, this converts multiline assertTrue to assertEqual.

Differential Revision: https://reviews.llvm.org/D95899
This commit is contained in:
Dave Lee
2021-02-02 14:46:37 -08:00
parent 9511fa2dda
commit 0ed758b260
76 changed files with 414 additions and 416 deletions

View File

@@ -128,8 +128,8 @@ class SBFormattersAPITestCase(TestBase):
filter = lldb.SBTypeFilter(0)
filter.AppendExpressionPath("A")
filter.AppendExpressionPath("D")
self.assertTrue(
filter.GetNumberOfExpressionPaths() == 2,
self.assertEqual(
filter.GetNumberOfExpressionPaths(), 2,
"filter with two items does not have two items")
category.AddTypeFilter(lldb.SBTypeNameSpecifier("JustAStruct"), filter)
@@ -180,11 +180,11 @@ class SBFormattersAPITestCase(TestBase):
foo_var.GetDeclaration().IsValid(),
'foo declaration is invalid')
self.assertTrue(
foo_var.GetNumChildren() == 2,
self.assertEqual(
foo_var.GetNumChildren(), 2,
'synthetic value has wrong number of child items (synth)')
self.assertTrue(
foo_var.GetChildMemberWithName('X').GetValueAsUnsigned() == 1,
self.assertEqual(
foo_var.GetChildMemberWithName('X').GetValueAsUnsigned(), 1,
'foo_synth.X has wrong value (synth)')
self.assertFalse(
foo_var.GetChildMemberWithName('B').IsValid(),
@@ -210,14 +210,14 @@ class SBFormattersAPITestCase(TestBase):
).GetSelectedThread().GetSelectedFrame().FindVariable('foo')
self.assertTrue(foo_var.IsValid(), 'could not find foo')
self.assertTrue(
foo_var.GetNumChildren() == 2,
self.assertEqual(
foo_var.GetNumChildren(), 2,
'synthetic value has wrong number of child items (filter)')
self.assertTrue(
foo_var.GetChildMemberWithName('X').GetValueAsUnsigned() == 0,
self.assertEqual(
foo_var.GetChildMemberWithName('X').GetValueAsUnsigned(), 0,
'foo_synth.X has wrong value (filter)')
self.assertTrue(
foo_var.GetChildMemberWithName('A').GetValueAsUnsigned() == 1,
self.assertEqual(
foo_var.GetChildMemberWithName('A').GetValueAsUnsigned(), 1,
'foo_synth.A has wrong value (filter)')
self.assertTrue(filter.ReplaceExpressionPathAtIndex(
@@ -240,20 +240,20 @@ class SBFormattersAPITestCase(TestBase):
foo_var = self.dbg.GetSelectedTarget().GetProcess(
).GetSelectedThread().GetSelectedFrame().FindVariable('foo')
self.assertTrue(foo_var.IsValid(), 'could not find foo')
self.assertTrue(
foo_var.GetChildMemberWithName('C').GetValueAsUnsigned() == ord('e'),
self.assertEqual(
foo_var.GetChildMemberWithName('C').GetValueAsUnsigned(), ord('e'),
'foo_synth.C has wrong value (filter)')
chosen = self.dbg.GetFilterForType(
lldb.SBTypeNameSpecifier("JustAStruct"))
self.assertTrue(
chosen.count == 2,
self.assertEqual(
chosen.count, 2,
"wrong filter found for JustAStruct")
self.assertTrue(
chosen.GetExpressionPathAtIndex(0) == 'C',
self.assertEqual(
chosen.GetExpressionPathAtIndex(0), 'C',
"wrong item at index 0 for JustAStruct")
self.assertTrue(
chosen.GetExpressionPathAtIndex(1) == 'F',
self.assertEqual(
chosen.GetExpressionPathAtIndex(1), 'F',
"wrong item at index 1 for JustAStruct")
self.assertFalse(
@@ -420,8 +420,8 @@ class SBFormattersAPITestCase(TestBase):
self.assertTrue(
summary.IsValid(),
"no summary found for foo* when one was in place")
self.assertTrue(
summary.GetData() == "hello static world",
self.assertEqual(
summary.GetData(), "hello static world",
"wrong summary found for foo*")
self.expect("frame variable e1", substrs=["I am an empty Empty1 {}"])
@@ -475,8 +475,8 @@ class SBFormattersAPITestCase(TestBase):
int_vector = frame.FindVariable("int_vector")
if self.TraceOn():
print(int_vector)
self.assertTrue(
int_vector.GetNumChildren() == 0,
self.assertEqual(
int_vector.GetNumChildren(), 0,
'synthetic vector is empty')
self.runCmd('settings set target.enable-synthetic-value false')
@@ -495,6 +495,6 @@ class SBFormattersAPITestCase(TestBase):
int_vector = frame.FindVariable("int_vector")
if self.TraceOn():
print(int_vector)
self.assertTrue(
int_vector.GetNumChildren() == 0,
self.assertEqual(
int_vector.GetNumChildren(), 0,
'synthetic vector is still empty')