|
16 | 16 | #include "shared/test/common/mocks/mock_execution_environment.h" |
17 | 17 | #include "shared/test/common/mocks/mock_sip.h" |
18 | 18 |
|
| 19 | +#include "opencl/source/helpers/cl_hw_helper.h" |
19 | 20 | #include "opencl/source/platform/extensions.h" |
20 | 21 | #include "opencl/test/unit_test/fixtures/device_info_fixture.h" |
21 | 22 | #include "opencl/test/unit_test/helpers/hw_helper_tests.h" |
@@ -1684,6 +1685,31 @@ HWTEST_F(QueueFamilyNameTest, givenBcsWhenGettingQueueFamilyNameThenReturnProper |
1684 | 1685 | HWTEST_F(QueueFamilyNameTest, givenInvalidEngineGroupWhenGettingQueueFamilyNameThenReturnEmptyName) { |
1685 | 1686 | verify(EngineGroupType::MaxEngineGroups, ""); |
1686 | 1687 | } |
| 1688 | + |
| 1689 | +HWTEST_F(QueueFamilyNameTest, givenTooBigQueueFamilyNameWhenGettingQueueFamilyNameThenExceptionIsThrown) { |
| 1690 | + struct MockClHwHelper : NEO::ClHwHelperHw<FamilyType> { |
| 1691 | + bool getQueueFamilyName(std::string &name, EngineGroupType type) const override { |
| 1692 | + name = familyNameOverride; |
| 1693 | + return true; |
| 1694 | + } |
| 1695 | + std::string familyNameOverride = ""; |
| 1696 | + }; |
| 1697 | + |
| 1698 | + MockClHwHelper clHwHelper{}; |
| 1699 | + VariableBackup<ClHwHelper *> clHwHelperFactoryBackup{ |
| 1700 | + &NEO::clHwHelperFactory[static_cast<size_t>(defaultHwInfo->platform.eRenderCoreFamily)]}; |
| 1701 | + clHwHelperFactoryBackup = &clHwHelper; |
| 1702 | + |
| 1703 | + char name[CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL] = ""; |
| 1704 | + |
| 1705 | + clHwHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL - 1, 'a'); |
| 1706 | + device->getQueueFamilyName(name, EngineGroupType::MaxEngineGroups); |
| 1707 | + EXPECT_EQ(0, std::strcmp(name, clHwHelper.familyNameOverride.c_str())); |
| 1708 | + |
| 1709 | + clHwHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL, 'a'); |
| 1710 | + EXPECT_ANY_THROW(device->getQueueFamilyName(name, EngineGroupType::MaxEngineGroups)); |
| 1711 | +} |
| 1712 | + |
1687 | 1713 | HWCMDTEST_F(IGFX_GEN8_CORE, DeviceGetCapsTest, givenSysInfoWhenDeviceCreatedThenMaxWorkGroupCalculatedCorrectly) { |
1688 | 1714 | HardwareInfo myHwInfo = *defaultHwInfo; |
1689 | 1715 | GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; |
|
0 commit comments