[llvm] r272174 - [pdb] Fix build errors in PDB unit tests.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 10:32:25 PDT 2016


Author: zturner
Date: Wed Jun  8 12:32:25 2016
New Revision: 272174

URL: http://llvm.org/viewvc/llvm-project?rev=272174&view=rev
Log:
[pdb] Fix build errors in PDB unit tests.

Modified:
    llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp

Modified: llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp?rev=272174&r1=272173&r2=272174&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp Wed Jun  8 12:32:25 2016
@@ -71,11 +71,18 @@ private:
   std::vector<uint8_t> Data;
 };
 
+class MappedBlockStreamImpl : public MappedBlockStream {
+public:
+  MappedBlockStreamImpl(std::unique_ptr<IPDBStreamData> 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<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StreamRef SR;
   EXPECT_NO_ERROR(R.readStreamRef(SR, 0U));
@@ -89,7 +96,7 @@ TEST(MappedBlockStreamTest, ReadBeyondEn
 // does not fail due to the length of the output buffer.
 TEST(MappedBlockStreamTest, ReadOntoNonEmptyBuffer) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str = "ZYXWVUTSRQPONMLKJIHGFEDCBA";
   EXPECT_NO_ERROR(R.readFixedString(Str, 1));
@@ -102,7 +109,7 @@ TEST(MappedBlockStreamTest, ReadOntoNonE
 // not allocate memory.
 TEST(MappedBlockStreamTest, ZeroCopyReadContiguousBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
   EXPECT_NO_ERROR(R.readFixedString(Str, 2));
@@ -120,7 +127,7 @@ TEST(MappedBlockStreamTest, ZeroCopyRead
 // requested.
 TEST(MappedBlockStreamTest, CopyReadNonContiguousBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
   EXPECT_NO_ERROR(R.readFixedString(Str, 10));
@@ -132,7 +139,7 @@ TEST(MappedBlockStreamTest, CopyReadNonC
 // fails and allocates no memory.
 TEST(MappedBlockStreamTest, InvalidReadSizeNoBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
 
@@ -145,7 +152,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
 // fails and allocates no memory.
 TEST(MappedBlockStreamTest, InvalidReadSizeContiguousBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
 
@@ -158,7 +165,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
 // boundary fails and allocates no memory.
 TEST(MappedBlockStreamTest, InvalidReadSizeNonContiguousBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
 
@@ -170,7 +177,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
 // beyond the end of a StreamRef fails.
 TEST(MappedBlockStreamTest, ZeroCopyReadNoBreak) {
   DiscontiguousFile F;
-  MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
+  MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F);
   StreamReader R(S);
   StringRef Str;
   EXPECT_NO_ERROR(R.readFixedString(Str, 1));




More information about the llvm-commits mailing list