Cleanup mocks

Signed-off-by: Daniel Chabrowski daniel.chabrowski@intel.com
Related-To: NEO-6591
This commit is contained in:
Daniel Chabrowski
2022-03-17 15:54:48 +00:00
committed by Compute-Runtime-Automation
parent 1c0502733f
commit 754efbdaff
2 changed files with 3 additions and 8 deletions

View File

@ -36,20 +36,15 @@ struct MockDrmMemoryOperationsHandlerBind : public DrmMemoryOperationsHandlerBin
using DrmMemoryOperationsHandlerBind::DrmMemoryOperationsHandlerBind;
using DrmMemoryOperationsHandlerBind::evictImpl;
DrmQueryMock *mock;
bool useBaseEvictUnused = true;
uint32_t evictUnusedCalled = 0;
void evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded) override {
evictUnusedCalled++;
if (useBaseEvictUnused) {
DrmMemoryOperationsHandlerBind::evictUnusedAllocations(waitForCompletion, isLockNeeded);
} else {
mock->context.vmBindReturn = 0;
}
}
void setDrmMock(DrmQueryMock *mock) {
this->mock = mock;
}
};
template <uint32_t numRootDevices>
@ -145,7 +140,6 @@ TEST_F(DrmMemoryOperationsHandlerBindTest, whenNoSpaceLeftOnDeviceThenEvictUnuse
mock->context.vmBindReturn = -1;
mock->baseErrno = false;
mock->errnoRetVal = ENOSPC;
operationHandler->setDrmMock(mock);
operationHandler->useBaseEvictUnused = false;
EXPECT_EQ(operationHandler->evictUnusedCalled, 0u);