Skip to content
Snippets Groups Projects
Commit 70de370f authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'trt-tp-test' into 'master'

Add TRT_LoLumRawDataContainerCnv_p3 unit test

See merge request atlas/athena!37187
parents ab7c0d8c 5ce7a631
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,8 @@ foreach( name ...@@ -56,7 +56,8 @@ foreach( name
InDetSimDataCollectionCnv_p2_test InDetSimDataCollectionCnv_p2_test
InDetSimDataCollectionCnv_p3_test InDetSimDataCollectionCnv_p3_test
TRT_LoLumRawDataContainerCnv_p1_test TRT_LoLumRawDataContainerCnv_p1_test
TRT_LoLumRawDataContainerCnv_p2_test ) TRT_LoLumRawDataContainerCnv_p2_test
TRT_LoLumRawDataContainerCnv_p3_test )
atlas_add_test( ${name} atlas_add_test( ${name}
SOURCES test/${name}.cxx SOURCES test/${name}.cxx
......
...@@ -55,7 +55,7 @@ void TRT_LoLumRawDataContainerCnv_p1::transToPers(const TRT_RDO_Container* trans ...@@ -55,7 +55,7 @@ void TRT_LoLumRawDataContainerCnv_p1::transToPers(const TRT_RDO_Container* trans
chanBegin = chanEnd; chanBegin = chanEnd;
chanEnd += collection.size(); chanEnd += collection.size();
InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex];
pcollection.m_id = collection.identify().get_compact(); pcollection.m_id = collection.identify().get_identifier32().get_compact();
pcollection.m_hashId = (unsigned int) collection.identifyHash(); pcollection.m_hashId = (unsigned int) collection.identifyHash();
pcollection.m_begin = chanBegin; pcollection.m_begin = chanBegin;
pcollection.m_end = chanEnd; pcollection.m_end = chanEnd;
......
...@@ -84,22 +84,28 @@ void test1() ...@@ -84,22 +84,28 @@ void test1()
TRT_RDO_Container trans1(containerSize); TRT_RDO_Container trans1(containerSize);
// Creating collection for first example module // Creating collection for first example module
const IdentifierHash elementHash1(10026); const IdentifierHash elementHash1(10026);
const Identifier::value_type collIdValue1 = 0x1612280000000000;
const Identifier collID1 = Identifier(collIdValue1);
std::unique_ptr<TRT_RDO_Collection> collection1 = std::make_unique<TRT_RDO_Collection>(elementHash1);
collection1->setIdentifier(collID1);
//Add a TRT_LoLumRawData object
const Identifier::value_type idValue1 = 0x1612282000000000; const Identifier::value_type idValue1 = 0x1612282000000000;
const Identifier strawID1 = Identifier(idValue1); const Identifier strawID1 = Identifier(idValue1);
const unsigned int strawWord1(2147483696); const unsigned int strawWord1(2147483696);
std::unique_ptr<TRT_RDO_Collection> collection1 = std::make_unique<TRT_RDO_Collection>(elementHash1);
//Add a TRT_LoLumRawData object
std::unique_ptr<TRT_LoLumRawData> rdo1 = std::make_unique<TRT_LoLumRawData>(strawID1,strawWord1); std::unique_ptr<TRT_LoLumRawData> rdo1 = std::make_unique<TRT_LoLumRawData>(strawID1,strawWord1);
collection1->push_back(rdo1.release()); collection1->push_back(rdo1.release());
assert(trans1.addCollection(collection1.get(),elementHash1).isSuccess()); assert(trans1.addCollection(collection1.get(),elementHash1).isSuccess());
collection1.release(); // Now owned by trans1 collection1.release(); // Now owned by trans1
// Creating collection for second example module // Creating collection for second example module
const IdentifierHash elementHash2(10027); const IdentifierHash elementHash2(10027);
const Identifier::value_type collIdValue2 = 0x16122c0000000000;
const Identifier collID2 = Identifier(collIdValue2);
std::unique_ptr<TRT_RDO_Collection> collection2 = std::make_unique<TRT_RDO_Collection>(elementHash2);
collection2->setIdentifier(collID2);
//Add a TRT_LoLumRawData object
const Identifier::value_type idValue2 = 0x16122ce000000000; const Identifier::value_type idValue2 = 0x16122ce000000000;
const Identifier strawID2 = Identifier(idValue2); const Identifier strawID2 = Identifier(idValue2);
const unsigned int strawWord2(2147499712); const unsigned int strawWord2(2147499712);
std::unique_ptr<TRT_RDO_Collection> collection2 = std::make_unique<TRT_RDO_Collection>(elementHash2);
//Add a TRT_LoLumRawData object
std::unique_ptr<TRT_LoLumRawData> rdo2 = std::make_unique<TRT_LoLumRawData>(strawID2,strawWord2); std::unique_ptr<TRT_LoLumRawData> rdo2 = std::make_unique<TRT_LoLumRawData>(strawID2,strawWord2);
collection2->push_back(rdo2.release()); collection2->push_back(rdo2.release());
assert(trans1.addCollection(collection2.get(),elementHash2).isSuccess()); assert(trans1.addCollection(collection2.get(),elementHash2).isSuccess());
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx
* @brief Regression tests.
*/
#undef NDEBUG
#include "../src/TRT_LoLumRawDataContainerCnv_p3.h"
#include "TRT_LoLumRawDataContainerCnv_common_test.h"
int main()
{
return commonMain<TRT_LoLumRawDataContainerCnv_p3, InDetRawDataContainer_p3>();
}
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