mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-04 10:04:33 +00:00
[pdb] Fix build errors in PDB unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f686563fd
commit
47b89fc720
@ -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
Block a user