forked from OSchip/llvm-project
[pdb] Fix build errors in PDB unit tests.
llvm-svn: 272174
This commit is contained in:
parent
785f391131
commit
3e65bcbe33
|
@ -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, ReadBeyondEndOfStreamRef) {
|
|||
// 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, ReadOntoNonEmptyBuffer) {
|
|||
// 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, ZeroCopyReadContiguousBreak) {
|
|||
// 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, CopyReadNonContiguousBreak) {
|
|||
// 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, InvalidReadSizeNoBreak) {
|
|||
// 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, InvalidReadSizeContiguousBreak) {
|
|||
// 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, InvalidReadSizeNonContiguousBreak) {
|
|||
// 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));
|
||||
|
|
Loading…
Reference in New Issue