mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Return error code from submit() to application.
Related-To: NEO-3741 Change-Id: I0e0ff6606eb6a8a77673949955c8e799689017b6 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -1920,3 +1920,28 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenGetReservedMemoryIsCalledManyTimes
|
||||
memoryManager.getReservedMemory(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize);
|
||||
EXPECT_EQ(reservedMemory, memoryManager.reservedMemory);
|
||||
}
|
||||
|
||||
class MemoryManagerWithFailure : public MockMemoryManager {
|
||||
public:
|
||||
GraphicsAllocation *allocateGraphicsMemoryWithProperties(const AllocationProperties &properties) override {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
TEST(MemoryManagerTest, whenMemoryManagerReturnsNullptrThenAllocateGlobalsSurfaceAlsoReturnsNullptr) {
|
||||
MockDevice device;
|
||||
std::unique_ptr<MemoryManager> memoryManager(new MemoryManagerWithFailure());
|
||||
device.injectMemoryManager(memoryManager.release());
|
||||
MockContext context(&device, true);
|
||||
|
||||
delete context.svmAllocsManager;
|
||||
context.svmAllocsManager = nullptr;
|
||||
|
||||
GraphicsAllocation *allocation = allocateGlobalsSurface(&context, &device, 1024, false, true, nullptr);
|
||||
EXPECT_EQ(nullptr, allocation);
|
||||
|
||||
context.svmAllocsManager = new SVMAllocsManager(device.getMemoryManager());
|
||||
|
||||
allocation = allocateGlobalsSurface(&context, &device, 1024, false, true, nullptr);
|
||||
EXPECT_EQ(nullptr, allocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user