fix: add missing nullptr check before accessing ail helper

Fixes: #755
Fixes: #754
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-08-20 15:09:09 +00:00
committed by Compute-Runtime-Automation
parent d1c354d5bf
commit f617093a6a
4 changed files with 19 additions and 5 deletions

View File

@@ -1728,3 +1728,14 @@ TEST_F(DeviceTests, givenDebuggerRequestedByUserWhenDeviceWithSubDevicesCreatedT
EXPECT_EQ(1u, createDebuggerCallCount);
EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->getL0Debugger());
}
TEST(DeviceWithoutAILTest, givenNoAILWhenCreateDeviceThenDeviceIsCreated) {
DebugManagerStateRestore dbgRestorer;
debugManager.flags.EnableAIL.set(false);
auto hwInfo = *defaultHwInfo;
setupDefaultFeatureTableAndWorkaroundTable(&hwInfo);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
EXPECT_NE(nullptr, device.get());
}