From 196dbe1b3602a13e7a3d931c560d5ea8f41c8780 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 13 Feb 2021 16:27:41 +0100
Subject: [PATCH] TrigParticleTPCnv: Tweak leak-checking for gcc10.

Need to call currentContext() before starting leakcheck.
---
 .../TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx       | 6 +++---
 .../TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx       | 6 +++---
 .../TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx      | 6 +++---
 .../TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx      | 6 +++---
 .../TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx       | 6 +++---
 .../TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx       | 6 +++---
 .../TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx        | 6 +++---
 .../TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx        | 6 +++---
 8 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx
index e15be1f830c..043d0f98244 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigEFBphysCnv_p2_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -16,6 +14,7 @@
 #include "SGTools/TestStore.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -55,6 +54,7 @@ void testit (const TrigEFBphys& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink<TrigEFBphysContainer> foo ("foo", 10);
   ElementLink<Rec::TrackParticleContainer> bar1 ("bar1", 1);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx
index 60bc875f27d..63d055a91a0 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigEFBphysCnv_p3_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -16,6 +14,7 @@
 #include "SGTools/TestStore.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -55,6 +54,7 @@ void testit (const TrigEFBphys& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink<TrigEFBphysContainer> foo ("foo", 10);
   ElementLink<Rec::TrackParticleContainer> bar1 ("bar1", 1);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx
index c3543bce3b3..3ce04721e2a 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigElectronCnv_p2_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -18,6 +16,7 @@
 #include "TestTools/FLOATassert.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -79,6 +78,7 @@ void testit (const TrigElectron& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink< TrigEMClusterContainer > foo ("foo", 10);
   ElementLink< TrigInDetTrackCollection > bar ("bar", 20);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx
index 4a67ad19aa0..d8c99d29e66 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigElectronCnv_p3_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -17,6 +15,7 @@
 #include "TestTools/FLOATassert.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -76,6 +75,7 @@ void testit (const TrigElectron& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink< TrigEMClusterContainer > foo ("foo", 10);
   ElementLink< TrigInDetTrackCollection > bar ("bar", 20);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx
index 6213058aaea..1948ef255ab 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigL2BphysCnv_p2_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -16,6 +14,7 @@
 #include "SGTools/TestStore.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -55,6 +54,7 @@ void testit (const TrigL2Bphys& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink<TrigL2BphysContainer> foo ("foo", 10);
   ElementLink<TrigInDetTrackCollection> bar1 ("bar1", 1);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx
index 91f1ed2b07d..9f9ffddd113 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigL2BphysCnv_p3_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -16,6 +14,7 @@
 #include "SGTools/TestStore.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -55,6 +54,7 @@ void testit (const TrigL2Bphys& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxies created outside of leak check.
   ElementLink<TrigL2BphysContainer> foo ("foo", 10);
   ElementLink<TrigInDetTrackCollection> bar1 ("bar1", 1);
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx
index 9e91ddfcc23..7f6cda479cc 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigPhotonCnv_p2_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -18,6 +16,7 @@
 #include "TestTools/FLOATassert.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -73,6 +72,7 @@ void testit (const TrigPhoton& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxy created outside of leak check.
   ElementLink< TrigEMClusterContainer > foo ("foo", 10);
   Athena_test::Leakcheck check;
diff --git a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx
index 93ce00669a5..cba8c1125e1 100644
--- a/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx
+++ b/Trigger/TrigEvent/TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TrigParticleTPCnv/test/TrigPhotonCnv_p3_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -17,6 +15,7 @@
 #include "TestTools/FLOATassert.h"
 #include "TestTools/leakcheck.h"
 #include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/ThreadLocalContext.h"
 #include <cassert>
 #include <iostream>
 
@@ -70,6 +69,7 @@ void testit (const TrigPhoton& trans1)
 void test1()
 {
   std::cout << "test1\n";
+  (void)Gaudi::Hive::currentContext();
   // Get proxy created outside of leak check.
   ElementLink< TrigEMClusterContainer > foo ("foo", 10);
   Athena_test::Leakcheck check;
-- 
GitLab