From fe58c2bb81e5ef79f96d653fb8db797988092715 Mon Sep 17 00:00:00 2001 From: "Kindracki, Jakub Tomasz" Date: Fri, 22 Aug 2025 13:12:58 +0000 Subject: [PATCH] test: Fix variable backup in event test Related-To: NEO-8116 Signed-off-by: Kindracki, Jakub Tomasz --- .../test/unit_tests/sources/event/test_event.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index 582edd4115..a468ac085b 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -1747,12 +1747,6 @@ HWTEST_F(EventPoolCreateMultiDevice, GivenEnabledTimestampPoolAllocatorAndForced DebugManagerStateRestore restorer; NEO::debugManager.flags.EnableTimestampPoolAllocator.set(1); - auto mockL0GfxCoreHelper0 = std::make_unique>(); - auto mockL0GfxCoreHelper1 = std::make_unique>(); - - std::unique_ptr l0GfxCoreHelperBackup0(static_cast(mockL0GfxCoreHelper0.get())); - std::unique_ptr l0GfxCoreHelperBackup1(static_cast(mockL0GfxCoreHelper1.get())); - ASSERT_GE(driverHandle->devices.size(), 2u); auto device0 = driverHandle->devices[0]; @@ -1763,8 +1757,8 @@ HWTEST_F(EventPoolCreateMultiDevice, GivenEnabledTimestampPoolAllocatorAndForced ASSERT_TRUE(neoDevice0->getDeviceTimestampPoolAllocator().isEnabled()); ASSERT_TRUE(neoDevice1->getDeviceTimestampPoolAllocator().isEnabled()); - neoDevice0->getExecutionEnvironment()->rootDeviceEnvironments[0]->apiGfxCoreHelper.swap(l0GfxCoreHelperBackup0); - neoDevice1->getExecutionEnvironment()->rootDeviceEnvironments[1]->apiGfxCoreHelper.swap(l0GfxCoreHelperBackup1); + VariableBackup> backupApiGfxCoreHelper0(&neoDevice0->getExecutionEnvironment()->rootDeviceEnvironments[0]->apiGfxCoreHelper, std::make_unique>()); + VariableBackup> backupApiGfxCoreHelper1(&neoDevice1->getExecutionEnvironment()->rootDeviceEnvironments[1]->apiGfxCoreHelper, std::make_unique>()); std::vector> eventPoolsDevice0; std::vector> eventPoolsDevice1; @@ -1851,11 +1845,6 @@ HWTEST_F(EventPoolCreateMultiDevice, GivenEnabledTimestampPoolAllocatorAndForced EXPECT_NE(expectedSharedAllocationDevice0, expectedSharedAllocationDevice1); EXPECT_EQ(numEvents, gpuAddressesDevice0.size()); EXPECT_EQ(numEvents, gpuAddressesDevice1.size()); - - neoDevice0->getExecutionEnvironment()->rootDeviceEnvironments[0]->apiGfxCoreHelper.swap(l0GfxCoreHelperBackup0); - neoDevice1->getExecutionEnvironment()->rootDeviceEnvironments[1]->apiGfxCoreHelper.swap(l0GfxCoreHelperBackup1); - l0GfxCoreHelperBackup0.release(); - l0GfxCoreHelperBackup1.release(); } using EventSynchronizeTest = Test>;