From ae0d95af6998dc00acb7f2fb9ddf51f077e6e5c6 Mon Sep 17 00:00:00 2001 From: scott snyder Date: Fri, 13 May 2022 12:13:53 -0400 Subject: [PATCH] CaloSimEventTPCnv: Enable thread-safety checking. Enable thread-safety checking and fix warnings. --- .../CaloCnv/CaloSimEventTPCnv/CMakeLists.txt | 13 ++++++------- .../CaloSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../test/CaloCalibrationHitCnv_p1_test.cxx | 9 ++++----- .../test/CaloCalibrationHitCnv_p2_test.cxx | 9 ++++----- .../test/CaloCalibrationHitContainerCnv_p1_test.cxx | 9 ++++----- .../test/CaloCalibrationHitContainerCnv_p2_test.cxx | 9 ++++----- .../test/CaloCalibrationHitContainerCnv_p3_test.cxx | 9 ++++----- 7 files changed, 27 insertions(+), 32 deletions(-) create mode 100644 Calorimeter/CaloCnv/CaloSimEventTPCnv/CaloSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/CMakeLists.txt b/Calorimeter/CaloCnv/CaloSimEventTPCnv/CMakeLists.txt index 212f2f9fecd..2866d391f9f 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/CMakeLists.txt +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( CaloSimEventTPCnv ) @@ -22,28 +22,27 @@ atlas_add_dictionary( OLD_CaloSimEventTPCnvDict atlas_add_test( CaloCalibrationHitCnv_p1_test SOURCES test/CaloCalibrationHitCnv_p1_test.cxx - LINK_LIBRARIES CaloSimEventTPCnv ) + LINK_LIBRARIES CaloSimEventTPCnv CxxUtils ) atlas_add_test( CaloCalibrationHitCnv_p2_test SOURCES test/CaloCalibrationHitCnv_p2_test.cxx - LINK_LIBRARIES CaloSimEventTPCnv ) + LINK_LIBRARIES CaloSimEventTPCnv CxxUtils ) atlas_add_test( CaloCalibrationHitContainerCnv_p1_test SOURCES test/CaloCalibrationHitContainerCnv_p1_test.cxx - LINK_LIBRARIES CaloSimEventTPCnv + LINK_LIBRARIES CaloSimEventTPCnv CxxUtils LOG_IGNORE_PATTERN "Athena::getMessageSvc" ) atlas_add_test( CaloCalibrationHitContainerCnv_p2_test SOURCES test/CaloCalibrationHitContainerCnv_p2_test.cxx - LINK_LIBRARIES CaloSimEventTPCnv + LINK_LIBRARIES CaloSimEventTPCnv CxxUtils LOG_IGNORE_PATTERN "Athena::getMessageSvc" ) atlas_add_test( CaloCalibrationHitContainerCnv_p3_test SOURCES test/CaloCalibrationHitContainerCnv_p3_test.cxx - LINK_LIBRARIES CaloSimEventTPCnv + LINK_LIBRARIES CaloSimEventTPCnv CxxUtils LOG_IGNORE_PATTERN "Athena::getMessageSvc" ) - diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/CaloSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloCnv/CaloSimEventTPCnv/CaloSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..028adc9e526 --- /dev/null +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/CaloSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Calorimeter/CaloCnv/CaloSimEventTPCnv diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p1_test.cxx b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p1_test.cxx index a6b71f65a4b..75e601c87d6 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p1_test.cxx +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p1_test.cxx * @author scott snyder @@ -14,12 +12,13 @@ #include "CaloSimEventTPCnv/CaloCalibrationHitCnv_p1.h" #include "TestTools/leakcheck.h" #include "CaloSimEvent/CaloCalibrationHit.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -43,7 +42,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p2_test.cxx b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p2_test.cxx index 018b1edc31b..1a9b0bc4186 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p2_test.cxx +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CaloSimEventTPCnv/test/CaloCalibrationHitCnv_p2_test.cxx * @author scott snyder @@ -14,12 +12,13 @@ #include "CaloSimEventTPCnv/CaloCalibrationHitCnv_p2.h" #include "TestTools/leakcheck.h" #include "CaloSimEvent/CaloCalibrationHit.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -44,7 +43,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p1_test.cxx b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p1_test.cxx index fbc205bc001..c85be459246 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p1_test.cxx +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "CaloSimEventTPCnv/CaloCalibrationHitContainerCnv_p1.h" #include "TestTools/leakcheck.h" #include "CaloSimEvent/CaloCalibrationHit.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -28,7 +27,7 @@ void compare (const CaloCalibrationHit& h1, } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; MsgStream log (0, "test"); @@ -66,7 +65,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p2_test.cxx b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p2_test.cxx index 59d3224f737..420f30befbd 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p2_test.cxx +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "CaloSimEventTPCnv/CaloCalibrationHitContainerCnv_p2.h" #include "TestTools/leakcheck.h" #include "CaloSimEvent/CaloCalibrationHit.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -28,7 +27,7 @@ void compare (const CaloCalibrationHit& h1, } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; MsgStream log (0, "test"); @@ -67,7 +66,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p3_test.cxx b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p3_test.cxx index 9daf537733f..cfb359f9bd2 100644 --- a/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p3_test.cxx +++ b/Calorimeter/CaloCnv/CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CaloSimEventTPCnv/test/CaloCalibrationHitContainerCnv_p3_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "CaloSimEventTPCnv/CaloCalibrationHitContainerCnv_p3.h" #include "TestTools/leakcheck.h" #include "CaloSimEvent/CaloCalibrationHit.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -28,7 +27,7 @@ void compare (const CaloCalibrationHit& h1, } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; MsgStream log (0, "test"); @@ -70,7 +69,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; -- GitLab