From c2f52c7381147815b127dae23664ee98f274cc0a Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sun, 11 Oct 2020 15:30:16 +0200
Subject: [PATCH] Add TRT_LoLumRawDataContainerCnv_p3 unit test

---
 .../InDetEventAthenaPool/CMakeLists.txt       |  3 ++-
 ...TRT_LoLumRawDataContainerCnv_common_test.h | 14 +++++++++----
 .../TRT_LoLumRawDataContainerCnv_p3_test.cxx  | 20 +++++++++++++++++++
 3 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx

diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt
index f06f8b6ca964..026dc39d0d57 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt
@@ -56,7 +56,8 @@ foreach( name
          InDetSimDataCollectionCnv_p2_test
          InDetSimDataCollectionCnv_p3_test
          TRT_LoLumRawDataContainerCnv_p1_test
-         TRT_LoLumRawDataContainerCnv_p2_test )
+         TRT_LoLumRawDataContainerCnv_p2_test
+         TRT_LoLumRawDataContainerCnv_p3_test )
 
    atlas_add_test( ${name}
       SOURCES test/${name}.cxx
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h
index b96e2f681cd3..e6e30b547dd5 100644
--- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_common_test.h
@@ -84,22 +84,28 @@ void test1()
   TRT_RDO_Container trans1(containerSize);
   // Creating collection for first example module
   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 strawID1 = Identifier(idValue1);
   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);
   collection1->push_back(rdo1.release());
   assert(trans1.addCollection(collection1.get(),elementHash1).isSuccess());
   collection1.release(); // Now owned by trans1
   // Creating collection for second example module
   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 strawID2 = Identifier(idValue2);
   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);
   collection2->push_back(rdo2.release());
   assert(trans1.addCollection(collection2.get(),elementHash2).isSuccess());
diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx
new file mode 100644
index 000000000000..68dfbae1a744
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/TRT_LoLumRawDataContainerCnv_p3_test.cxx
@@ -0,0 +1,20 @@
+/*
+  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>();
+}
-- 
GitLab