Remove HwInfoConfigTest's dependency on PlatformFixture

Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
This commit is contained in:
Daniel Chabrowski 2022-05-26 18:18:42 +00:00 committed by Compute-Runtime-Automation
parent 8431234845
commit ec6d580a27
2 changed files with 10 additions and 16 deletions

View File

@ -12,12 +12,12 @@
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/mocks/mock_gmm.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/unit_test/helpers/gtest_helpers.h"
#include "shared/test/unit_test/utilities/base_object_utils.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/sampler/sampler.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
@ -26,9 +26,7 @@
using namespace NEO;
void HwInfoConfigTest::SetUp() {
PlatformFixture::SetUp();
pInHwInfo = pPlatform->getClDevice(0)->getHardwareInfo();
pInHwInfo = *defaultHwInfo;
testPlatform = &pInHwInfo.platform;
testSkuTable = &pInHwInfo.featureTable;
@ -38,10 +36,6 @@ void HwInfoConfigTest::SetUp() {
outHwInfo = {};
}
void HwInfoConfigTest::TearDown() {
PlatformFixture::TearDown();
}
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
DebugManagerStateRestore restore;
@ -449,7 +443,12 @@ HWTEST_F(HwInfoConfigTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequir
EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
MockGmm mockGmm(pPlatform->getClDevice(0)->getGmmHelper(), nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true);
MockExecutionEnvironment executionEnvironment(&hwInfo);
executionEnvironment.initGmm();
executionEnvironment.prepareRootDeviceEnvironments(1);
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
MockGmm mockGmm(gmmHelper, nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true);
mockGmm.resourceParams.Flags.Info.NotLockable = true;
graphicsAllocation.setDefaultGmm(&mockGmm);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,19 +7,14 @@
#pragma once
#include "shared/source/device/device.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
#include "gtest/gtest.h"
using namespace NEO;
struct HwInfoConfigTest : public ::testing::Test,
public PlatformFixture {
struct HwInfoConfigTest : public ::testing::Test {
void SetUp() override;
void TearDown() override;
HardwareInfo pInHwInfo;
HardwareInfo outHwInfo;