mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Cleanup mocks
Signed-off-by: Daniel Chabrowski daniel.chabrowski@intel.com Related-To: NEO-6591
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
1c0502733f
commit
754efbdaff
@ -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);
|
||||
|
Reference in New Issue
Block a user