From 410708de512541cc4708e88982acafecc591f589 Mon Sep 17 00:00:00 2001 From: scott snyder Date: Wed, 21 Jul 2021 13:16:09 -0400 Subject: [PATCH] EventCommonTPCnv: Enable thread-safety checking. Enable thread-safety checking. Fix warnings in tests. --- .../EventCommonTPCnv/ATLAS_CHECK_THREAD_SAFETY | 1 + .../test/HepLorentzVectorCnv_p1_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx | 7 ++++--- .../EventCommonTPCnv/test/INav4MomAssocsCnv_p2_test.cxx | 5 +++-- .../EventCommonTPCnv/test/INav4MomAssocsCnv_p3_test.cxx | 5 +++-- Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx | 9 ++++----- Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx | 9 ++++----- .../EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx | 9 ++++----- Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx | 9 ++++----- Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx | 9 ++++----- Event/EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx | 9 ++++----- 15 files changed, 55 insertions(+), 62 deletions(-) create mode 100644 Event/EventCommonTPCnv/EventCommonTPCnv/ATLAS_CHECK_THREAD_SAFETY diff --git a/Event/EventCommonTPCnv/EventCommonTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Event/EventCommonTPCnv/EventCommonTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 00000000000..6d7d899d53a --- /dev/null +++ b/Event/EventCommonTPCnv/EventCommonTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +EventCommonTPCnv/EventCommonTPCnv diff --git a/Event/EventCommonTPCnv/test/HepLorentzVectorCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/HepLorentzVectorCnv_p1_test.cxx index 222bc5020b1..54d73325598 100644 --- a/Event/EventCommonTPCnv/test/HepLorentzVectorCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/HepLorentzVectorCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/HepLorentzVectorCnv_p1_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "CLHEP/Vector/LorentzVector.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -38,7 +37,7 @@ void testit (const CLHEP::HepLorentzVector& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -49,7 +48,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "HepLorentzVectorCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx index 0a499cd7278..13b04077f5f 100644 --- a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** * @file EventCommonTPCnv/test/INav4MomAssocsCnv_p1_test.cxx @@ -18,6 +18,7 @@ #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -65,7 +66,7 @@ void testit (const INav4MomAssocs& trans1, StoreGateSvc* sg) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -98,7 +99,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "INav4MomAssocsCnv_p1_test\n"; diff --git a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p2_test.cxx b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p2_test.cxx index 133acf63a16..65a7010946d 100644 --- a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p2_test.cxx +++ b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p2_test.cxx @@ -17,6 +17,7 @@ #include "SGTools/TestStore.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -64,7 +65,7 @@ void testit (const INav4MomAssocs& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -96,7 +97,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "INav4MomAssocsCnv_p2_test\n"; SGTest::initTestStore(); diff --git a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p3_test.cxx b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p3_test.cxx index 5931e6e173c..be56da407f3 100644 --- a/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p3_test.cxx +++ b/Event/EventCommonTPCnv/test/INav4MomAssocsCnv_p3_test.cxx @@ -17,6 +17,7 @@ #include "SGTools/TestStore.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -64,7 +65,7 @@ void testit (const INav4MomAssocs& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -96,7 +97,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "INav4MomAssocsCnv_p3_test\n"; SGTest::initTestStore(); diff --git a/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx index adf9cc98eb4..1996ceb751f 100644 --- a/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4EEtaPhiMCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4EEtaPhiMCnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4EEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4EEtaPhiMCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx b/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx index 41cd8b3cc69..127ad822e34 100644 --- a/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx +++ b/Event/EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4EEtaPhiMCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4EEtaPhiMCnv_p2.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4EEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4EEtaPhiMCnv_p2_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx index de1d3510e29..e1d57279604 100644 --- a/Event/EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4IPtCotThPhiMCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4IPtCotThPhiMCnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4IPtCotThPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4IPtCotThPhiMCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx index 7eb80e4e292..26c5a2e2856 100644 --- a/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4ImplEEtaPhiMCnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4ImplEEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4ImplEEtaPhiMCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx b/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx index b003b177a82..11866c0e883 100644 --- a/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx +++ b/Event/EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4ImplEEtaPhiMCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4ImplEEtaPhiMCnv_p2.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4ImplEEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4ImplEEtaPhiMCnv_p2_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx index 193c23a4fe3..0c39f2826d8 100644 --- a/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4ImplPtEtaPhiMCnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4ImplPtEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4ImplPtEtaPhiMCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx b/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx index 20ebb62d2eb..c031675476c 100644 --- a/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx +++ b/Event/EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4ImplPtEtaPhiMCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4ImplPtEtaPhiMCnv_p2.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4ImplPtEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4ImplPtEtaPhiMCnv_p2_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx index d557b8b839b..db3c2d94ae3 100644 --- a/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4PtEtaPhiMCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4PtEtaPhiMCnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4PtEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4PtEtaPhiMCnv_p1_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx b/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx index c48c84ba986..40c84e4d2d6 100644 --- a/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx +++ b/Event/EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4PtEtaPhiMCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4PtEtaPhiMCnv_p2.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4PtEtaPhiM& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4PtEtaPhiMCnv_p2_test\n"; test1(); diff --git a/Event/EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx b/Event/EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx index e72695e13cd..fc0a21771d9 100644 --- a/Event/EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx +++ b/Event/EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -/* - */ /** * @file EventCommonTPCnv/test/P4PxPyPzECnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #include "EventCommonTPCnv/P4PxPyPzECnv_p1.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -40,7 +39,7 @@ void testit (const P4PxPyPzE& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; @@ -51,7 +50,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { std::cout << "P4PxPyPzECnv_p1_test\n"; test1(); -- GitLab