|
19 | 19 | #include "unit_tests/fixtures/device_fixture.h" |
20 | 20 | #include "unit_tests/helpers/debug_manager_state_restore.h" |
21 | 21 | #include "unit_tests/helpers/hw_helper_tests.h" |
| 22 | +#include "unit_tests/helpers/variable_backup.h" |
22 | 23 | #include "unit_tests/mocks/mock_builtins.h" |
23 | 24 | #include "unit_tests/mocks/mock_device.h" |
24 | 25 |
|
@@ -767,6 +768,30 @@ TEST(Device_GetCaps, givenDeviceWithNullSourceLevelDebuggerWhenCapsAreInitialize |
767 | 768 |
|
768 | 769 | typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest; |
769 | 770 |
|
| 771 | +TEST_F(DeviceCapsWithModifiedHwInfoTest, GivenLocalMemorySupportedAndOsEnableLocalMemoryWhenSetThenGetEnableLocalMemoryReturnCorrectValue) { |
| 772 | + VariableBackup<bool> orgOsEnableLocalMemory(&OSInterface::osEnableLocalMemory); |
| 773 | + std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); |
| 774 | + bool orgHwCapsLocalMemorySupported = device->getHardwareCapabilities().localMemorySupported; |
| 775 | + |
| 776 | + device->setHWCapsLocalMemorySupported(false); |
| 777 | + OSInterface::osEnableLocalMemory = false; |
| 778 | + EXPECT_FALSE(device->getEnableLocalMemory()); |
| 779 | + |
| 780 | + device->setHWCapsLocalMemorySupported(false); |
| 781 | + OSInterface::osEnableLocalMemory = true; |
| 782 | + EXPECT_FALSE(device->getEnableLocalMemory()); |
| 783 | + |
| 784 | + device->setHWCapsLocalMemorySupported(true); |
| 785 | + OSInterface::osEnableLocalMemory = false; |
| 786 | + EXPECT_FALSE(device->getEnableLocalMemory()); |
| 787 | + |
| 788 | + device->setHWCapsLocalMemorySupported(true); |
| 789 | + OSInterface::osEnableLocalMemory = true; |
| 790 | + EXPECT_TRUE(device->getEnableLocalMemory()); |
| 791 | + |
| 792 | + device->setHWCapsLocalMemorySupported(orgHwCapsLocalMemorySupported); |
| 793 | +} |
| 794 | + |
770 | 795 | TEST_F(DeviceCapsWithModifiedHwInfoTest, givenPlatformWithSourceLevelDebuggerNotSupportedWhenDeviceIsCreatedThenSourceLevelDebuggerActiveIsSetToFalse) { |
771 | 796 |
|
772 | 797 | hwInfo.capabilityTable.sourceLevelDebuggerSupported = false; |
|
0 commit comments