diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/share/SCT_RODVetoSvc_test.ref b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/SCT_RODVetoSvc_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..182999f02473b66f91f72768b436e1c595da5a8d --- /dev/null +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/share/SCT_RODVetoSvc_test.ref @@ -0,0 +1,51 @@ +[==========] Running 8 tests from 1 test case. +[----------] Global test environment set-up. +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Thu Mar 2 10:05:17 2017 +==================================================================================================================================== +ApplicationMgr INFO Application Manager Configured successfully +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 +ClassIDSvc INFO getRegistryEntries: read 3598 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 357 CLIDRegistry entries for module ALL +[----------] 8 tests from SCT_RODVetoSvc_test +[ RUN ] SCT_RODVetoSvc_test.Initialization +SCT_CablingSvc INFO Initialize SCT cabling SCT_Cabling-00-00-00 +SCT_FillCabling... INFO Reading cabling from CORACOOL +[ OK ] SCT_RODVetoSvc_test.Initialization (2 ms) +[ RUN ] SCT_RODVetoSvc_test.Finalization +ClassIDSvc INFO getRegistryEntries: read 52 CLIDRegistry entries for module ALL +[ OK ] SCT_RODVetoSvc_test.Finalization (1 ms) +[ RUN ] SCT_RODVetoSvc_test.queryInterface +[ OK ] SCT_RODVetoSvc_test.queryInterface (0 ms) +[ RUN ] SCT_RODVetoSvc_test.canReportAbout +[ OK ] SCT_RODVetoSvc_test.canReportAbout (0 ms) +[ RUN ] SCT_RODVetoSvc_test.isGood +SCT_RODVetoSvc INFO No value found for isFilled in SG, assuming false +SCT_RODVetoSvc ERROR Can't find BadRODIdentifiers in StoreGate +SCT_RODVetoSvc WARNING Data structure could not be filled +[ OK ] SCT_RODVetoSvc_test.isGood (0 ms) +[ RUN ] SCT_RODVetoSvc_test.fillData +SCT_RODVetoSvc ERROR Can't find BadRODIdentifiers in StoreGate +[ OK ] SCT_RODVetoSvc_test.fillData (0 ms) +[ RUN ] SCT_RODVetoSvc_test.canFillDuringInitialization +[ OK ] SCT_RODVetoSvc_test.canFillDuringInitialization (0 ms) +[ RUN ] SCT_RODVetoSvc_test.isFilled +BadRODIdentifiers +2359552 +SCT_RODVetoSvc INFO No value found for isFilled in SG, assuming false +SCT_RODVetoSvc INFO 1 RODs were declared bad +SCT_RODVetoSvc WARNING Your vetoed selection 0x240100 does not exist. +Recorded WH with key: isFilled and value: 1 +SCT_RODVetoSvc INFO Structure successfully filled with 0 modules. +[ OK ] SCT_RODVetoSvc_test.isFilled (0 ms) +[----------] 8 tests from SCT_RODVetoSvc_test (3 ms total) + +[----------] Global test environment tear-down +[==========] 8 tests from 1 test case ran. (58 ms total) +[ PASSED ] 8 tests. diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/test/SCT_RODVetoSvc_test.cxx b/InnerDetector/InDetConditions/SCT_ConditionsServices/test/SCT_RODVetoSvc_test.cxx index 4ed8ef85bb64465f9321dd753baedd07d248b100..bb6eae70f10d8512fb9faea8d29c60be4d47c1d5 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/test/SCT_RODVetoSvc_test.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/test/SCT_RODVetoSvc_test.cxx @@ -46,30 +46,27 @@ //#include "mock_CablingSvc.h" - - #include "InDetIdentifier/SCT_ID.h" -// Needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated -ISvcLocator* g_svcLoc = Gaudi::svcLocator(); - -// Needed for the setup of StorgateSvc -const SCT_ID * m_pHelper = new SCT_ID(); - -// Easy way to set up services -const ServiceLocatorHelper helper(*g_svcLoc, "HELPER"); - -// Set up a new StoreGateSvc instance named DetectorStore, as SCT_RODVetoSvc needs -IService* i_svc = helper.service("StoreGateSvc/DetectorStore", true /*queit*/ , true /*createIf*/); -StoreGateSvc* m_detStore = dynamic_cast<StoreGateSvc*> (i_svc); -StatusCode sc = m_detStore->record(m_pHelper, "SCT_ID"); - // global test environment takes care of setting up Gaudi class GaudiEnvironment : public ::testing::Environment { protected: virtual void SetUp() override { + ISvcLocator* g_svcLoc = Gaudi::svcLocator(); + Athena_test::initGaudi(g_svcLoc); + + // Needed for the setup of StorgateSvc + const SCT_ID * pHelper = new SCT_ID(); + + // Easy way to set up services + const ServiceLocatorHelper helper(*g_svcLoc, "HELPER"); + + // Set up a new StoreGateSvc instance named DetectorStore, as SCT_RODVetoSvc needs + IService* i_svc = helper.service("StoreGateSvc/DetectorStore", true /*queit*/ , true /*createIf*/); + StoreGateSvc* detStore = dynamic_cast<StoreGateSvc*> (i_svc); + StatusCode sc = detStore->record(pHelper, "SCT_ID"); } }; @@ -81,6 +78,7 @@ class SCT_RODVetoSvc_test: public ::testing::Test{ virtual void SetUp() override { + ISvcLocator* g_svcLoc = Gaudi::svcLocator(); m_svc = new SCT_RODVetoSvc("SCT_RODVetoSvc", g_svcLoc ); }