Make sure that residency is properly initialized.

- all members needs proper init.

Change-Id: I578eee8178ae375cc4861872c84ced1729fb689b
This commit is contained in:
Mrozek, Michal
2018-09-20 10:30:33 -07:00
committed by sys_ocldev
parent e06b370697
commit f3bcb5c539
2 changed files with 8 additions and 1 deletions

View File

@@ -1759,6 +1759,13 @@ TEST(GraphicsAllocation, givenSharedHandleBasedConstructorWhenGraphicsAllocation
EXPECT_EQ(expectedGpuAddress, graphicsAllocation.getGpuAddress());
}
TEST(GraphicsAllocation, givenGraphicsAllocationCreatedWithDefaultConstructorThenItIsNotResidentInAllContexts) {
GraphicsAllocation graphicsAllocation(nullptr, 1u);
for (uint32_t index = 0u; index < maxOsContextCount; index++) {
EXPECT_EQ(ObjectNotResident, graphicsAllocation.residencyTaskCount[index]);
}
}
TEST(ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCountIncreases) {
auto osContext = new OsContext(nullptr, 0u);
OsAgnosticMemoryManager memoryManager;