Rename getDevices functions

getDevices -> prepareDeviceEnvironments

Change-Id: Ie5bbc0e9f1fe9b1c34ba012249ffa33c4d2ebd05
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-23 09:13:25 +01:00
committed by sys_ocldev
parent 38f53cab8a
commit 688c95ce3c
24 changed files with 90 additions and 91 deletions

View File

@ -10,29 +10,28 @@
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/device_factory.h"
#include "opencl/source/platform/platform.h"
#include "test.h"
using namespace NEO;
using GetDevicesTests = ::testing::Test;
using PrepareDeviceEnvironmentsTests = ::testing::Test;
HWTEST_F(GetDevicesTests, WhenGetDevicesIsCalledThenSuccessIsReturned) {
HWTEST_F(PrepareDeviceEnvironmentsTests, WhenPrepareDeviceEnvironmentsIsCalledThenSuccessIsReturned) {
ExecutionEnvironment executionEnvironment;
auto returnValue = DeviceFactory::getDevices(executionEnvironment);
auto returnValue = DeviceFactory::prepareDeviceEnvironments(executionEnvironment);
EXPECT_EQ(true, returnValue);
}
HWTEST_F(GetDevicesTests, whenGetDevicesIsCalledThenGmmIsBeingInitializedAfterFillingHwInfo) {
platformsImpl.clear();
auto executionEnvironment = new ExecutionEnvironment();
platformsImpl.push_back(std::make_unique<Platform>(*executionEnvironment));
executionEnvironment->prepareRootDeviceEnvironments(1u);
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
HWTEST_F(PrepareDeviceEnvironmentsTests, whenPrepareDeviceEnvironmentsIsCalledThenGmmIsBeingInitializedAfterFillingHwInfo) {
ExecutionEnvironment executionEnvironment;
executionEnvironment.prepareRootDeviceEnvironments(1u);
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo();
hwInfo->platform.eProductFamily = PRODUCT_FAMILY::IGFX_UNKNOWN;
hwInfo->platform.ePCHProductFamily = PCH_PRODUCT_FAMILY::PCH_UNKNOWN;
EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper());
auto returnValue = DeviceFactory::getDevices(*executionEnvironment);
auto returnValue = DeviceFactory::prepareDeviceEnvironments(executionEnvironment);
EXPECT_TRUE(returnValue);
EXPECT_NE(nullptr, executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper());
}