Add new LinearStream ctor

Change-Id: I8c77f90306d9ab27b42cc331bbfce6258bca4a3b
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2019-06-26 15:23:34 +02:00
committed by sys_ocldev
parent 79fc2c6d42
commit 9bcec32ef4
3 changed files with 16 additions and 1 deletions

View File

@ -18,6 +18,16 @@ TEST(LinearStreamCtorTest, establishInitialValues) {
EXPECT_EQ(0u, linearStream.getMaxAvailableSpace());
}
TEST(LinearStreamCtorTest, whenProvidedAllArgumentsThenExpectSameValuesSet) {
GraphicsAllocation *gfxAllocation = reinterpret_cast<GraphicsAllocation *>(0x1234);
void *buffer = reinterpret_cast<void *>(0x2000);
size_t bufferSize = 0x1000u;
LinearStream linearStream(gfxAllocation, buffer, bufferSize);
EXPECT_EQ(buffer, linearStream.getCpuBase());
EXPECT_EQ(bufferSize, linearStream.getMaxAvailableSpace());
EXPECT_EQ(gfxAllocation, linearStream.getGraphicsAllocation());
}
TEST_F(LinearStreamTest, getSpaceTestSizeZero) {
EXPECT_NE(nullptr, linearStream.getSpace(0));
}