mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-21 10:33:07 +08:00
fix: propagate error createInternalHandle wddm
Unify with linux implementation, return -1 on error and 0 on success. Related-To: NEO-6893 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
10ed5fd804
commit
eeddd779f0
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -247,7 +247,7 @@ TEST(GraphicsAllocationTest, givenDefaultGraphicsAllocationWhenInternalHandleIsB
|
||||
TEST(GraphicsAllocationTest, givenDefaultGraphicsAllocationWhenInternalHandleIsBeingObtainedOrCreatedThenZeroIsReturned) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
uint64_t handle = 0;
|
||||
graphicsAllocation.createInternalHandle(nullptr, 0u, handle);
|
||||
EXPECT_EQ(0, graphicsAllocation.createInternalHandle(nullptr, 0u, handle));
|
||||
EXPECT_EQ(0ull, handle);
|
||||
graphicsAllocation.clearInternalHandle(0u);
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCloseInternalHandleWithoutAllocatio
|
||||
memoryManager.freeGraphicsMemoryImpl(alloc);
|
||||
}
|
||||
|
||||
TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmpyHandleReturned) {
|
||||
TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmptyHandleReturned) {
|
||||
osEnvironment->gdi->reserveGpuVirtualAddress = reserveDeviceAddressSpaceMock;
|
||||
osEnvironment->gdi->createAllocation2 = createAllocation2Mock;
|
||||
osEnvironment->gdi->mapGpuVirtualAddress = mapGpuVirtualAddressMock;
|
||||
@@ -756,7 +756,7 @@ TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmpyH
|
||||
memoryManager.closeInternalHandle(handle, 0u, alloc);
|
||||
|
||||
memoryManager.failCreateInternalNTHandle = true;
|
||||
EXPECT_EQ(1, alloc->createInternalHandle(&memoryManager, 0u, handle));
|
||||
EXPECT_EQ(-1, alloc->createInternalHandle(&memoryManager, 0u, handle));
|
||||
|
||||
memoryManager.freeGraphicsMemoryImpl(alloc);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationWithFailingCreateInt
|
||||
memoryManager->closeInternalHandle(handle, 0u, graphicsAllocation);
|
||||
|
||||
memoryManager->failCreateInternalNTHandle = true;
|
||||
EXPECT_EQ(1, graphicsAllocation->createInternalHandle(memoryManager, 0u, handle));
|
||||
EXPECT_EQ(-1, graphicsAllocation->createInternalHandle(memoryManager, 0u, handle));
|
||||
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user