2018-06-22 18:54:33 +08:00
|
|
|
/*
|
2020-01-07 14:42:40 +08:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-06-22 18:54:33 +08:00
|
|
|
|
2020-02-24 01:46:50 +08:00
|
|
|
#include "command_stream/preemption.h"
|
|
|
|
#include "compiler_interface/compiler_interface.h"
|
|
|
|
#include "device/device.h"
|
|
|
|
#include "execution_environment/execution_environment.h"
|
|
|
|
#include "gmm_helper/gmm_helper.h"
|
|
|
|
#include "helpers/hw_helper.h"
|
|
|
|
#include "os_interface/os_interface.h"
|
|
|
|
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
|
|
|
#include "unit_tests/utilities/destructor_counted.h"
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/aub/aub_center.h"
|
|
|
|
#include "opencl/source/built_ins/built_ins.h"
|
|
|
|
#include "opencl/source/memory_manager/os_agnostic_memory_manager.h"
|
|
|
|
#include "opencl/source/platform/platform.h"
|
|
|
|
#include "opencl/source/source_level_debugger/source_level_debugger.h"
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_device.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_execution_environment.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_memory_operations_handler.h"
|
2018-07-16 23:11:43 +08:00
|
|
|
#include "test.h"
|
2018-06-22 18:54:33 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-06-22 18:54:33 +08:00
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenDefaultConstructorWhenItIsCalledThenExecutionEnvironmentHasInitialRefCountZero) {
|
|
|
|
ExecutionEnvironment environment;
|
|
|
|
EXPECT_EQ(0, environment.getRefInternalCount());
|
|
|
|
EXPECT_EQ(0, environment.getRefApiCount());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenPlatformWhenItIsConstructedThenItCretesExecutionEnvironmentWithOneRefCountInternal) {
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
EXPECT_EQ(0, executionEnvironment->getRefInternalCount());
|
|
|
|
|
|
|
|
std::unique_ptr<Platform> platform(new Platform(*executionEnvironment));
|
|
|
|
EXPECT_EQ(executionEnvironment, platform->peekExecutionEnvironment());
|
|
|
|
EXPECT_EQ(1, executionEnvironment->getRefInternalCount());
|
2018-06-22 18:54:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenPlatformAndExecutionEnvironmentWithRefCountsWhenPlatformIsDestroyedThenExecutionEnvironmentIsNotDeleted) {
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
std::unique_ptr<Platform> platform(new Platform(*executionEnvironment));
|
2018-06-22 18:54:33 +08:00
|
|
|
executionEnvironment->incRefInternal();
|
|
|
|
platform.reset();
|
|
|
|
EXPECT_EQ(1, executionEnvironment->getRefInternalCount());
|
|
|
|
executionEnvironment->decRefInternal();
|
|
|
|
}
|
2018-06-27 17:35:37 +08:00
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenPlatformWhenItIsInitializedAndCreatesDevicesThenThoseDevicesAddRefcountsToExecutionEnvironment) {
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
std::unique_ptr<Platform> platform(new Platform(*executionEnvironment));
|
2018-06-27 17:35:37 +08:00
|
|
|
|
2019-10-07 18:42:28 +08:00
|
|
|
auto expectedRefCounts = executionEnvironment->getRefInternalCount();
|
2020-02-15 00:36:30 +08:00
|
|
|
platform->initialize(DeviceFactory::createDevices(*executionEnvironment));
|
2019-10-07 18:42:28 +08:00
|
|
|
EXPECT_LT(0u, platform->getDevice(0)->getNumAvailableDevices());
|
|
|
|
if (platform->getDevice(0)->getNumAvailableDevices() > 1) {
|
|
|
|
expectedRefCounts++;
|
|
|
|
}
|
|
|
|
expectedRefCounts += platform->getDevice(0)->getNumAvailableDevices();
|
|
|
|
EXPECT_EQ(expectedRefCounts, executionEnvironment->getRefInternalCount());
|
2018-06-27 17:35:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenDeviceThatHaveRefferencesAfterPlatformIsDestroyedThenDeviceIsStillUsable) {
|
2019-10-07 18:42:28 +08:00
|
|
|
DebugManagerStateRestore restorer;
|
|
|
|
DebugManager.flags.CreateMultipleSubDevices.set(1);
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
std::unique_ptr<Platform> platform(new Platform(*executionEnvironment));
|
2020-02-15 00:36:30 +08:00
|
|
|
platform->initialize(DeviceFactory::createDevices(*executionEnvironment));
|
2020-01-14 21:32:11 +08:00
|
|
|
auto device = platform->getClDevice(0);
|
2018-06-27 17:35:37 +08:00
|
|
|
EXPECT_EQ(1, device->getRefInternalCount());
|
|
|
|
device->incRefInternal();
|
|
|
|
platform.reset(nullptr);
|
|
|
|
EXPECT_EQ(1, device->getRefInternalCount());
|
|
|
|
EXPECT_EQ(1, executionEnvironment->getRefInternalCount());
|
|
|
|
|
|
|
|
device->decRefInternal();
|
2018-07-11 20:16:35 +08:00
|
|
|
}
|
|
|
|
|
2018-07-11 22:47:49 +08:00
|
|
|
TEST(ExecutionEnvironment, givenPlatformWhenItIsCreatedThenItCreatesMemoryManagerInExecutionEnvironment) {
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
Platform platform(*executionEnvironment);
|
2020-02-11 18:39:25 +08:00
|
|
|
size_t numRootDevices;
|
|
|
|
getDevices(numRootDevices, *executionEnvironment);
|
2020-02-15 00:36:30 +08:00
|
|
|
platform.initialize(DeviceFactory::createDevices(*executionEnvironment));
|
2018-07-11 22:47:49 +08:00
|
|
|
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
2018-07-12 14:07:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenDeviceWhenItIsDestroyedThenMemoryManagerIsStillAvailable) {
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-03-15 17:22:35 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2019-09-17 16:44:49 +08:00
|
|
|
std::unique_ptr<Device> device(Device::create<RootDevice>(executionEnvironment, 0u));
|
2018-07-12 14:07:23 +08:00
|
|
|
device.reset(nullptr);
|
|
|
|
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
2018-07-13 13:42:18 +08:00
|
|
|
}
|
|
|
|
|
2019-11-15 16:59:48 +08:00
|
|
|
TEST(RootDeviceEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCalledThenItIsReceivesCorrectInputParams) {
|
2018-11-26 06:58:12 +08:00
|
|
|
MockExecutionEnvironment executionEnvironment;
|
2019-01-23 18:59:54 +08:00
|
|
|
executionEnvironment.setHwInfo(*platformDevices);
|
2019-11-15 16:59:48 +08:00
|
|
|
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
|
|
|
|
rootDeviceEnvironment->initAubCenter(true, "test.aub", CommandStreamReceiverType::CSR_AUB);
|
|
|
|
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
|
|
|
|
EXPECT_TRUE(rootDeviceEnvironment->localMemoryEnabledReceived);
|
|
|
|
EXPECT_STREQ(rootDeviceEnvironment->aubFileNameReceived.c_str(), "test.aub");
|
2018-11-26 06:58:12 +08:00
|
|
|
}
|
|
|
|
|
2019-11-15 16:59:48 +08:00
|
|
|
TEST(RootDeviceEnvironment, givenUseAubStreamFalseWhenGetAubManagerIsCalledThenReturnNull) {
|
2018-12-11 00:12:32 +08:00
|
|
|
DebugManagerStateRestore dbgRestore;
|
|
|
|
DebugManager.flags.UseAubStream.set(false);
|
|
|
|
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-11-15 16:59:48 +08:00
|
|
|
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
|
|
|
rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB);
|
|
|
|
auto aubManager = rootDeviceEnvironment->aubCenter->getAubManager();
|
2018-11-27 10:17:57 +08:00
|
|
|
EXPECT_EQ(nullptr, aubManager);
|
|
|
|
}
|
|
|
|
|
2019-11-15 16:59:48 +08:00
|
|
|
TEST(RootDeviceEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCalledThenItIsInitalizedOnce) {
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-11-15 16:59:48 +08:00
|
|
|
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
|
|
|
rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB);
|
|
|
|
auto currentAubCenter = rootDeviceEnvironment->aubCenter.get();
|
2018-09-26 21:28:11 +08:00
|
|
|
EXPECT_NE(nullptr, currentAubCenter);
|
|
|
|
auto currentAubStreamProvider = currentAubCenter->getStreamProvider();
|
2018-09-20 06:36:44 +08:00
|
|
|
EXPECT_NE(nullptr, currentAubStreamProvider);
|
|
|
|
auto currentAubFileStream = currentAubStreamProvider->getStream();
|
|
|
|
EXPECT_NE(nullptr, currentAubFileStream);
|
2019-11-15 16:59:48 +08:00
|
|
|
rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB);
|
|
|
|
EXPECT_EQ(currentAubCenter, rootDeviceEnvironment->aubCenter.get());
|
|
|
|
EXPECT_EQ(currentAubStreamProvider, rootDeviceEnvironment->aubCenter->getStreamProvider());
|
|
|
|
EXPECT_EQ(currentAubFileStream, rootDeviceEnvironment->aubCenter->getStreamProvider()->getStream());
|
2018-09-20 06:36:44 +08:00
|
|
|
}
|
|
|
|
|
2018-10-12 21:20:02 +08:00
|
|
|
TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeMemoryManagerIsCalledThenLocalMemorySupportedInMemoryManagerHasCorrectValue) {
|
2019-02-12 17:56:27 +08:00
|
|
|
const HardwareInfo *hwInfo = platformDevices[0];
|
|
|
|
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(hwInfo));
|
2018-10-12 21:20:02 +08:00
|
|
|
auto executionEnvironment = device->getExecutionEnvironment();
|
2019-05-08 22:00:24 +08:00
|
|
|
auto enableLocalMemory = HwHelper::get(hwInfo->platform.eRenderCoreFamily).getEnableLocalMemory(*hwInfo);
|
2019-03-15 17:22:35 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2020-02-12 15:29:26 +08:00
|
|
|
EXPECT_EQ(enableLocalMemory, executionEnvironment->memoryManager->isLocalMemorySupported(device->getRootDeviceIndex()));
|
2018-10-12 21:20:02 +08:00
|
|
|
}
|
|
|
|
|
2018-09-11 21:55:04 +08:00
|
|
|
TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenInitializeMemoryManagerIsCalledThenItIsInitalized) {
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-03-15 17:22:35 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2018-09-11 21:55:04 +08:00
|
|
|
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
|
|
|
}
|
2019-10-24 19:34:25 +08:00
|
|
|
static_assert(sizeof(ExecutionEnvironment) == sizeof(std::mutex) +
|
2019-05-06 18:33:44 +08:00
|
|
|
sizeof(std::unique_ptr<HardwareInfo>) +
|
2019-10-23 22:17:06 +08:00
|
|
|
sizeof(std::vector<RootDeviceEnvironment>) +
|
2020-02-13 20:26:40 +08:00
|
|
|
(is64bit ? 56 : 32),
|
2019-02-15 16:25:08 +08:00
|
|
|
"New members detected in ExecutionEnvironment, please ensure that destruction sequence of objects is correct");
|
2018-07-13 13:42:18 +08:00
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDestroyedThenDeleteSequenceIsSpecified) {
|
2018-08-22 16:29:37 +08:00
|
|
|
uint32_t destructorId = 0u;
|
2018-08-01 15:06:46 +08:00
|
|
|
|
2018-08-22 16:29:37 +08:00
|
|
|
struct MockExecutionEnvironment : ExecutionEnvironment {
|
|
|
|
using ExecutionEnvironment::gmmHelper;
|
2018-07-13 13:42:18 +08:00
|
|
|
};
|
2019-11-05 20:38:20 +08:00
|
|
|
struct GmmHelperMock : public DestructorCounted<GmmHelper, 7> {
|
2019-12-19 23:24:26 +08:00
|
|
|
GmmHelperMock(uint32_t &destructorId, const HardwareInfo *hwInfo) : DestructorCounted(destructorId, nullptr, hwInfo) {}
|
2018-07-13 13:42:18 +08:00
|
|
|
};
|
2020-01-07 14:42:40 +08:00
|
|
|
struct MemoryMangerMock : public DestructorCounted<MockMemoryManager, 6> {
|
2019-03-28 22:42:23 +08:00
|
|
|
MemoryMangerMock(uint32_t &destructorId, ExecutionEnvironment &executionEnvironment) : DestructorCounted(destructorId, executionEnvironment) {}
|
2018-08-21 21:47:21 +08:00
|
|
|
};
|
2020-01-07 14:42:40 +08:00
|
|
|
struct OsInterfaceMock : public DestructorCounted<OSInterface, 5> {
|
|
|
|
OsInterfaceMock(uint32_t &destructorId) : DestructorCounted(destructorId) {}
|
|
|
|
};
|
2019-11-28 20:02:11 +08:00
|
|
|
struct MemoryOperationsHandlerMock : public DestructorCounted<MockMemoryOperationsHandler, 4> {
|
|
|
|
MemoryOperationsHandlerMock(uint32_t &destructorId) : DestructorCounted(destructorId) {}
|
|
|
|
};
|
2019-11-05 20:38:20 +08:00
|
|
|
struct AubCenterMock : public DestructorCounted<AubCenter, 3> {
|
2019-02-08 22:08:35 +08:00
|
|
|
AubCenterMock(uint32_t &destructorId) : DestructorCounted(destructorId, platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB) {}
|
2018-09-20 06:36:44 +08:00
|
|
|
};
|
2018-08-22 16:29:37 +08:00
|
|
|
struct BuiltinsMock : public DestructorCounted<BuiltIns, 2> {
|
|
|
|
BuiltinsMock(uint32_t &destructorId) : DestructorCounted(destructorId) {}
|
2018-07-12 21:47:48 +08:00
|
|
|
};
|
2018-08-22 16:29:37 +08:00
|
|
|
struct CompilerInterfaceMock : public DestructorCounted<CompilerInterface, 1> {
|
|
|
|
CompilerInterfaceMock(uint32_t &destructorId) : DestructorCounted(destructorId) {}
|
|
|
|
};
|
|
|
|
struct SourceLevelDebuggerMock : public DestructorCounted<SourceLevelDebugger, 0> {
|
|
|
|
SourceLevelDebuggerMock(uint32_t &destructorId) : DestructorCounted(destructorId, nullptr) {}
|
2018-07-13 13:42:18 +08:00
|
|
|
};
|
|
|
|
|
2018-08-22 16:29:37 +08:00
|
|
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
2019-03-28 22:42:23 +08:00
|
|
|
executionEnvironment->setHwInfo(*platformDevices);
|
2019-11-15 16:59:48 +08:00
|
|
|
executionEnvironment->prepareRootDeviceEnvironments(1);
|
2018-08-22 16:29:37 +08:00
|
|
|
executionEnvironment->gmmHelper = std::make_unique<GmmHelperMock>(destructorId, platformDevices[0]);
|
2020-01-07 14:42:40 +08:00
|
|
|
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OsInterfaceMock>(destructorId);
|
2019-11-28 20:02:11 +08:00
|
|
|
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique<MemoryOperationsHandlerMock>(destructorId);
|
2019-03-28 22:42:23 +08:00
|
|
|
executionEnvironment->memoryManager = std::make_unique<MemoryMangerMock>(destructorId, *executionEnvironment);
|
2019-11-15 16:59:48 +08:00
|
|
|
executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::make_unique<AubCenterMock>(destructorId);
|
2018-08-22 16:29:37 +08:00
|
|
|
executionEnvironment->builtins = std::make_unique<BuiltinsMock>(destructorId);
|
|
|
|
executionEnvironment->compilerInterface = std::make_unique<CompilerInterfaceMock>(destructorId);
|
2020-02-10 22:57:49 +08:00
|
|
|
executionEnvironment->debugger = std::make_unique<SourceLevelDebuggerMock>(destructorId);
|
2018-07-13 13:42:18 +08:00
|
|
|
|
|
|
|
executionEnvironment.reset(nullptr);
|
2019-11-05 20:38:20 +08:00
|
|
|
EXPECT_EQ(8u, destructorId);
|
2018-07-16 19:01:10 +08:00
|
|
|
}
|
2018-07-17 17:11:48 +08:00
|
|
|
|
2019-10-24 19:34:25 +08:00
|
|
|
TEST(ExecutionEnvironment, givenMultipleRootDevicesWhenTheyAreCreatedTheyAllReuseTheSameMemoryManager) {
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-11-15 16:59:48 +08:00
|
|
|
executionEnvironment->prepareRootDeviceEnvironments(2);
|
2019-05-06 18:33:44 +08:00
|
|
|
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(executionEnvironment, 0u));
|
2019-07-15 20:28:09 +08:00
|
|
|
auto &commandStreamReceiver = device->getGpgpuCommandStreamReceiver();
|
2018-07-17 17:11:48 +08:00
|
|
|
auto memoryManager = device->getMemoryManager();
|
|
|
|
|
2019-05-06 18:33:44 +08:00
|
|
|
std::unique_ptr<MockDevice> device2(Device::create<MockDevice>(executionEnvironment, 1u));
|
2019-07-15 20:28:09 +08:00
|
|
|
EXPECT_NE(&commandStreamReceiver, &device2->getGpgpuCommandStreamReceiver());
|
2018-07-17 17:11:48 +08:00
|
|
|
EXPECT_EQ(memoryManager, device2->getMemoryManager());
|
|
|
|
}
|
2018-08-17 19:38:09 +08:00
|
|
|
|
2019-02-19 15:55:11 +08:00
|
|
|
TEST(ExecutionEnvironment, givenUnproperSetCsrFlagValueWhenInitializingMemoryManagerThenCreateDefaultMemoryManager) {
|
|
|
|
DebugManagerStateRestore restorer;
|
|
|
|
DebugManager.flags.SetCommandStreamReceiver.set(10);
|
|
|
|
|
2019-03-28 22:42:23 +08:00
|
|
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>(*platformDevices);
|
2019-03-15 17:22:35 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2019-02-19 15:55:11 +08:00
|
|
|
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
|
|
|
}
|
2019-12-17 15:11:16 +08:00
|
|
|
|
|
|
|
TEST(ExecutionEnvironment, whenCalculateMaxOsContexCountThenGlobalVariableHasProperValue) {
|
2020-02-12 18:27:28 +08:00
|
|
|
VariableBackup<uint32_t> osContextCountBackup(&MemoryManager::maxOsContextCount, 0);
|
2019-12-17 15:11:16 +08:00
|
|
|
uint32_t numRootDevices = 17u;
|
2020-02-12 18:27:28 +08:00
|
|
|
MockExecutionEnvironment executionEnvironment(nullptr, true, numRootDevices);
|
|
|
|
|
|
|
|
auto expectedOsContextCount = 0u;
|
|
|
|
for (const auto &rootDeviceEnvironment : executionEnvironment.rootDeviceEnvironments) {
|
|
|
|
auto &hwHelper = HwHelper::get(rootDeviceEnvironment->getHardwareInfo()->platform.eRenderCoreFamily);
|
|
|
|
auto osContextCount = hwHelper.getGpgpuEngineInstances().size();
|
|
|
|
auto subDevicesCount = HwHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo());
|
|
|
|
bool hasRootCsr = subDevicesCount > 1;
|
|
|
|
expectedOsContextCount += static_cast<uint32_t>(osContextCount * subDevicesCount + hasRootCsr);
|
|
|
|
}
|
2019-12-17 15:11:16 +08:00
|
|
|
|
|
|
|
EXPECT_EQ(expectedOsContextCount, MemoryManager::maxOsContextCount);
|
|
|
|
}
|
2020-01-30 22:04:19 +08:00
|
|
|
TEST(RootDeviceEnvironment, whenGetHardwareInfoIsCalledThenHardwareInfoIsTakenFromExecutionEnvironment) {
|
|
|
|
ExecutionEnvironment executionEnvironment;
|
|
|
|
HardwareInfo hwInfo = {};
|
|
|
|
executionEnvironment.setHwInfo(&hwInfo);
|
|
|
|
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
|
|
|
EXPECT_EQ(rootDeviceEnvironment.getHardwareInfo(), executionEnvironment.getHardwareInfo());
|
|
|
|
}
|