diff --git a/unit_tests/os_interface/linux/device_factory_tests.h b/unit_tests/os_interface/linux/device_factory_tests.h index d1bc8c6a21..2764cd6208 100644 --- a/unit_tests/os_interface/linux/device_factory_tests.h +++ b/unit_tests/os_interface/linux/device_factory_tests.h @@ -39,7 +39,7 @@ using namespace OCLRT; struct DeviceFactoryLinuxTest : public ::testing::Test { void SetUp() override { - pDrm = new Drm2; + pDrm = new DrmMock; pDrm->setGtType(GTTYPE_GT2); pushDrmMock(pDrm); } @@ -49,5 +49,5 @@ struct DeviceFactoryLinuxTest : public ::testing::Test { delete pDrm; } - Drm2 *pDrm; + DrmMock *pDrm; }; diff --git a/unit_tests/os_interface/linux/drm_mock.h b/unit_tests/os_interface/linux/drm_mock.h index 3f16a2b780..31300722cc 100644 --- a/unit_tests/os_interface/linux/drm_mock.h +++ b/unit_tests/os_interface/linux/drm_mock.h @@ -36,13 +36,13 @@ using namespace OCLRT; static const int mockFd = 33; // Mock DRM class that responds to DRM_IOCTL_I915_GETPARAMs -class Drm2 : public Drm { +class DrmMock : public Drm { public: - Drm2() : Drm(mockFd) { + DrmMock() : Drm(mockFd) { sysFsDefaultGpuPathToRestore = nullptr; } - ~Drm2() { + ~DrmMock() { if (sysFsDefaultGpuPathToRestore != nullptr) { sysFsDefaultGpuPath = sysFsDefaultGpuPathToRestore; } diff --git a/unit_tests/os_interface/linux/drm_neo_create.cpp b/unit_tests/os_interface/linux/drm_neo_create.cpp index f7532ff957..885a938388 100644 --- a/unit_tests/os_interface/linux/drm_neo_create.cpp +++ b/unit_tests/os_interface/linux/drm_neo_create.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation + * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,9 +32,9 @@ namespace OCLRT { static std::vector drmMockStack; -class DrmMockDefault : public Drm2 { +class DrmMockDefault : public DrmMock { public: - DrmMockDefault() : Drm2() { + DrmMockDefault() : DrmMock() { StoredRetVal = 0; StoredRetValForDeviceID = 0; StoredRetValForEUVal = 0; diff --git a/unit_tests/os_interface/linux/drm_tests.cpp b/unit_tests/os_interface/linux/drm_tests.cpp index 15a109e4e9..5c40f78947 100644 --- a/unit_tests/os_interface/linux/drm_tests.cpp +++ b/unit_tests/os_interface/linux/drm_tests.cpp @@ -34,7 +34,7 @@ using namespace OCLRT; using namespace std; TEST(DrmTest, GetDeviceID) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x1234; @@ -46,7 +46,7 @@ TEST(DrmTest, GetDeviceID) { } TEST(DrmTest, GivenConfigFileWithWrongDeviceIDWhenFrequencyIsQueriedThenReturnZero) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x4321; @@ -60,7 +60,7 @@ TEST(DrmTest, GivenConfigFileWithWrongDeviceIDWhenFrequencyIsQueriedThenReturnZe } TEST(DrmTest, GivenConfigFileWithWrongDeviceIDFailIoctlWhenFrequencyIsQueriedThenReturnZero) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x4321; @@ -78,7 +78,7 @@ TEST(DrmTest, GivenValidConfigFileWhenFrequencyIsQueriedThenValidValueIsReturned int expectedMaxFrequency = 1000; - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x1234; @@ -98,7 +98,7 @@ TEST(DrmTest, GivenValidConfigFileWhenFrequencyIsQueriedThenValidValueIsReturned } TEST(DrmTest, GivenNoConfigFileWhenFrequencyIsQueriedThenReturnZero) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x1234; @@ -113,7 +113,7 @@ TEST(DrmTest, GivenNoConfigFileWhenFrequencyIsQueriedThenReturnZero) { } TEST(DrmTest, GetRevisionID) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); pDrm->StoredDeviceID = 0x1234; @@ -132,7 +132,7 @@ TEST(DrmTest, GetRevisionID) { } TEST(DrmTest, GivenMockDrmWhenAskedFor48BitAddressCorrectValueReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; pDrm->StoredPPGTT = 3; EXPECT_TRUE(pDrm->is48BitAddressRangeSupported()); pDrm->StoredPPGTT = 2; @@ -142,7 +142,7 @@ TEST(DrmTest, GivenMockDrmWhenAskedFor48BitAddressCorrectValueReturned) { #if defined(I915_PARAM_HAS_PREEMPTION) TEST(DrmTest, GivenMockDrmWhenAskedForPreemptionCorrectValueReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; pDrm->StoredPreemptionSupport = 1; EXPECT_TRUE(pDrm->hasPreemption()); pDrm->StoredPreemptionSupport = 0; @@ -151,7 +151,7 @@ TEST(DrmTest, GivenMockDrmWhenAskedForPreemptionCorrectValueReturned) { } TEST(DrmTest, GivenMockDrmWhenAskedForContextThatPassedThenValidContextIdsReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_EQ(0u, pDrm->lowPriorityContextId); pDrm->StoredRetVal = 0; pDrm->StoredCtxId = 2; @@ -163,7 +163,7 @@ TEST(DrmTest, GivenMockDrmWhenAskedForContextThatPassedThenValidContextIdsReturn } TEST(DrmTest, GivenMockDrmWhenAskedForContextThatFailsThenFalseIsReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; pDrm->StoredRetVal = -1; EXPECT_FALSE(pDrm->contextCreate()); pDrm->StoredRetVal = 0; @@ -171,7 +171,7 @@ TEST(DrmTest, GivenMockDrmWhenAskedForContextThatFailsThenFalseIsReturned) { } TEST(DrmTest, GivenMockDrmWhenAskedForContextWithLowPriorityThatFailsThenFalseIsReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_TRUE(pDrm->contextCreate()); pDrm->StoredRetVal = -1; EXPECT_FALSE(pDrm->setLowPriority()); @@ -181,7 +181,7 @@ TEST(DrmTest, GivenMockDrmWhenAskedForContextWithLowPriorityThatFailsThenFalseIs #endif TEST(DrmTest, getExecSoftPin) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; int execSoftPin = 0; int ret = pDrm->getExecSoftPin(execSoftPin); @@ -197,7 +197,7 @@ TEST(DrmTest, getExecSoftPin) { } TEST(DrmTest, enableTurboBoost) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; int ret = pDrm->enableTurboBoost(); EXPECT_EQ(0, ret); @@ -206,7 +206,7 @@ TEST(DrmTest, enableTurboBoost) { } TEST(DrmTest, getEnabledPooledEu) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; int enabled = 0; int ret = 0; @@ -239,7 +239,7 @@ TEST(DrmTest, getEnabledPooledEu) { } TEST(DrmTest, getMinEuInPool) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; pDrm->StoredMinEUinPool = -1; int minEUinPool = 0; @@ -272,7 +272,7 @@ TEST(DrmTest, getMinEuInPool) { } TEST(DrmTest, givenDrmWhenGetErrnoIsCalledThenErrnoValueIsReturned) { - Drm2 *pDrm = new Drm2; + DrmMock *pDrm = new DrmMock; EXPECT_NE(nullptr, pDrm); auto errnoFromDrm = pDrm->getErrno(); diff --git a/unit_tests/os_interface/linux/hw_info_config_tests.cpp b/unit_tests/os_interface/linux/hw_info_config_tests.cpp index 4dea18ef91..9989e8a396 100644 --- a/unit_tests/os_interface/linux/hw_info_config_tests.cpp +++ b/unit_tests/os_interface/linux/hw_info_config_tests.cpp @@ -70,7 +70,7 @@ void HwInfoConfigTestLinux::SetUp() { HwInfoConfigTest::SetUp(); osInterface = new OSInterface(); - drm = new Drm2(); + drm = new DrmMock(); osInterface->get()->setDrm(static_cast(drm)); drm->StoredDeviceID = pOldPlatform->usDeviceID; diff --git a/unit_tests/os_interface/linux/hw_info_config_tests.h b/unit_tests/os_interface/linux/hw_info_config_tests.h index f00504ac71..fd288e88c2 100644 --- a/unit_tests/os_interface/linux/hw_info_config_tests.h +++ b/unit_tests/os_interface/linux/hw_info_config_tests.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation + * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -38,7 +38,7 @@ struct HwInfoConfigTestLinux : public HwInfoConfigTest { OSInterface *osInterface; - Drm2 *drm; + DrmMock *drm; void (*rt_cpuidex_func)(int *, int, int); }; diff --git a/unit_tests/os_interface/linux/mock_performance_counters_linux.cpp b/unit_tests/os_interface/linux/mock_performance_counters_linux.cpp index b3075ba20a..8864721f9b 100644 --- a/unit_tests/os_interface/linux/mock_performance_counters_linux.cpp +++ b/unit_tests/os_interface/linux/mock_performance_counters_linux.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017, Intel Corporation +* Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -95,9 +95,9 @@ void PerformanceCountersFixture::createOsTime() { osTimeBase = std::unique_ptr(new MockOSTimeLinux(osInterfaceBase.get())); } void PerformanceCountersFixture::fillOsInterface() { - osInterfaceBase->get()->setDrm(new Drm2()); + osInterfaceBase->get()->setDrm(new DrmMock()); } void PerformanceCountersFixture::releaseOsInterface() { - delete static_cast(osInterfaceBase->get()->getDrm()); + delete static_cast(osInterfaceBase->get()->getDrm()); } } // namespace OCLRT diff --git a/unit_tests/os_interface/linux/performance_counters_linux_tests.cpp b/unit_tests/os_interface/linux/performance_counters_linux_tests.cpp index 437d4ce66e..769a0d0e52 100644 --- a/unit_tests/os_interface/linux/performance_counters_linux_tests.cpp +++ b/unit_tests/os_interface/linux/performance_counters_linux_tests.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017, Intel Corporation +* Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -35,7 +35,7 @@ struct PerformanceCountersLinuxTest : public PerformanceCountersFixture, PerformanceCountersFixture::SetUp(); PerfCounterFlagsLinux::resetPerfCountersFlags(); - drm = static_cast(osInterfaceBase->get()->getDrm()); + drm = static_cast(osInterfaceBase->get()->getDrm()); osTimeLinux = static_cast(osTimeBase.get()); } void TearDown() override { @@ -46,7 +46,7 @@ struct PerformanceCountersLinuxTest : public PerformanceCountersFixture, performanceCountersLinux = static_cast(performanceCountersBase.get()); } - Drm2 *drm; + DrmMock *drm; MockOSTimeLinux *osTimeLinux; MockPerformanceCountersLinux *performanceCountersLinux; };