From eeff26bbd0657b09401bd97f13ccc1dd1e744669 Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Tue, 13 Dec 2016 19:31:44 +0100 Subject: [PATCH] endreq -> endmsg. (ISF_FatrasEventTPCnv-00-00-10) * Tagging ISF_FatrasEventTPCnv-00-00-10. * endreq -> endmsg. * Tagging ISF_FatrasEventTPCnv-00-00-09. * Add leak checking to unit tests. Former-commit-id: 2002e583431b5e5a622d56913a37316bdb7d8221 --- .../PlanarClusterContainerCnv_p2_test.ref | 14 ++++----- .../src/PlanarClusterContainerCnv_p1.cxx | 18 +++++------ .../src/PlanarClusterContainerCnv_p2.cxx | 30 +++++++++---------- .../test/PlanarClusterCnv_p1_test.cxx | 2 ++ .../test/PlanarClusterCnv_p2_test.cxx | 2 ++ .../PlanarClusterContainerCnv_p1_test.cxx | 4 +++ .../PlanarClusterContainerCnv_p2_test.cxx | 6 +++- 7 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/share/PlanarClusterContainerCnv_p2_test.ref b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/share/PlanarClusterContainerCnv_p2_test.ref index 4ca08123485..7e8da86791e 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/share/PlanarClusterContainerCnv_p2_test.ref +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/share/PlanarClusterContainerCnv_p2_test.ref @@ -7,16 +7,12 @@ JobOptionsSvc INFO # (2,1): ApplicationMgr.ExtSvc += ["StoreGateSvc", "St JobOptionsSvc INFO Job options successfully read in from ../share/ISF_FatrasEventTPCnv_test.txt ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v999r999) - running on karma on Tue Mar 22 12:10:28 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Tue Dec 13 14:26:16 2016 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : StoreGate, CLIDComps ApplicationMgr INFO Application Manager Configured successfully -StoreGateSvc INFO Initializing StoreGateSvc - package version StoreGate-00-00-00 -ClassIDSvc INFO Initializing ClassIDSvc - package version CLIDComps-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1309 CLIDRegistry entries for module ALL -ProxyProviderSvc INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00 -DetectorStore INFO Initializing DetectorStore - package version StoreGate-00-00-00 +ClassIDSvc INFO getRegistryEntries: read 1563 CLIDRegistry entries for module ALL EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. HistogramPersis...WARNING Histograms saving not required. @@ -109,3 +105,7 @@ test INFO PixelID helper retrieved ! test INFO Found and Retrieved collection Pixel_IdHashDetElementMap test INFO SCT_ID helper retrieved ! test INFO Found and Retrieved collection SCT_IdHashDetElementMap +test INFO PixelID helper retrieved ! +test INFO Found and Retrieved collection Pixel_IdHashDetElementMap +test INFO SCT_ID helper retrieved ! +test INFO Found and Retrieved collection SCT_IdHashDetElementMap diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p1.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p1.cxx index 2ccbb6ad439..fce65526904 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p1.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p1.cxx @@ -58,7 +58,7 @@ void PlanarClusterContainerCnv_p1::transToPers(const iFatras::PlanarClusterConta //PlanarClusterCnv_p1 chanCnv; if(!m_isInitialized) { if (this->initialize(log) != StatusCode::SUCCESS) { - log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p1 " << endreq; + log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p1 " << endmsg; } } PlanarClusterCnv_p1 chanCnv(m_pixId); @@ -140,7 +140,7 @@ void PlanarClusterContainerCnv_p1::persToTrans(const iFatras::PlanarClusterCont // Fill with channels: // This is used to read the vector of errMat // values and lenght of the value are specified in separate vectors - // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Reading collection with " << nchans << "Channels " << endreq; + // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Reading collection with " << nchans << "Channels " << endmsg; for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { const iFatras::PlanarCluster_p1* pchan = &(persCont->m_rawdata[ichan + collBegin]); // In preparation for 64-bit ids, set the initial cluster @@ -165,10 +165,10 @@ void PlanarClusterContainerCnv_p1::persToTrans(const iFatras::PlanarClusterCont //================================================================ iFatras::PlanarClusterContainer* PlanarClusterContainerCnv_p1::createTransient(const iFatras::PlanarClusterContainer_p1* persObj, MsgStream& log) { - if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "PlanarClusterContainerCnv_p1::createTransient called " << endreq; + if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "PlanarClusterContainerCnv_p1::createTransient called " << endmsg; if(!m_isInitialized) { if (this->initialize(log) != StatusCode::SUCCESS) { - log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p1 " << endreq; + log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p1 " << endmsg; } } std::auto_ptr<iFatras::PlanarClusterContainer> trans(new iFatras::PlanarClusterContainer(m_pixId->wafer_hash_max())); @@ -186,7 +186,7 @@ StatusCode PlanarClusterContainerCnv_p1::initialize(MsgStream &log) { // get StoreGate service StatusCode sc = svcLocator->service("StoreGateSvc", m_storeGate); if (sc.isFailure()) { - log << MSG::FATAL << "StoreGate service not found !" << endreq; + log << MSG::FATAL << "StoreGate service not found !" << endmsg; return StatusCode::FAILURE; } @@ -194,14 +194,14 @@ StatusCode PlanarClusterContainerCnv_p1::initialize(MsgStream &log) { StoreGateSvc *detStore; sc = svcLocator->service("DetectorStore", detStore); if (sc.isFailure()) { - log << MSG::FATAL << "DetectorStore service not found !" << endreq; + log << MSG::FATAL << "DetectorStore service not found !" << endmsg; return StatusCode::FAILURE; } // Get the sct helper from the detector store sc = detStore->retrieve(m_pixId, "PixelID"); if (sc.isFailure()) { - log << MSG::FATAL << "Could not get PixelID helper !" << endreq; + log << MSG::FATAL << "Could not get PixelID helper !" << endmsg; return StatusCode::FAILURE; } @@ -209,11 +209,11 @@ StatusCode PlanarClusterContainerCnv_p1::initialize(MsgStream &log) { if ((detStore->contains<iFatras::IdHashDetElementCollection>(m_detElementMapName))){ m_detElementMap = nullptr; if((detStore->retrieve(m_detElementMap, m_detElementMapName)).isFailure()){ - log << MSG::FATAL <<"Could not retrieve collection " << m_detElementMapName<< endreq; + log << MSG::FATAL <<"Could not retrieve collection " << m_detElementMapName<< endmsg; return StatusCode::FAILURE; } else - log << MSG::DEBUG <<"Found and Retrieved collection " << m_detElementMapName<< endreq; + log << MSG::DEBUG <<"Found and Retrieved collection " << m_detElementMapName<< endmsg; } else m_detElementMap = new iFatras::IdHashDetElementCollection; diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p2.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p2.cxx index 22229feefac..49172e7ddb1 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p2.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/src/PlanarClusterContainerCnv_p2.cxx @@ -60,7 +60,7 @@ void PlanarClusterContainerCnv_p2::transToPers(const iFatras::PlanarClusterConta //PlanarClusterCnv_p2 chanCnv; if(!m_isInitialized) { if (this->initialize(log) != StatusCode::SUCCESS) { - log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p2 " << endreq; + log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p2 " << endmsg; } } PlanarClusterCnv_p2 chanCnv(m_pixId, m_sctId); @@ -145,7 +145,7 @@ void PlanarClusterContainerCnv_p2::persToTrans(const iFatras::PlanarClusterCont // Fill with channels: // This is used to read the vector of errMat // values and lenght of the value are specified in separate vectors - // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Reading collection with " << nchans << "Channels " << endreq; + // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Reading collection with " << nchans << "Channels " << endmsg; for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { const iFatras::PlanarCluster_p2* pchan = &(persCont->m_rawdata[ichan + collBegin]); // In preparation for 64-bit ids, set the initial cluster @@ -170,10 +170,10 @@ void PlanarClusterContainerCnv_p2::persToTrans(const iFatras::PlanarClusterCont //================================================================ iFatras::PlanarClusterContainer* PlanarClusterContainerCnv_p2::createTransient(const iFatras::PlanarClusterContainer_p2* persObj, MsgStream& log) { - if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "PlanarClusterContainerCnv_p2::createTransient called " << endreq; + if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "PlanarClusterContainerCnv_p2::createTransient called " << endmsg; if(!m_isInitialized) { if (this->initialize(log) != StatusCode::SUCCESS) { - log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p2 " << endreq; + log << MSG::FATAL << "Could not initialize PlanarClusterContainerCnv_p2 " << endmsg; } } std::auto_ptr<iFatras::PlanarClusterContainer> trans(new iFatras::PlanarClusterContainer(m_pixId->wafer_hash_max()+m_sctId->wafer_hash_max())); @@ -191,7 +191,7 @@ StatusCode PlanarClusterContainerCnv_p2::initialize(MsgStream &log) { // get StoreGate service StatusCode sc = svcLocator->service("StoreGateSvc", m_storeGate); if (sc.isFailure()) { - log << MSG::FATAL << "StoreGate service not found !" << endreq; + log << MSG::FATAL << "StoreGate service not found !" << endmsg; return StatusCode::FAILURE; } @@ -199,27 +199,27 @@ StatusCode PlanarClusterContainerCnv_p2::initialize(MsgStream &log) { StoreGateSvc *detStore; sc = svcLocator->service("DetectorStore", detStore); if (sc.isFailure()) { - log << MSG::FATAL << "DetectorStore service not found !" << endreq; + log << MSG::FATAL << "DetectorStore service not found !" << endmsg; return StatusCode::FAILURE; } // Get the sct helper from the detector store sc = detStore->retrieve(m_pixId, "PixelID"); if (sc.isFailure()) { - log << MSG::FATAL << "Could not get PixelID helper !" << endreq; + log << MSG::FATAL << "Could not get PixelID helper !" << endmsg; return StatusCode::FAILURE; - } else log << MSG::INFO << "PixelID helper retrieved !" << endreq; + } else log << MSG::INFO << "PixelID helper retrieved !" << endmsg; //Retrieve the map with IdHash to DetElement if ((detStore->contains<iFatras::IdHashDetElementCollection>(m_pixelDetElementMapName))){ m_pixelDetElementMap = nullptr; if((detStore->retrieve(m_pixelDetElementMap, m_pixelDetElementMapName)).isFailure()){ - log << MSG::FATAL <<"Could not retrieve collection " << m_pixelDetElementMapName << endreq; + log << MSG::FATAL <<"Could not retrieve collection " << m_pixelDetElementMapName << endmsg; return StatusCode::FAILURE; } else - log << MSG::INFO <<"Found and Retrieved collection " << m_pixelDetElementMapName << endreq; + log << MSG::INFO <<"Found and Retrieved collection " << m_pixelDetElementMapName << endmsg; } else m_pixelDetElementMap = new iFatras::IdHashDetElementCollection; @@ -228,21 +228,21 @@ StatusCode PlanarClusterContainerCnv_p2::initialize(MsgStream &log) { if ((detStore->contains<SCT_ID>("SCT_ID"))){ sc = detStore->retrieve(m_sctId, "SCT_ID"); if (sc.isFailure()) { - log << MSG::FATAL << "Could not get SCT_ID helper !" << endreq; + log << MSG::FATAL << "Could not get SCT_ID helper !" << endmsg; return StatusCode::FAILURE; } - else log << MSG::INFO << "SCT_ID helper retrieved !" << endreq; - } else log << MSG::INFO << "SCT_ID helper NOT in the detStore !" << endreq; + else log << MSG::INFO << "SCT_ID helper retrieved !" << endmsg; + } else log << MSG::INFO << "SCT_ID helper NOT in the detStore !" << endmsg; //Retrieve the map with IdHash to DetElement if ((detStore->contains<iFatras::IdHashDetElementCollection>(m_sctDetElementMapName))){ m_sctDetElementMap = nullptr; if((detStore->retrieve(m_sctDetElementMap, m_sctDetElementMapName)).isFailure()){ - log << MSG::FATAL <<"Could not retrieve collection " << m_sctDetElementMapName<< endreq; + log << MSG::FATAL <<"Could not retrieve collection " << m_sctDetElementMapName<< endmsg; return StatusCode::FAILURE; } else - log << MSG::INFO <<"Found and Retrieved collection " << m_sctDetElementMapName<< endreq; + log << MSG::INFO <<"Found and Retrieved collection " << m_sctDetElementMapName<< endmsg; } else m_sctDetElementMap = new iFatras::IdHashDetElementCollection; diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p1_test.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p1_test.cxx index 8b2d7a311ca..7875374c8d0 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p1_test.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p1_test.cxx @@ -22,6 +22,7 @@ #include "CxxUtils/make_unique.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ISvcLocator.h" +#include "TestTools/leakcheck.h" #include <cassert> #include <iostream> @@ -86,6 +87,7 @@ void testit (const IDHelpers& helpers, void test1 (const IDHelpers& helpers) { std::cout << "test1\n"; + Athena_test::Leakcheck check; Identifier wafer_id = helpers.m_pixel_ids[0]; diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p2_test.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p2_test.cxx index 6f41e5578d9..1f9a1c13e30 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p2_test.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterCnv_p2_test.cxx @@ -22,6 +22,7 @@ #include "CxxUtils/make_unique.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ISvcLocator.h" +#include "TestTools/leakcheck.h" #include <cassert> #include <iostream> @@ -89,6 +90,7 @@ void testit (const IDHelpers& helpers, void test1 (const IDHelpers& helpers) { std::cout << "test1\n"; + Athena_test::Leakcheck check; Identifier wafer_id = helpers.m_pixel_ids[0]; diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p1_test.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p1_test.cxx index e54e63c6d09..cd15f61aaa3 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p1_test.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p1_test.cxx @@ -22,6 +22,7 @@ #include "CxxUtils/make_unique.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ISvcLocator.h" +#include "TestTools/leakcheck.h" #include <cassert> #include <iostream> @@ -188,6 +189,9 @@ void test1 (const IDHelpers& helpers) } #endif + // Run once outside leak checking to get services initialized. + testit (helpers, trans1); + Athena_test::Leakcheck check; testit (helpers, trans1); } diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p2_test.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p2_test.cxx index de85a69043a..d2adb4548c7 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p2_test.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEventTPCnv/test/PlanarClusterContainerCnv_p2_test.cxx @@ -22,6 +22,7 @@ #include "CxxUtils/make_unique.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ISvcLocator.h" +#include "TestTools/leakcheck.h" #include <cassert> #include <iostream> @@ -185,7 +186,10 @@ void test1 (const IDHelpers& helpers) } trans1.addCollection (coll.release(), wafer_hash, true); } - + + // Run once outside leak checking to get services initialized. + testit (helpers, trans1); + Athena_test::Leakcheck check; testit (helpers, trans1); } -- GitLab