mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-15 10:14:56 +08:00
Remove usage of TestLegacy from shared tests
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cb23a38aad
commit
bfc0919999
@@ -30,10 +30,10 @@ struct HardwareParse {
|
||||
itorGpgpuCsrBaseAddress = cmdList.end();
|
||||
}
|
||||
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
}
|
||||
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
cmdList.clear();
|
||||
lriList.clear();
|
||||
pipeControlList.clear();
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
namespace NEO {
|
||||
|
||||
struct LinearStreamFixture {
|
||||
LinearStreamFixture(void)
|
||||
LinearStreamFixture()
|
||||
: gfxAllocation(static_cast<void *>(pCmdBuffer), sizeof(pCmdBuffer)), linearStream(&gfxAllocation) {
|
||||
}
|
||||
|
||||
virtual void SetUp(void) { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
}
|
||||
|
||||
virtual void TearDown(void) { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
}
|
||||
MockGraphicsAllocation gfxAllocation;
|
||||
LinearStream linearStream;
|
||||
uint32_t pCmdBuffer[1024]{};
|
||||
};
|
||||
|
||||
typedef TestLegacy<LinearStreamFixture> LinearStreamTest;
|
||||
using LinearStreamTest = Test<LinearStreamFixture>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
void MemoryManagerWithCsrFixture::SetUp() {
|
||||
void MemoryManagerWithCsrFixture::setUp() {
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
|
||||
@@ -31,5 +31,5 @@ void MemoryManagerWithCsrFixture::SetUp() {
|
||||
csr->setupContext(*osContext);
|
||||
}
|
||||
|
||||
void MemoryManagerWithCsrFixture::TearDown() {
|
||||
void MemoryManagerWithCsrFixture::tearDown() {
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ class MemoryManagerWithCsrFixture {
|
||||
|
||||
~MemoryManagerWithCsrFixture() = default;
|
||||
|
||||
void SetUp(); // NOLINT(readability-identifier-naming)
|
||||
void TearDown(); // NOLINT(readability-identifier-naming)
|
||||
void setUp();
|
||||
void tearDown();
|
||||
};
|
||||
|
||||
@@ -65,11 +65,11 @@ template <typename DrmClass>
|
||||
class DrmBufferObjectFixture {
|
||||
public:
|
||||
std::unique_ptr<DrmClass> mock;
|
||||
TestedBufferObject *bo;
|
||||
ExecObject execObjectsStorage[256];
|
||||
TestedBufferObject *bo = nullptr;
|
||||
ExecObject execObjectsStorage[256]{};
|
||||
std::unique_ptr<OsContextLinux> osContext;
|
||||
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
this->mock = std::make_unique<DrmClass>(*executionEnvironment.rootDeviceEnvironments[0]);
|
||||
ASSERT_NE(nullptr, this->mock);
|
||||
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock.get(), 0u);
|
||||
@@ -79,7 +79,7 @@ class DrmBufferObjectFixture {
|
||||
ASSERT_NE(nullptr, bo);
|
||||
}
|
||||
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
delete bo;
|
||||
if (this->mock->ioctl_expected.total >= 0) {
|
||||
EXPECT_EQ(this->mock->ioctl_expected.total, this->mock->ioctl_cnt.total);
|
||||
|
||||
@@ -665,7 +665,7 @@ HWTEST_F(CommandStreamReceiverTest, givenUpdateTaskCountFromWaitInMultiRootDevic
|
||||
}
|
||||
|
||||
struct InitDirectSubmissionFixture {
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
DebugManager.flags.EnableDirectSubmission.set(1);
|
||||
executionEnvironment = new MockExecutionEnvironment();
|
||||
DeviceFactory::prepareDeviceEnvironments(*executionEnvironment);
|
||||
@@ -675,14 +675,14 @@ struct InitDirectSubmissionFixture {
|
||||
device.reset(new MockDevice(executionEnvironment, 0u));
|
||||
}
|
||||
|
||||
void TearDown() {} // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {}
|
||||
|
||||
DebugManagerStateRestore restore;
|
||||
MockExecutionEnvironment *executionEnvironment;
|
||||
std::unique_ptr<MockDevice> device;
|
||||
};
|
||||
|
||||
using InitDirectSubmissionTest = TestLegacy<InitDirectSubmissionFixture>;
|
||||
using InitDirectSubmissionTest = Test<InitDirectSubmissionFixture>;
|
||||
|
||||
HWTEST_F(InitDirectSubmissionTest, givenDirectSubmissionControllerEnabledWhenInitDirectSubmissionThenCsrIsRegistered) {
|
||||
DebugManagerStateRestore restorer;
|
||||
|
||||
@@ -63,7 +63,7 @@ class CommandEncodeStatesFixture : public DeviceFixture {
|
||||
} // namespace NEO
|
||||
|
||||
struct WalkerThreadFixture {
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
startWorkGroup[0] = startWorkGroup[1] = startWorkGroup[2] = 0u;
|
||||
numWorkGroups[0] = numWorkGroups[1] = numWorkGroups[2] = 1u;
|
||||
workGroupSizes[0] = 32u;
|
||||
@@ -72,7 +72,7 @@ struct WalkerThreadFixture {
|
||||
localIdDimensions = 3u;
|
||||
requiredWorkGroupOrder = 0u;
|
||||
}
|
||||
void TearDown() {} // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {}
|
||||
|
||||
uint32_t startWorkGroup[3];
|
||||
uint32_t numWorkGroups[3];
|
||||
@@ -82,4 +82,4 @@ struct WalkerThreadFixture {
|
||||
uint32_t requiredWorkGroupOrder;
|
||||
};
|
||||
|
||||
using WalkerThreadTest = TestLegacy<WalkerThreadFixture>;
|
||||
using WalkerThreadTest = Test<WalkerThreadFixture>;
|
||||
|
||||
@@ -17,17 +17,17 @@ using namespace NEO;
|
||||
|
||||
class AddressMapperFixture {
|
||||
public:
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
mapper = new AddressMapper();
|
||||
}
|
||||
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
delete mapper;
|
||||
}
|
||||
AddressMapper *mapper;
|
||||
};
|
||||
|
||||
typedef TestLegacy<AddressMapperFixture> AddressMapperTests;
|
||||
using AddressMapperTests = Test<AddressMapperFixture>;
|
||||
|
||||
TEST_F(AddressMapperTests, GivenAlignedPointersWhenMappingThenPointersAreAligned) {
|
||||
uint32_t m1 = mapper->map((void *)0x1000, MemoryConstants::pageSize);
|
||||
|
||||
@@ -832,7 +832,7 @@ TEST_F(HostPtrManagerTest, GivenHostPtrManagerFilledWithFragmentsWhenAskedForOve
|
||||
EXPECT_NE(nullptr, fragment3);
|
||||
}
|
||||
|
||||
using HostPtrAllocationTest = TestLegacy<MemoryManagerWithCsrFixture>;
|
||||
using HostPtrAllocationTest = Test<MemoryManagerWithCsrFixture>;
|
||||
|
||||
TEST_F(HostPtrAllocationTest, givenTwoAllocationsThatSharesOneFragmentWhenOneIsDestroyedThenFragmentRemains) {
|
||||
|
||||
|
||||
@@ -107,11 +107,11 @@ class PageTableFixture {
|
||||
uint64_t startAddress = 0x1000;
|
||||
|
||||
public:
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
startAddress = 0x1000;
|
||||
}
|
||||
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
}
|
||||
};
|
||||
|
||||
@@ -136,9 +136,9 @@ void PageTableEntryChecker::testEntry<MockPDPE>(MockPDPE *pageTable, uint32_t pt
|
||||
EXPECT_EQ(reinterpret_cast<void *>(expectedValue), pageTable->entries[0]->entries[0]->entries[pteIndex]);
|
||||
}
|
||||
|
||||
typedef TestLegacy<PageTableFixture> PageTableTests32;
|
||||
typedef TestLegacy<PageTableFixture> PageTableTests48;
|
||||
typedef TestLegacy<PageTableFixture> PageTableTestsGPU;
|
||||
using PageTableTests32 = Test<PageTableFixture>;
|
||||
using PageTableTests48 = Test<PageTableFixture>;
|
||||
using PageTableTestsGPU = Test<PageTableFixture>;
|
||||
|
||||
TEST_F(PageTableTests48, WhenPageTableIsCreatedThenWalkerIsDummy) {
|
||||
PageTable<void, 0, 9> pt(&allocator);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using namespace NEO;
|
||||
|
||||
using DrmMockBufferObjectFixture = DrmBufferObjectFixture<DrmMockCustom>;
|
||||
using DrmBufferObjectTest = TestLegacy<DrmMockBufferObjectFixture>;
|
||||
using DrmBufferObjectTest = Test<DrmMockBufferObjectFixture>;
|
||||
|
||||
TEST_F(DrmBufferObjectTest, WhenCallingExecThenReturnIsCorrect) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
using namespace NEO;
|
||||
|
||||
using DrmBufferObjectPrelimFixture = DrmBufferObjectFixture<DrmMockCustomPrelim>;
|
||||
using DrmBufferObjectPrelimTest = TestLegacy<DrmBufferObjectPrelimFixture>;
|
||||
using DrmBufferObjectPrelimTest = Test<DrmBufferObjectPrelimFixture>;
|
||||
|
||||
TEST_F(DrmBufferObjectPrelimTest, GivenCompletionAddressWhenCallingExecThenReturnIsCorrect) {
|
||||
mock->ioctl_expected.total = 1;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
using namespace NEO;
|
||||
|
||||
struct DrmCommandStreamMultiTileMemExecFixture {
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2u);
|
||||
DebugManager.flags.EnableImplicitScaling.set(1);
|
||||
DebugManager.flags.EnableForcePin.set(false);
|
||||
@@ -57,7 +57,7 @@ struct DrmCommandStreamMultiTileMemExecFixture {
|
||||
device.reset(MockDevice::create<MockDevice>(executionEnvironment, 0));
|
||||
}
|
||||
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
executionEnvironment->decRefInternal();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ struct DrmCommandStreamMultiTileMemExecFixture {
|
||||
DrmMemoryManager *memoryManager = nullptr;
|
||||
};
|
||||
|
||||
using DrmCommandStreamMultiTileMemExecTest = TestLegacy<DrmCommandStreamMultiTileMemExecFixture>;
|
||||
using DrmCommandStreamMultiTileMemExecTest = Test<DrmCommandStreamMultiTileMemExecFixture>;
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DrmCommandStreamMultiTileMemExecTest, GivenDrmSupportsCompletionFenceAndVmBindWhenCallingCsrExecThenMultipleTagAllocationIsPassed) {
|
||||
auto *testCsr = new TestedDrmCommandStreamReceiver<FamilyType>(*executionEnvironment, 0, device->getDeviceBitfield());
|
||||
|
||||
@@ -86,7 +86,7 @@ TEST(MemoryInfoPrelim, givenNewMemoryInfoQuerySupportedWhenQueryingMemoryInfoThe
|
||||
}
|
||||
|
||||
struct DrmVmTestFixture {
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(NEO::defaultHwInfo.get());
|
||||
@@ -104,7 +104,7 @@ struct DrmVmTestFixture {
|
||||
ASSERT_NE(nullptr, drm);
|
||||
}
|
||||
|
||||
void TearDown() {} // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {}
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
std::unique_ptr<ExecutionEnvironment> executionEnvironment;
|
||||
@@ -115,7 +115,7 @@ struct DrmVmTestFixture {
|
||||
static constexpr uint8_t tileCount = 4u;
|
||||
};
|
||||
|
||||
using DrmVmTestTest = TestLegacy<DrmVmTestFixture>;
|
||||
using DrmVmTestTest = Test<DrmVmTestFixture>;
|
||||
|
||||
TEST_F(DrmVmTestTest, givenNewMemoryInfoQuerySupportedWhenCreatingVirtualMemoryThenVmCreatedUsingNewRegion) {
|
||||
DebugManager.flags.EnableLocalMemory.set(1);
|
||||
|
||||
@@ -23,7 +23,7 @@ class DrmMemManagerFixture {
|
||||
void forceLimitedRangeAllocator(uint32_t rootDeviceIndex, uint64_t range) { getGfxPartition(rootDeviceIndex)->init(range, 0, 0, gfxPartitions.size(), true); }
|
||||
};
|
||||
|
||||
void SetUp() { // NOLINT(readability-identifier-naming)
|
||||
void setUp() {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.UseExternalAllocatorForSshAndDsh.set(true);
|
||||
executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
@@ -34,13 +34,13 @@ class DrmMemManagerFixture {
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(new DrmMock(*executionEnvironment->rootDeviceEnvironments[0])));
|
||||
memManager = std::unique_ptr<FrontWindowMemManagerMock>(new FrontWindowMemManagerMock(*executionEnvironment));
|
||||
}
|
||||
void TearDown() { // NOLINT(readability-identifier-naming)
|
||||
void tearDown() {
|
||||
}
|
||||
std::unique_ptr<FrontWindowMemManagerMock> memManager;
|
||||
std::unique_ptr<ExecutionEnvironment> executionEnvironment;
|
||||
};
|
||||
|
||||
using DrmFrontWindowPoolAllocatorTests = TestLegacy<DrmMemManagerFixture>;
|
||||
using DrmFrontWindowPoolAllocatorTests = Test<DrmMemManagerFixture>;
|
||||
|
||||
TEST_F(DrmFrontWindowPoolAllocatorTests, givenAllocateInSpecialPoolFlagWhenDrmAllocate32BitGraphicsMemoryThenAllocateAtHeapBegining) {
|
||||
AllocationData allocData = {};
|
||||
|
||||
@@ -19,11 +19,11 @@ struct PreambleFixture : public DeviceFixture,
|
||||
public ::testing::Test {
|
||||
void SetUp() override {
|
||||
DeviceFixture::setUp();
|
||||
HardwareParse::SetUp();
|
||||
HardwareParse::setUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
HardwareParse::TearDown();
|
||||
HardwareParse::tearDown();
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
};
|
||||
@@ -35,17 +35,17 @@ class PreambleVfeState : public DeviceFixture,
|
||||
public:
|
||||
void SetUp() override {
|
||||
::testing::Test::SetUp();
|
||||
LinearStreamFixture::SetUp();
|
||||
HardwareParse::SetUp();
|
||||
LinearStreamFixture::setUp();
|
||||
HardwareParse::setUp();
|
||||
DeviceFixture::setUp();
|
||||
testWaTable = &pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo()->workaroundTable;
|
||||
}
|
||||
void TearDown() override {
|
||||
DeviceFixture::tearDown();
|
||||
HardwareParse::TearDown();
|
||||
LinearStreamFixture::TearDown();
|
||||
HardwareParse::tearDown();
|
||||
LinearStreamFixture::tearDown();
|
||||
::testing::Test::TearDown();
|
||||
}
|
||||
|
||||
WorkaroundTable *testWaTable;
|
||||
WorkaroundTable *testWaTable = nullptr;
|
||||
};
|
||||
|
||||
@@ -19,11 +19,11 @@ using namespace NEO;
|
||||
|
||||
struct XeHPSlm : HardwareParse, ::testing::Test {
|
||||
void SetUp() override {
|
||||
HardwareParse::SetUp();
|
||||
HardwareParse::setUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
HardwareParse::TearDown();
|
||||
HardwareParse::tearDown();
|
||||
}
|
||||
|
||||
uint32_t cmdBuffer[1024]{};
|
||||
@@ -137,4 +137,4 @@ XEHPTEST_F(XeHPPipelineSelect, WhenProgramPipelineSelectThenProgramMediaSamplerD
|
||||
|
||||
EXPECT_TRUE(cmd.getMediaSamplerDopClockGateEnable());
|
||||
EXPECT_EQ(expectedSubMask, (cmd.getMaskBits() & expectedSubMask));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user