diff --git a/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index 61b8492038f..f1c091805b0 100644 --- a/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp @@ -71,11 +71,18 @@ private: std::vector Data; }; +class MappedBlockStreamImpl : public MappedBlockStream { +public: + MappedBlockStreamImpl(std::unique_ptr Data, + const IPDBFile &File) + : MappedBlockStream(std::move(Data), File) {} +}; + // Tests that a read which is entirely contained within a single block works // and does not allocate. TEST(MappedBlockStreamTest, ReadBeyondEndOfStreamRef) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StreamRef SR; EXPECT_NO_ERROR(R.readStreamRef(SR, 0U)); @@ -89,7 +96,7 @@ TEST(MappedBlockStreamTest, ReadBeyondEndOfStreamRef) { // does not fail due to the length of the output buffer. TEST(MappedBlockStreamTest, ReadOntoNonEmptyBuffer) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str = "ZYXWVUTSRQPONMLKJIHGFEDCBA"; EXPECT_NO_ERROR(R.readFixedString(Str, 1)); @@ -102,7 +109,7 @@ TEST(MappedBlockStreamTest, ReadOntoNonEmptyBuffer) { // not allocate memory. TEST(MappedBlockStreamTest, ZeroCopyReadContiguousBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; EXPECT_NO_ERROR(R.readFixedString(Str, 2)); @@ -120,7 +127,7 @@ TEST(MappedBlockStreamTest, ZeroCopyReadContiguousBreak) { // requested. TEST(MappedBlockStreamTest, CopyReadNonContiguousBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; EXPECT_NO_ERROR(R.readFixedString(Str, 10)); @@ -132,7 +139,7 @@ TEST(MappedBlockStreamTest, CopyReadNonContiguousBreak) { // fails and allocates no memory. TEST(MappedBlockStreamTest, InvalidReadSizeNoBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; @@ -145,7 +152,7 @@ TEST(MappedBlockStreamTest, InvalidReadSizeNoBreak) { // fails and allocates no memory. TEST(MappedBlockStreamTest, InvalidReadSizeContiguousBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; @@ -158,7 +165,7 @@ TEST(MappedBlockStreamTest, InvalidReadSizeContiguousBreak) { // boundary fails and allocates no memory. TEST(MappedBlockStreamTest, InvalidReadSizeNonContiguousBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; @@ -170,7 +177,7 @@ TEST(MappedBlockStreamTest, InvalidReadSizeNonContiguousBreak) { // beyond the end of a StreamRef fails. TEST(MappedBlockStreamTest, ZeroCopyReadNoBreak) { DiscontiguousFile F; - MappedBlockStream S(llvm::make_unique(0, F), F); + MappedBlockStreamImpl S(llvm::make_unique(0, F), F); StreamReader R(S); StringRef Str; EXPECT_NO_ERROR(R.readFixedString(Str, 1));