diff options
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB')
-rw-r--r-- | llvm/unittests/DebugInfo/PDB/CMakeLists.txt | 4 | ||||
-rw-r--r-- | llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp | 24 | ||||
-rw-r--r-- | llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp | 86 |
3 files changed, 57 insertions, 57 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/CMakeLists.txt b/llvm/unittests/DebugInfo/PDB/CMakeLists.txt index 406b487e7a1..43f17add592 100644 --- a/llvm/unittests/DebugInfo/PDB/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/PDB/CMakeLists.txt @@ -1,12 +1,12 @@ set(LLVM_LINK_COMPONENTS DebugInfoCodeView - DebugInfoMSF + DebugInfoMsf DebugInfoPDB ) set(DebugInfoPDBSources MappedBlockStreamTest.cpp - MSFBuilderTest.cpp + MsfBuilderTest.cpp PDBApiTest.cpp ) diff --git a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index 07591ca69d3..2d7814e55b6 100644 --- a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp @@ -9,13 +9,13 @@ #include "ErrorChecking.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/IMSFFile.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/IMsfFile.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/MsfStreamLayout.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "gtest/gtest.h" #include <unordered_map> @@ -39,7 +39,7 @@ public: Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef<uint8_t> &Buffer) const override { if (Offset + Size > Data.size()) - return make_error<MSFError>(msf_error_code::insufficient_buffer); + return make_error<MsfError>(msf_error_code::insufficient_buffer); Buffer = Data.slice(Offset, Size); return Error::success(); } @@ -47,7 +47,7 @@ public: Error readLongestContiguousChunk(uint32_t Offset, ArrayRef<uint8_t> &Buffer) const override { if (Offset >= Data.size()) - return make_error<MSFError>(msf_error_code::insufficient_buffer); + return make_error<MsfError>(msf_error_code::insufficient_buffer); Buffer = Data.drop_front(Offset); return Error::success(); } @@ -56,14 +56,14 @@ public: Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> SrcData) const override { if (Offset + SrcData.size() > Data.size()) - return make_error<MSFError>(msf_error_code::insufficient_buffer); + return make_error<MsfError>(msf_error_code::insufficient_buffer); ::memcpy(&Data[Offset], SrcData.data(), SrcData.size()); return Error::success(); } Error commit() const override { return Error::success(); } - MSFStreamLayout layout() const { - return MSFStreamLayout{static_cast<uint32_t>(Data.size()), Blocks}; + MsfStreamLayout layout() const { + return MsfStreamLayout{static_cast<uint32_t>(Data.size()), Blocks}; } private: diff --git a/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp b/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp index 04bd9410306..2f4e9aaa96e 100644 --- a/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp @@ -1,4 +1,4 @@ -//===- MSFBuilderTest.cpp Tests manipulation of MSF stream metadata ------===// +//===- MsfBuilderTest.cpp Tests manipulation of MSF stream metadata ------===// // // The LLVM Compiler Infrastructure // @@ -9,8 +9,8 @@ #include "ErrorChecking.h" -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/Msf/MsfBuilder.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" #include "gtest/gtest.h" @@ -18,7 +18,7 @@ using namespace llvm; using namespace llvm::msf; namespace { -class MSFBuilderTest : public testing::Test { +class MsfBuilderTest : public testing::Test { protected: void initializeSimpleSuperBlock(msf::SuperBlock &SB) { initializeSuperBlock(SB); @@ -40,7 +40,7 @@ protected: }; } -TEST_F(MSFBuilderTest, ValidateSuperBlockAccept) { +TEST_F(MsfBuilderTest, ValidateSuperBlockAccept) { // Test that a known good super block passes validation. SuperBlock SB; initializeSuperBlock(SB); @@ -48,7 +48,7 @@ TEST_F(MSFBuilderTest, ValidateSuperBlockAccept) { EXPECT_NO_ERROR(msf::validateSuperBlock(SB)); } -TEST_F(MSFBuilderTest, ValidateSuperBlockReject) { +TEST_F(MsfBuilderTest, ValidateSuperBlockReject) { // Test that various known problems cause a super block to be rejected. SuperBlock SB; initializeSimpleSuperBlock(SB); @@ -75,7 +75,7 @@ TEST_F(MSFBuilderTest, ValidateSuperBlockReject) { EXPECT_ERROR(msf::validateSuperBlock(SB)); } -TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { +TEST_F(MsfBuilderTest, TestUsedBlocksMarkedAsUsed) { // Test that when assigning a stream to a known list of blocks, the blocks // are correctly marked as used after adding, but no other incorrect blocks // are accidentally marked as used. @@ -84,7 +84,7 @@ TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { // Allocate some extra blocks at the end so we can verify that they're free // after the initialization. uint32_t NumBlocks = msf::getMinimumBlockCount() + Blocks.size() + 10; - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096, NumBlocks); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096, NumBlocks); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -100,22 +100,22 @@ TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { } } -TEST_F(MSFBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { +TEST_F(MsfBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { // Test that adding a new stream correctly updates the directory. This only // tests the case where the directory *DOES NOT* grow large enough that it // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; auto ExpectedL1 = Msf.build(); EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; + MsfLayout &L1 = *ExpectedL1; auto OldDirBlocks = L1.DirectoryBlocks; EXPECT_EQ(1U, OldDirBlocks.size()); - auto ExpectedMsf2 = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf2 = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf2); auto &Msf2 = *ExpectedMsf2; @@ -127,18 +127,18 @@ TEST_F(MSFBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { auto ExpectedL2 = Msf2.build(); EXPECT_EXPECTED(ExpectedL2); - MSFLayout &L2 = *ExpectedL2; + MsfLayout &L2 = *ExpectedL2; auto NewDirBlocks = L2.DirectoryBlocks; EXPECT_EQ(1U, NewDirBlocks.size()); } -TEST_F(MSFBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { +TEST_F(MsfBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { // Test that adding a new stream correctly updates the directory. This only // tests the case where the directory *DOES* grow large enough that it // crosses a Block boundary. This is because the newly added stream occupies // so many Blocks that need to be indexed in the directory that the directory // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -146,15 +146,15 @@ TEST_F(MSFBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { auto ExpectedL1 = Msf.build(); EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; + MsfLayout &L1 = *ExpectedL1; auto DirBlocks = L1.DirectoryBlocks; EXPECT_EQ(2U, DirBlocks.size()); } -TEST_F(MSFBuilderTest, TestGrowStreamNoBlockIncrease) { +TEST_F(MsfBuilderTest, TestGrowStreamNoBlockIncrease) { // Test growing an existing stream by a value that does not affect the number // of blocks it occupies. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -171,12 +171,12 @@ TEST_F(MSFBuilderTest, TestGrowStreamNoBlockIncrease) { EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); } -TEST_F(MSFBuilderTest, TestGrowStreamWithBlockIncrease) { +TEST_F(MsfBuilderTest, TestGrowStreamWithBlockIncrease) { // Test that growing an existing stream to a value large enough that it causes // the need to allocate new Blocks to the stream correctly updates the // stream's // block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -194,10 +194,10 @@ TEST_F(MSFBuilderTest, TestGrowStreamWithBlockIncrease) { EXPECT_NE(NewStreamBlocks[0], NewStreamBlocks[1]); } -TEST_F(MSFBuilderTest, TestShrinkStreamNoBlockDecrease) { +TEST_F(MsfBuilderTest, TestShrinkStreamNoBlockDecrease) { // Test that shrinking an existing stream by a value that does not affect the // number of Blocks it occupies makes no changes to stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -214,11 +214,11 @@ TEST_F(MSFBuilderTest, TestShrinkStreamNoBlockDecrease) { EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); } -TEST_F(MSFBuilderTest, TestShrinkStreamWithBlockDecrease) { +TEST_F(MsfBuilderTest, TestShrinkStreamWithBlockDecrease) { // Test that shrinking an existing stream to a value large enough that it // causes the need to deallocate new Blocks to the stream correctly updates // the stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -235,10 +235,10 @@ TEST_F(MSFBuilderTest, TestShrinkStreamWithBlockDecrease) { EXPECT_EQ(OldStreamBlocks[0], NewStreamBlocks[0]); } -TEST_F(MSFBuilderTest, TestRejectReusedStreamBlock) { +TEST_F(MsfBuilderTest, TestRejectReusedStreamBlock) { // Test that attempting to add a stream and assigning a block that is already // in use by another stream fails. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -248,10 +248,10 @@ TEST_F(MSFBuilderTest, TestRejectReusedStreamBlock) { EXPECT_ERROR(Msf.addStream(6144, Blocks)); } -TEST_F(MSFBuilderTest, TestBlockCountsWhenAddingStreams) { +TEST_F(MsfBuilderTest, TestBlockCountsWhenAddingStreams) { // Test that when adding multiple streams, the number of used and free Blocks // allocated to the MSF file are as expected. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -269,10 +269,10 @@ TEST_F(MSFBuilderTest, TestBlockCountsWhenAddingStreams) { } } -TEST_F(MSFBuilderTest, BuildMsfLayout) { - // Test that we can generate an MSFLayout structure from a valid layout +TEST_F(MsfBuilderTest, BuildMsfLayout) { + // Test that we can generate an Msf MsfLayout structure from a valid layout // specification. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -286,7 +286,7 @@ TEST_F(MSFBuilderTest, BuildMsfLayout) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(4096U, L.SB->BlockSize); EXPECT_EQ(ExpectedNumBlocks, L.SB->NumBlocks); @@ -301,8 +301,8 @@ TEST_F(MSFBuilderTest, BuildMsfLayout) { } } -TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { - Expected<MSFBuilder> ExpectedMsf = MSFBuilder::create( +TEST_F(MsfBuilderTest, UseDirectoryBlockHint) { + Expected<MsfBuilder> ExpectedMsf = MsfBuilder::create( Allocator, 4096, msf::getMinimumBlockCount() + 1, false); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -313,7 +313,7 @@ TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(msf::getMinimumBlockCount() + 2, L.SB->NumBlocks); EXPECT_EQ(1U, L.DirectoryBlocks.size()); EXPECT_EQ(1U, L.StreamMap[0].size()); @@ -322,9 +322,9 @@ TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { EXPECT_EQ(B + 2, L.StreamMap[0].front()); } -TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) { - Expected<MSFBuilder> ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); +TEST_F(MsfBuilderTest, DirectoryBlockHintInsufficient) { + Expected<MsfBuilder> ExpectedMsf = + MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; uint32_t B = msf::getFirstUnreservedBlock(); @@ -335,14 +335,14 @@ TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(2U, L.DirectoryBlocks.size()); EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); } -TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) { - Expected<MSFBuilder> ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); +TEST_F(MsfBuilderTest, DirectoryBlockHintOverestimated) { + Expected<MsfBuilder> ExpectedMsf = + MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -353,7 +353,7 @@ TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(1U, L.DirectoryBlocks.size()); EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); } |