Skip to content
Snippets Groups Projects
Commit 4c95c939 authored by Scott Snyder's avatar Scott Snyder Committed by Graeme Stewart
Browse files

Add leak checking to unit tests. (TrackParticleTruthTPCnv-00-01-16)

	* Tagging TrackParticleTruthTPCnv-00-01-16.
	* Add leak checking to unit tests.

2016-08-11  scott snyder  <snyder@bnl.gov>

	* Tagging TrackParticleTruthTPCnv-00-01-15.
	* endreq -> endmsg.
parent dd0d8f48
No related merge requests found
...@@ -22,10 +22,10 @@ void TrackParticleTruthCollectionCnv_p0::persToTrans( const Rec::TrackParticleTr ...@@ -22,10 +22,10 @@ void TrackParticleTruthCollectionCnv_p0::persToTrans( const Rec::TrackParticleTr
TrackParticleTruthCollection* trans, TrackParticleTruthCollection* trans,
MsgStream& msg ) MsgStream& msg )
{ {
msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans(): PERS size = "<<pers->size()<<endreq; msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans(): PERS size = "<<pers->size()<<endmsg;
if(pers->empty()) { if(pers->empty()) {
msg<<MSG::WARNING<<"persToTrans(): can't find out the corresponding TrackCollection for the empty TrackParticleTruthCollection_p0 (old-format)"<<endreq; msg<<MSG::WARNING<<"persToTrans(): can't find out the corresponding TrackCollection for the empty TrackParticleTruthCollection_p0 (old-format)"<<endmsg;
} }
else { else {
//static (const) DataLink<Rec::TrackParticleContainer> = //static (const) DataLink<Rec::TrackParticleContainer> =
...@@ -36,14 +36,14 @@ void TrackParticleTruthCollectionCnv_p0::persToTrans( const Rec::TrackParticleTr ...@@ -36,14 +36,14 @@ void TrackParticleTruthCollectionCnv_p0::persToTrans( const Rec::TrackParticleTr
} }
} }
msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans() DONE"<<endreq; msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::persToTrans() DONE"<<endmsg;
} }
void TrackParticleTruthCollectionCnv_p0::transToPers( const TrackParticleTruthCollection*, void TrackParticleTruthCollectionCnv_p0::transToPers( const TrackParticleTruthCollection*,
Rec::TrackParticleTruthCollection_p0* , Rec::TrackParticleTruthCollection_p0* ,
MsgStream& msg ) MsgStream& msg )
{ {
msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers()"<<endreq; msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers()"<<endmsg;
throw std::runtime_error("TrackParticleTruthCollectionCnv_p0::transToPers() is not implemented, _p1 or later is meant to be used."); throw std::runtime_error("TrackParticleTruthCollectionCnv_p0::transToPers() is not implemented, _p1 or later is meant to be used.");
//never reached msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers() DONE"<<endreq; //never reached msg<<MSG::DEBUG<<"TrackParticleTruthCollectionCnv_p0::transToPers() DONE"<<endmsg;
} }
...@@ -28,7 +28,7 @@ void TrackParticleTruthCollectionCnv_p1::persToTrans( const Rec::TrackParticleTr ...@@ -28,7 +28,7 @@ void TrackParticleTruthCollectionCnv_p1::persToTrans( const Rec::TrackParticleTr
{ {
trans->clear(); trans->clear();
if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::persToTrans(): PERS size = " << pers->m_entries.size() << endreq; if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::persToTrans(): PERS size = " << pers->m_entries.size() << endmsg;
dataLinkConverter.persToTrans(pers->m_trackCollectionLink, TrackParticleTruthCollectionAccessor::trackParticleContainerLink(trans), msg); dataLinkConverter.persToTrans(pers->m_trackCollectionLink, TrackParticleTruthCollectionAccessor::trackParticleContainerLink(trans), msg);
...@@ -40,7 +40,7 @@ void TrackParticleTruthCollectionCnv_p1::persToTrans( const Rec::TrackParticleTr ...@@ -40,7 +40,7 @@ void TrackParticleTruthCollectionCnv_p1::persToTrans( const Rec::TrackParticleTr
trans->insert(trans->end(), std::make_pair(el, TrackParticleTruth(link, i->probability)) ); trans->insert(trans->end(), std::make_pair(el, TrackParticleTruth(link, i->probability)) );
} }
if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::persToTrans() DONE" << endreq; if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::persToTrans() DONE" << endmsg;
} }
void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCollection* trans, void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCollection* trans,
...@@ -48,8 +48,8 @@ void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCo ...@@ -48,8 +48,8 @@ void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCo
MsgStream& msg ) MsgStream& msg )
{ {
if (msg.level() <= MSG::DEBUG) { if (msg.level() <= MSG::DEBUG) {
msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers()" << endreq; msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers()" << endmsg;
msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers(): input size = " << trans->size() << endreq; msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers(): input size = " << trans->size() << endmsg;
} }
dataLinkConverter.transToPers(trans->trackParticleContainerLink(), pers->m_trackCollectionLink, msg); dataLinkConverter.transToPers(trans->trackParticleContainerLink(), pers->m_trackCollectionLink, msg);
...@@ -76,5 +76,5 @@ void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCo ...@@ -76,5 +76,5 @@ void TrackParticleTruthCollectionCnv_p1::transToPers( const TrackParticleTruthCo
} }
} }
if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers() DONE" << endreq; if (msg.level() <= MSG::DEBUG) msg << MSG::DEBUG << "TrackParticleTruthCollectionCnv_p1::transToPers() DONE" << endmsg;
} }
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "TrackParticleTruthTPCnv/TrackParticleTruthCollection_p1.h" #include "TrackParticleTruthTPCnv/TrackParticleTruthCollection_p1.h"
#include "ParticleTruth/TrackParticleTruthCollection.h" #include "ParticleTruth/TrackParticleTruthCollection.h"
#include "SGTools/TestStore.h" #include "SGTools/TestStore.h"
#include "TestTools/leakcheck.h"
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
...@@ -51,6 +52,9 @@ void testit (const TrackParticleTruthCollection& trans1) ...@@ -51,6 +52,9 @@ void testit (const TrackParticleTruthCollection& trans1)
void test1() void test1()
{ {
std::cout << "test1\n"; std::cout << "test1\n";
// Get proxy created outside of leak checking.
DataLink<Rec::TrackParticleContainer> dldum ("tpc");
Athena_test::Leakcheck check;
TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc")); TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc"));
for (int i=0; i<10; i++) { for (int i=0; i<10; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment