[Sysman] Replace normal pointers with smart pointers (12/n)

Replacing normal pointers by smart pointers in engine module
of LO sysman(zesinit).

Related-To: LOCI-2810

Signed-off-by: Singh, Prasoon <prasoon.singh@intel.com>
This commit is contained in:
Singh, Prasoon
2023-04-05 12:03:10 +00:00
committed by Compute-Runtime-Automation
parent afe99d7dbc
commit 88fe17e50a
10 changed files with 15 additions and 54 deletions

View File

@@ -45,10 +45,6 @@ class ZesEngineFixture : public SysmanDeviceFixture {
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
pFsAccess->mockReadVal = 23;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
device = pSysmanDevice;
@@ -151,8 +147,6 @@ TEST_F(ZesEngineFixture, GivenTestDiscreteDevicesAndValidEngineHandleWhenCalling
auto pOsEngineTest2 = L0::Sysman::OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest2->getActivity(&stats));
delete pOsEngineTest1;
delete pOsEngineTest2;
}
TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCallingZesEngineGetActivityAndPMUGetEventTypeFailsThenVerifyEngineGetActivityReturnsFailure) {
@@ -162,7 +156,6 @@ TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCalli
auto pOsEngineTest1 = L0::Sysman::OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest1->getActivity(&stats));
delete pOsEngineTest1;
}
TEST_F(ZesEngineFixture, GivenValidEngineHandleWhenCallingZesEngineGetActivityAndPmuReadFailsThenVerifyEngineGetActivityReturnsFailure) {

View File

@@ -48,10 +48,6 @@ class ZesEngineFixture : public SysmanDeviceFixture {
pOriginalPmuInterface = pLinuxSysmanImp->pPmuInterface;
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
device = pSysmanDevice;
@@ -185,8 +181,6 @@ TEST_F(ZesEngineFixture, GivenTestDiscreteDevicesAndValidEngineHandleWhenCalling
auto pOsEngineTest2 = L0::Sysman::OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest2->getActivity(&stats));
delete pOsEngineTest1;
delete pOsEngineTest2;
}
TEST_F(ZesEngineFixture, GivenUnknownEngineTypeThengetEngineGroupFromTypeReturnsGroupAllEngineGroup) {
@@ -201,7 +195,6 @@ TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCalli
auto pOsEngineTest1 = L0::Sysman::OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest1->getActivity(&stats));
delete pOsEngineTest1;
}
TEST_F(ZesEngineFixture, GivenValidEngineHandleWhenCallingZesEngineGetActivityAndPmuReadFailsThenVerifyEngineGetActivityReturnsFailure) {
@@ -245,10 +238,6 @@ TEST_F(ZesEngineFixture, GivenHandleQueryItemCalledWhenPmuInterfaceOpenFailsThen
pFsAccess->mockReadVal = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(pOsSysman->getSubDeviceCount());
uint32_t count = 0;
@@ -270,9 +259,6 @@ TEST_F(ZesEngineFixture, GivenValidEngineHandleAndHandleCountZeroWhenCallingReIn
EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceEnumEngineGroups(device->toHandle(), &count, NULL));
EXPECT_EQ(count, handleComponentCount);
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(pOsSysman->getSubDeviceCount());
@@ -313,10 +299,6 @@ class ZesEngineMultiFixture : public SysmanMultiDeviceFixture {
pDrm->mockReadSysmanQueryEngineInfoMultiDevice = true;
pSysfsAccess->mockReadSymLinkSuccess = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
device = pSysmanDevice;
@@ -395,10 +377,6 @@ TEST_F(ZesEngineMultiFixture, GivenHandleQueryItemCalledWhenPmuInterfaceOpenFail
pFsAccess->mockReadVal = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(pOsSysman->getSubDeviceCount());
uint32_t count = 0;