[llvm] r271983 - [pdb] Fix broken unit tests after r271982.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 22:32:49 PDT 2016
Author: zturner
Date: Tue Jun 7 00:32:48 2016
New Revision: 271983
URL: http://llvm.org/viewvc/llvm-project?rev=271983&view=rev
Log:
[pdb] Fix broken unit tests after r271982.
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=271983&r1=271982&r2=271983&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp Tue Jun 7 00:32:48 2016
@@ -12,6 +12,8 @@
#include "llvm/DebugInfo/CodeView/StreamReader.h"
#include "llvm/DebugInfo/CodeView/StreamRef.h"
#include "llvm/DebugInfo/PDB/Raw/IPDBFile.h"
+#include "llvm/DebugInfo/PDB/Raw/IPDBStreamData.h"
+#include "llvm/DebugInfo/PDB/Raw/IndexedStreamData.h"
#include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h"
#include "gtest/gtest.h"
@@ -53,10 +55,10 @@ public:
virtual uint32_t getStreamByteSize(uint32_t StreamIndex) const override {
return getBlockCount() * getBlockSize();
}
- virtual ArrayRef<uint32_t>
+ virtual ArrayRef<support::ulittle32_t>
getStreamBlockList(uint32_t StreamIndex) const override {
if (StreamIndex != 0)
- return ArrayRef<uint32_t>();
+ return ArrayRef<support::ulittle32_t>();
return Blocks;
}
virtual StringRef getBlockData(uint32_t BlockIndex,
@@ -65,7 +67,7 @@ public:
}
private:
- std::vector<uint32_t> Blocks;
+ std::vector<support::ulittle32_t> Blocks;
std::vector<char> Data;
};
@@ -73,7 +75,7 @@ private:
// and does not allocate.
TEST(MappedBlockStreamTest, ReadBeyondEndOfStreamRef) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StreamRef SR;
EXPECT_NO_ERROR(R.readStreamRef(SR, 0U));
@@ -87,7 +89,7 @@ TEST(MappedBlockStreamTest, ReadBeyondEn
// does not fail due to the length of the output buffer.
TEST(MappedBlockStreamTest, ReadOntoNonEmptyBuffer) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str = "ZYXWVUTSRQPONMLKJIHGFEDCBA";
EXPECT_NO_ERROR(R.readFixedString(Str, 1));
@@ -100,7 +102,7 @@ TEST(MappedBlockStreamTest, ReadOntoNonE
// not allocate memory.
TEST(MappedBlockStreamTest, ZeroCopyReadContiguousBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str;
EXPECT_NO_ERROR(R.readFixedString(Str, 2));
@@ -118,7 +120,7 @@ TEST(MappedBlockStreamTest, ZeroCopyRead
// requested.
TEST(MappedBlockStreamTest, CopyReadNonContiguousBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str;
EXPECT_NO_ERROR(R.readFixedString(Str, 10));
@@ -130,7 +132,7 @@ TEST(MappedBlockStreamTest, CopyReadNonC
// fails and allocates no memory.
TEST(MappedBlockStreamTest, InvalidReadSizeNoBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str;
@@ -143,7 +145,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
// fails and allocates no memory.
TEST(MappedBlockStreamTest, InvalidReadSizeContiguousBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str;
@@ -156,7 +158,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
// boundary fails and allocates no memory.
TEST(MappedBlockStreamTest, InvalidReadSizeNonContiguousBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream S(llvm::make_unique<IndexedStreamData>(0, F), F);
StreamReader R(S);
StringRef Str;
@@ -168,7 +170,7 @@ TEST(MappedBlockStreamTest, InvalidReadS
// beyond the end of a StreamRef fails.
TEST(MappedBlockStreamTest, ZeroCopyReadNoBreak) {
DiscontiguousFile F;
- MappedBlockStream S(0, F);
+ MappedBlockStream 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