Skip to content
Snippets Groups Projects
Commit 523d21de authored by Scott Snyder's avatar Scott Snyder Committed by Frank Winklmeier
Browse files

ControlTest: Test making a forward DataLink ref to a base class.

ControlTest: Test making a forward DataLink ref to a base class.

Test making a forward DataLink ref to a base class.
parent 33550667
No related branches found
No related tags found
5 merge requests!66406ZDC & ZDC LED monitoring updates,!66102ZDC & RPD monitoring update,!65937Draft: Updated post-processing and plotting scripts for 2023 data in ZLumi_Scripts directory,!65537ZDC - Fix problem with swapping of low and high gain data,!65380ControlTest: Test making a forward DataLink ref to a base class.
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( ControlTest )
......@@ -110,4 +110,4 @@ atlas_add_test( test_decorHandleTest
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_joboptions( share/StoreGateTestCommon.txt share/*.py )
atlas_install_joboptions( share/StoreGateTestCommon.txt share/DataLink_test.txt share/*.py )
Initializing Gaudi ApplicationMgr using job opts ../share/DataLink_test.txt
JobOptionsSvc INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/InstallArea/jobOptions/ControlTest/StoreGateTestCommon.txt
JobOptionsSvc INFO # (5,1): ApplicationMgr.ExtSvc += ["StoreGateSvc/DetectorStore", "StoreGateSvc/HistoryStore"]
JobOptionsSvc INFO # (6,1): AuditorSvc.Auditors += ["AlgContextAuditor"]
JobOptionsSvc INFO # (7,1): StoreGateSvc.OutputLevel = 1
JobOptionsSvc INFO # (8,1): StoreGateSvc.ActivateHistory = 0
JobOptionsSvc INFO # (9,1): CLIDSvc.OutputLevel = 2
JobOptionsSvc INFO # (10,1): MessageSvc.useColors = 1
JobOptionsSvc INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/AtlasTest/ControlTest/run/../share/DataLink_test.txt
Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-centos7-gcc11-opt/x86_64-centos7-gcc11-opt/jobOptions/ControlTest/DataLink_test.txt
JobOptionsSvc INFO # =======> /afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-centos7-gcc11-opt/x86_64-centos7-gcc11-opt/jobOptions/ControlTest/StoreGateTestCommon.txt
JobOptionsSvc INFO # (3,1): ApplicationMgr.ExtSvc += ["StoreGateSvc/DetectorStore", "StoreGateSvc/HistoryStore", "StoreGateSvc/ConditionStore"]
JobOptionsSvc INFO # (4,1): AuditorSvc.Auditors += ["AlgContextAuditor"]
JobOptionsSvc INFO # (5,1): StoreGateSvc.OutputLevel = 1
JobOptionsSvc INFO # (6,1): StoreGateSvc.ActivateHistory = 0
JobOptionsSvc INFO # (7,1): ClassIDSvc.CLIDDBFiles = {}
JobOptionsSvc INFO # (8,1): MessageSvc.useColors = 1
JobOptionsSvc INFO # =======> /afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-centos7-gcc11-opt/x86_64-centos7-gcc11-opt/jobOptions/ControlTest/DataLink_test.txt
JobOptionsSvc INFO # (2,1): MessageSvc.setVerbose += ["ElementLink"]
JobOptionsSvc INFO Job options successfully read in from ../share/DataLink_test.txt
JobOptionsSvc INFO Job options successfully read in from /afs/cern.ch/work/s/ssnyder/builds/atlas-work3/build-x86_64-centos7-gcc11-opt/x86_64-centos7-gcc11-opt/jobOptions/ControlTest/DataLink_test.txt
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v3r3)
running on lxplus0056.cern.ch on Tue Mar 10 19:24:25 2015
Welcome to ApplicationMgr (GaudiCoreSvc v36r14)
running on lxplus7102.cern.ch on Tue Aug 22 18:33:29 2023
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
DetectorStore INFO Initializing DetectorStore - package version StoreGate-03-01-06
ClassIDSvc INFO Initializing ClassIDSvc - package version CLIDComps-00-06-18
ClassIDSvc INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
ProxyProviderSvc INFO Initializing ProxyProviderSvc - package version SGComps-00-01-10
HistoryStore INFO Initializing HistoryStore - package version StoreGate-03-01-06
ClassIDSvc INFO getRegistryEntries: read 821 CLIDRegistry entries for module ALL
EventLoopMgr WARNING Unable to locate service "EventSelector" 
EventLoopMgr WARNING No events will be processed from external input.
HistogramPersis...WARNING Histograms saving not required.
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr Ready
StoreGateSvc VERBOSE Initializing StoreGateSvc
StoreGateSvc_Impl VERBOSE Initializing StoreGateSvc_Impl
StoreGateSvc DEBUG Property update for OutputLevel : new value = 1
StoreGateSvc DEBUG Service base class initialized successfully
StoreGateSvc VERBOSE ServiceLocatorHelper::service: found service EventPersistencySvc
StoreGateSvc VERBOSE ServiceLocatorHelper::service: found service ClassIDSvc
StoreGateSvc DEBUG Recorded object @0xf43bb0 with key foo2 of type Foo(CLID 8101)
in DataObject @0xf724c0
StoreGateSvc VERBOSE Initializing StoreGateSvc
StoreGateSvc DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl
StoreGateSvc_Impl DEBUG Property update for OutputLevel : new value = 1
StoreGateSvc_Impl VERBOSE Initializing StoreGateSvc_Impl
StoreGateSvc_Impl DEBUG Service base class initialized successfully
StoreGateSvc_Impl VERBOSE ServiceLocatorHelper::service: found service EventPersistencySvc
StoreGateSvc_Impl VERBOSE ServiceLocatorHelper::service: found service ClassIDSvc
StoreGateSvc DEBUG Recorded object @0x4ce3340 with key foo2 of type Foo(CLID 8101)
in DataObject @0x4ce45a0
object modifiable when retrieved
*** DataLink_test - testing DataProxyStorage ***
StoreGateSvc DEBUG Recorded object @0xf46840 with key pint of type int(CLID 244260744)
in DataObject @0xf72990
StoreGateSvc DEBUG Recorded object @0x4ce49c0 with key pint of type int(CLID 244260744)
in DataObject @0x4ce4b80
object modifiable when retrieved
Now we expect to see an error message:
----Error Message Starts--->>
<<----Error Message Ends-----
StoreGateSvc DEBUG Recorded object @0xf43040 with key pFoo of type Foo(CLID 8101)
in DataObject @0xf72dd0
StoreGateSvc DEBUG Recorded object @0x4ce4ea0 with key pFoo of type Foo(CLID 8101)
in DataObject @0x4ce4dd0
object modifiable when retrieved
*** IntVector test starts ***
StoreGateSvc DEBUG Recorded object @0xf73060 with key vint of type IntVector(CLID 7368883)
in DataObject @0xf73170
StoreGateSvc DEBUG Recorded object @0x4ce5180 with key vint of type IntVector(CLID 7368883)
in DataObject @0x4ce52a0
object modifiable when retrieved
vector [1] = 0xf607c0
vector [1] = 0x4ce5110
*** IntVector test OK ***
*** Map test starts ***
StoreGateSvc DEBUG Recorded object @0xf73480 with key pmint of type map<int,string>(CLID 231411637)
in DataObject @0xf734c0
StoreGateSvc DEBUG Recorded object @0x4ce5ae0 with key pmint of type map<int,string>(CLID 231411637)
in DataObject @0x4ce5c00
object modifiable when retrieved
map [20] = venti
*** Map test OK ***
......@@ -61,17 +60,17 @@ map [20] = venti
venti has key 20
found set element venti
*** test reverse lookup static functions OK ***
StoreGateSvc DEBUG Recorded object @0xbb5980 with key novantanove of type int(CLID 244260744)
in DataObject @0xf73b20
StoreGateSvc DEBUG Recorded object @0x4ce5fe0 with key novantanove of type int(CLID 244260744)
in DataObject @0x4ce6140
object modifiable when retrieved
*** DataLink_test DataProxyStorage OK ***
StoreGateSvc DEBUG Recorded object @0xf65d70 with key a Bar of type Bar(CLID 8107)
in DataObject @0xf73cf0
StoreGateSvc DEBUG Recorded object @0x4ce6540 with key a Bar of type Bar(CLID 8107)
in DataObject @0x4ce6050
object modifiable when retrieved
StoreGateSvc DEBUG Recorded object @0xf73e10 with key a vector of type IntVector(CLID 7368883)
in DataObject @0xf73f20
StoreGateSvc DEBUG Recorded object @0x4ce67d0 with key a vector of type IntVector(CLID 7368883)
in DataObject @0x4ce68f0
object modifiable when retrieved
*** DataLink_test StoreGate OK ***
......@@ -79,25 +78,35 @@ StoreGateSvc DEBUG Recorded object @0xf73e10 with key a vector of type In
DataLink_test testing StateMachine
StoreGateSvc DEBUG Recorded object @0xf6acd0 with key pFoo3 of type Foo(CLID 8101)
in DataObject @0xf741a0
StoreGateSvc DEBUG Recorded object @0x4ce6c50 with key pFoo3 of type Foo(CLID 8101)
in DataObject @0x4ce6b70
object modifiable when retrieved
transition invalid to Accessible OK
transition Accessible to invalid OK
StoreGateSvc DEBUG Recorded object @0xf54aa0 with key of type Foo(CLID 8101)
in DataObject @0xf74580
StoreGateSvc DEBUG Recorded object @0x4ce6ee0 with key of type Foo(CLID 8101)
in DataObject @0x4ce7100
object modifiable when retrieved
transition invalid to IdentifiedDefault OK
transition IdentifiedDefault to Accessible OK
transition Accessible to Persistable OK
transition invalid to Identified OK
foo Foo not yet registered. Caught exception -SG::ExcInvalidLink: Attempt to dereference invalid DataLink / ElementLink [8101/foo] (122152060)- as expected
StoreGateSvc DEBUG Recorded object @0xbb4f30 with key foo of type Foo(CLID 8101)
in DataObject @0xf747e0
StoreGateSvc DEBUG Recorded object @0x4ce71d0 with key foo of type Foo(CLID 8101)
in DataObject @0x4ce75b0
object modifiable when retrieved
transition Identified to Accessible OK
reset Accessible OK
*** DataLink_test StateMachine OK ***
DataLink_test testing FwdBase
StoreGateSvc DEBUG Recorded object @0x4ce7690 with key LinkFwdTest of type Athena_test::Derived(CLID 231494672)
in DataObject @0x4ce7870
object not modifiable when retrieved
xxx 0x4ce7690 0x4ce7690
*** DataLink_test FwdBase OK ***
*** DataLink_test OK ***
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/
#undef NDEBUG
......@@ -15,6 +15,7 @@
#include "AthenaKernel/DefaultKey.h"
#include "AthenaKernel/errorcheck.h"
#include "AthenaKernel/CLASS_DEF.h"
#include "AthenaKernel/BaseInfo.h"
#include "SGTools/BuiltinsClids.h"
......@@ -71,6 +72,16 @@ CLASS_DEF2( map<int,string> , 231411637 , 1 )
class FooDeque : public deque<Foo> {};
namespace Athena_test {
class Base {};
class Derived : public Base {};
}
CLASS_DEF(Athena_test::Base, 231494671, 1)
CLASS_DEF(Athena_test::Derived, 231494672, 1)
SG_BASES(Athena_test::Derived, Athena_test::Base);
namespace Athena_test
{
void linkDataProxyStorage(StoreGateSvc& rSG)
......@@ -310,12 +321,25 @@ namespace Athena_test
cout << "*** DataLink_test StateMachine OK ***\n\n" <<endl;
}
// Test creation of a forward DL to a base class.
void linkFwdBase(StoreGateSvc& rSG)
{
cout << "\n\nDataLink_test testing FwdBase" <<endl;
DataLink<Athena_test::Base> link ("LinkFwdTest");
auto der = new Athena_test::Derived;
assert (rSG.record (der, "LinkFwdTest", false).isSuccess());
std::cout << "xxx " << der << " " << link.cptr() << "\n";
//assert (link.cptr() == der);
cout << "*** DataLink_test FwdBase OK ***\n\n" <<endl;
}
} //end namespace
int main() {
ISvcLocator* pSvcLoc;
if (!initGaudi("DataLink_test.txt", pSvcLoc)) {
if (!initGaudi("ControlTest/DataLink_test.txt", pSvcLoc)) {
cerr << "This test can not be run" << endl;
return 0;
}
......@@ -335,19 +359,10 @@ int main() {
linkDataProxyStorage(*pSG);
linkStoreGate(*pSG);
linkStateMachine(*pSG);
linkFwdBase(*pSG);
cout << "*** DataLink_test OK ***" <<endl;
return 0;
}
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