mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Retrun valid status on createAllocation64k fail
Change-Id: Iaaed107c995a79125236196b6a956696dfe20875
This commit is contained in:
committed by
sys_ocldev
parent
0c01653daf
commit
02611dc953
@@ -789,6 +789,22 @@ TEST_F(Wddm20Tests, givenOpenSharedHandleWhenZeroAllocationsThenReturnNull) {
|
||||
EXPECT_EQ(false, ret);
|
||||
}
|
||||
|
||||
TEST_F(Wddm20Tests, whenCreateAllocation64kFailsThenReturnFalse) {
|
||||
struct FailingCreateAllocation {
|
||||
static NTSTATUS APIENTRY mockCreateAllocation(D3DKMT_CREATEALLOCATION *param) {
|
||||
return STATUS_GRAPHICS_NO_VIDEO_MEMORY;
|
||||
};
|
||||
};
|
||||
gdi->createAllocation = FailingCreateAllocation::mockCreateAllocation;
|
||||
|
||||
void *fakePtr = reinterpret_cast<void *>(0x123);
|
||||
auto gmm = std::make_unique<Gmm>(fakePtr, 100, false);
|
||||
WddmAllocation allocation(fakePtr, 100, fakePtr, 200, nullptr, MemoryPool::MemoryNull);
|
||||
allocation.gmm = gmm.get();
|
||||
|
||||
EXPECT_FALSE(wddm->createAllocation64k(&allocation));
|
||||
}
|
||||
|
||||
TEST_F(Wddm20Tests, givenReadOnlyMemoryWhenCreateAllocationFailsWithNoVideoMemoryThenCorrectStatusIsReturned) {
|
||||
class MockCreateAllocation {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user