Clean not used methods from linear stream.

Change-Id: Ib6775e346eb1a971c9ad5bc511c4226f1c53ecaf
This commit is contained in:
Mrozek, Michal
2018-05-18 08:42:37 -07:00
parent b27eee1f7a
commit 6fdde42289
3 changed files with 2 additions and 55 deletions

View File

@ -112,47 +112,4 @@ TEST_F(LinearStreamTest, givenNewGraphicsAllocationWhenReplaceIsCalledThenLinear
EXPECT_NE(&newGraphicsAllocation, graphicsAllocation);
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
EXPECT_EQ(&newGraphicsAllocation, linearStream.getGraphicsAllocation());
}
TEST_F(LinearStreamTest, givenGraphicsAllocationWithGpuBaseAddressWhenItIsUsedInLinearStreamThenGetGpuBaseReturnsGraphicsAllocationBase) {
auto graphicsAllocation = linearStream.getGraphicsAllocation();
EXPECT_NE(nullptr, graphicsAllocation);
auto address = (void *)0x100000;
uint64_t gpuAddress = 0x1000001;
uint64_t gpuHeapBase = 0x1000000;
GraphicsAllocation newGraphicsAllocation(address, gpuAddress, gpuHeapBase, 4096);
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
EXPECT_EQ(gpuHeapBase, linearStream.getGpuBase());
}
TEST_F(LinearStreamTest, givenGraphicsAllocationWithGpuBaseAddressWhenItIsQueriedForOffsetFromBaseThenProperOffsetIsReturned) {
auto graphicsAllocation = linearStream.getGraphicsAllocation();
EXPECT_NE(nullptr, graphicsAllocation);
auto address = (void *)0x100000;
uint64_t gpuAddress = 0x1000001;
uint64_t gpuHeapBase = 0x1000000;
GraphicsAllocation newGraphicsAllocation(address, gpuAddress, gpuHeapBase, 4096);
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
EXPECT_EQ(gpuHeapBase, linearStream.getGpuBase());
}
TEST_F(LinearStreamTest, given32BitHeapWhenItIsAskedForGpuoffsetThenOffsetFromBaseIsReturned) {
auto allocationSize = 4096;
std::unique_ptr<char> memoryPtr(new char[allocationSize]);
uint64_t gpuHeapBase = 0x1000000;
uint64_t gpuAddress = 0x1000017;
auto currentOffset = gpuAddress - gpuHeapBase;
GraphicsAllocation newGraphicsAllocation(memoryPtr.get(), gpuAddress, gpuHeapBase, allocationSize);
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
EXPECT_EQ(linearStream.getCurrentGpuOffsetFromHeapBase(), currentOffset);
linearStream.getSpace(10);
currentOffset += 10;
EXPECT_EQ(linearStream.getCurrentGpuOffsetFromHeapBase(), currentOffset);
}
}