Skip to content
Snippets Groups Projects
Commit ca31bee2 authored by Takashi Yamanaka's avatar Takashi Yamanaka
Browse files

Merge branch 'test.SCT_ConditionsServices-20170422' into 'master'

SCT_ConditionsServices: Fix test.

See merge request !1105

Former-commit-id: 5b000d42
parents c1f7c94d 52d822a0
No related branches found
No related tags found
No related merge requests found
...@@ -42,10 +42,9 @@ find_package( GMock ) ...@@ -42,10 +42,9 @@ find_package( GMock )
# Component(s) in the package: # Component(s) in the package:
atlas_add_component( SCT_ConditionsServices atlas_add_component( SCT_ConditionsServices
src/*.cxx
src/components/*.cxx src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GaudiKernel SCT_ConditionsData AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities GeoModelUtilities EventInfo SiPropertiesSvcLib InDetIdentifier InDetReadoutGeometry SCT_CablingLib PathResolver ) LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GaudiKernel SCT_ConditionsData AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities GeoModelUtilities EventInfo SiPropertiesSvcLib InDetIdentifier InDetReadoutGeometry SCT_CablingLib PathResolver SCT_ConditionsServicesLib )
atlas_add_library ( SCT_ConditionsServicesLib atlas_add_library ( SCT_ConditionsServicesLib
src/*.cxx src/*.cxx
......
[==========] 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.
...@@ -46,30 +46,27 @@ ...@@ -46,30 +46,27 @@
//#include "mock_CablingSvc.h" //#include "mock_CablingSvc.h"
#include "InDetIdentifier/SCT_ID.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 // global test environment takes care of setting up Gaudi
class GaudiEnvironment : public ::testing::Environment { class GaudiEnvironment : public ::testing::Environment {
protected: protected:
virtual void SetUp() override { virtual void SetUp() override {
ISvcLocator* g_svcLoc = Gaudi::svcLocator();
Athena_test::initGaudi(g_svcLoc); 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{ ...@@ -81,6 +78,7 @@ class SCT_RODVetoSvc_test: public ::testing::Test{
virtual void SetUp() override { virtual void SetUp() override {
ISvcLocator* g_svcLoc = Gaudi::svcLocator();
m_svc = new SCT_RODVetoSvc("SCT_RODVetoSvc", g_svcLoc ); m_svc = new SCT_RODVetoSvc("SCT_RODVetoSvc", g_svcLoc );
} }
......
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