Add failInAllocateWithSizeAndAlignment flag to MockMemoryManager

Change-Id: Iee6a5ec468a905e065645dbf2ae8b9521c0b04d9
This commit is contained in:
Hoppe, Mateusz 2018-07-25 09:38:00 +02:00 committed by sys_ocldev
parent eebb919c18
commit 03bad96877
2 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,9 @@ GraphicsAllocation *MockMemoryManager::allocateGraphicsMemoryInDevicePool(const
}
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) {
if (failInAllocateWithSizeAndAlignment) {
return nullptr;
}
allocationCreated = true;
return OsAgnosticMemoryManager::allocateGraphicsMemory(size, alignment, forcePin, uncacheable);
}

View File

@ -52,6 +52,7 @@ class MockMemoryManager : public OsAgnosticMemoryManager {
bool allocationInDevicePoolCreated = false;
bool failInDevicePool = false;
bool failInDevicePoolWithError = false;
bool failInAllocateWithSizeAndAlignment = false;
bool preferRenderCompressedFlagPassed = false;
};