fix: Append device id to ambigous device names

Related-To: NEO-7537
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-01-13 08:35:43 +01:00
committed by Compute-Runtime-Automation
parent e8b0024b5c
commit 91a9b925f7
10 changed files with 56 additions and 28 deletions

View File

@@ -55,6 +55,25 @@ TEST(Device, givenNoDebuggerWhenGettingDebuggerThenNullptrIsReturned) {
EXPECT_EQ(nullptr, device->getSourceLevelDebugger());
}
TEST(Device, givenDeviceWithBrandingStringNameWhenGettingDeviceNameThenBrandingStringIsReturned) {
auto hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.deviceName = "Custom Device";
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
EXPECT_STREQ("Custom Device", device->getDeviceName().c_str());
}
TEST(Device, givenDeviceWithoutBrandingStringNameWhenGettingDeviceNameThenGenericNameWithHexadecimalDeviceIdIsReturned) {
auto hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.deviceName = "";
hwInfo.platform.usDeviceID = 0x1AB;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
EXPECT_STREQ("Intel(R) Graphics [0x01ab]", device->getDeviceName().c_str());
}
using DeviceTest = Test<DeviceFixture>;
TEST_F(DeviceTest, whenInitializeRayTracingIsCalledAndRtBackedBufferIsNullptrThenMemoryBackedBufferIsCreated) {