2020-07-21 13:25:14 +02:00
|
|
|
/*
|
2023-01-03 11:46:57 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-07-21 13:25:14 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2023-02-06 09:05:43 +00:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2021-01-21 13:10:13 +01:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
|
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2020-07-21 13:25:14 +02:00
|
|
|
|
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
|
|
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
|
|
|
|
|
using DeviceNameTest = ::testing::Test;
|
|
|
|
|
|
2023-01-13 08:35:43 +01:00
|
|
|
TEST_F(DeviceNameTest, WhenCallingGetClDeviceNameThenReturnDeviceNameFromBaseDevice) {
|
|
|
|
|
{
|
|
|
|
|
auto clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
2020-07-21 13:25:14 +02:00
|
|
|
|
2023-01-13 08:35:43 +01:00
|
|
|
EXPECT_STREQ(clDevice->device.getDeviceName().c_str(), clDevice->getClDeviceName().c_str());
|
|
|
|
|
}
|
2020-07-21 13:25:14 +02:00
|
|
|
|
2023-01-13 08:35:43 +01:00
|
|
|
{
|
|
|
|
|
HardwareInfo localHwInfo = *defaultHwInfo;
|
|
|
|
|
localHwInfo.capabilityTable.deviceName = "Custom Device";
|
2020-11-09 17:35:33 +00:00
|
|
|
|
2023-01-13 08:35:43 +01:00
|
|
|
auto clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&localHwInfo));
|
|
|
|
|
EXPECT_STREQ(clDevice->device.getDeviceName().c_str(), clDevice->getClDeviceName().c_str());
|
|
|
|
|
}
|
2020-11-09 17:35:33 +00:00
|
|
|
}
|