diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp @@ -18,10 +18,10 @@ using namespace llvm; using namespace dwarf; -enum Order : bool { InOrder, OutOfOrder }; +enum OrderKind : bool { InOrder, OutOfOrder }; -void WriteAbbreviationDeclarations(raw_ostream &OS, uint32_t FirstCode, - Order Ord) { +void writeAbbreviationDeclarations(raw_ostream &OS, uint32_t FirstCode, + OrderKind Order) { encodeULEB128(FirstCode, OS); encodeULEB128(DW_TAG_compile_unit, OS); OS << static_cast(DW_CHILDREN_yes); @@ -30,7 +30,8 @@ encodeULEB128(0, OS); encodeULEB128(0, OS); - uint32_t SecondCode = Ord == Order::InOrder ? FirstCode + 1 : FirstCode - 1; + uint32_t SecondCode = + Order == OrderKind::InOrder ? FirstCode + 1 : FirstCode - 1; encodeULEB128(SecondCode, OS); encodeULEB128(DW_TAG_subprogram, OS); @@ -46,7 +47,7 @@ raw_svector_ostream OS(RawData); uint32_t FirstCode = 5; - WriteAbbreviationDeclarations(OS, FirstCode, InOrder); + writeAbbreviationDeclarations(OS, FirstCode, InOrder); encodeULEB128(0, OS); uint64_t Offset = 0; @@ -55,19 +56,19 @@ const bool DataWasExtracted = AbbrevSet.extract(Data, &Offset); EXPECT_TRUE(DataWasExtracted); // The Abbreviation Declarations are in order and contiguous, so we want to - // make sure that FirstAbbrCode was correctly set + // make sure that FirstAbbrCode was correctly set. EXPECT_EQ(AbbrevSet.getFirstAbbrCode(), FirstCode); const DWARFAbbreviationDeclaration *Abbrev5 = AbbrevSet.getAbbreviationDeclaration(FirstCode); - EXPECT_TRUE(Abbrev5); + ASSERT_TRUE(Abbrev5); EXPECT_EQ(Abbrev5->getTag(), DW_TAG_compile_unit); EXPECT_TRUE(Abbrev5->hasChildren()); EXPECT_EQ(Abbrev5->getNumAttributes(), 1u); const DWARFAbbreviationDeclaration *Abbrev6 = AbbrevSet.getAbbreviationDeclaration(FirstCode + 1); - EXPECT_TRUE(Abbrev6); + ASSERT_TRUE(Abbrev6); EXPECT_EQ(Abbrev6->getTag(), DW_TAG_subprogram); EXPECT_FALSE(Abbrev6->hasChildren()); EXPECT_EQ(Abbrev6->getNumAttributes(), 1u); @@ -78,7 +79,7 @@ raw_svector_ostream OS(RawData); uint32_t FirstCode = 2; - WriteAbbreviationDeclarations(OS, FirstCode, OutOfOrder); + writeAbbreviationDeclarations(OS, FirstCode, OutOfOrder); encodeULEB128(0, OS); uint64_t Offset = 0; @@ -86,19 +87,19 @@ DWARFAbbreviationDeclarationSet AbbrevSet; const bool DataWasExtracted = AbbrevSet.extract(Data, &Offset); EXPECT_TRUE(DataWasExtracted); - // The declarations are out of order, ensure that FirstAbbrCode is UINT32_MAX + // The declarations are out of order, ensure that FirstAbbrCode is UINT32_MAX. EXPECT_EQ(AbbrevSet.getFirstAbbrCode(), UINT32_MAX); const DWARFAbbreviationDeclaration *Abbrev2 = AbbrevSet.getAbbreviationDeclaration(FirstCode); - EXPECT_TRUE(Abbrev2); + ASSERT_TRUE(Abbrev2); EXPECT_EQ(Abbrev2->getTag(), DW_TAG_compile_unit); EXPECT_TRUE(Abbrev2->hasChildren()); EXPECT_EQ(Abbrev2->getNumAttributes(), 1u); const DWARFAbbreviationDeclaration *Abbrev1 = AbbrevSet.getAbbreviationDeclaration(FirstCode - 1); - EXPECT_TRUE(Abbrev1); + ASSERT_TRUE(Abbrev1); EXPECT_EQ(Abbrev1->getTag(), DW_TAG_subprogram); EXPECT_FALSE(Abbrev1->hasChildren()); EXPECT_EQ(Abbrev1->getNumAttributes(), 1u);