diff --git a/GaudiAlg/include/GaudiAlg/GaudiCommon.h b/GaudiAlg/include/GaudiAlg/GaudiCommon.h index eece687d37794f67c54ac290b599e70579729220..9b2a25bb9217ef41b25b73f4401ffcec34d5dc38 100644 --- a/GaudiAlg/include/GaudiAlg/GaudiCommon.h +++ b/GaudiAlg/include/GaudiAlg/GaudiCommon.h @@ -1,5 +1,5 @@ /***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * +* (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations * * * * This software is distributed under the terms of the Apache version 2 licence, * * copied verbatim in the file "LICENSE". * @@ -434,8 +434,7 @@ public: * @param ok Condition which should be "true" * @param message Message to be associated with the exception */ - void Assert( const bool ok, std::string_view message = "", - const StatusCode sc = StatusCode( StatusCode::FAILURE, true ) ) const; + void Assert( const bool ok, std::string_view message = "", const StatusCode sc = StatusCode::FAILURE ) const; /** Create and (re)-throw a given GaudiException * * @see GaudiException @@ -444,8 +443,7 @@ public: * @param msg Exception message * @param exc (previous) exception of type GaudiException */ - void Exception( std::string_view msg, const GaudiException& exc, - const StatusCode sc = StatusCode( StatusCode::FAILURE, true ) ) const; + void Exception( std::string_view msg, const GaudiException& exc, const StatusCode sc = StatusCode::FAILURE ) const; /** Create and (re)-throw a given exception * * @see GaudiException @@ -455,8 +453,7 @@ public: * @param exc (previous) exception of type std::exception * @param sc StatusCode */ - void Exception( std::string_view msg, const std::exception& exc, - const StatusCode sc = StatusCode( StatusCode::FAILURE, true ) ) const; + void Exception( std::string_view msg, const std::exception& exc, const StatusCode sc = StatusCode::FAILURE ) const; /** Create and throw an exception with the given message * * @see GaudiException @@ -465,8 +462,7 @@ public: * @param msg Exception message * @param sc StatusCode */ - void Exception( std::string_view msg = "no message", - const StatusCode sc = StatusCode( StatusCode::FAILURE, true ) ) const; + void Exception( std::string_view msg = "no message", const StatusCode sc = StatusCode::FAILURE ) const; private: /// accessor to all owned counters diff --git a/GaudiAlg/include/GaudiAlg/GaudiHistos.icpp b/GaudiAlg/include/GaudiAlg/GaudiHistos.icpp index e03a955b61edcb16c2e88f5ea4bb94ace2897304..e4023164dfc431ac64bf894d34a550966b3531da 100644 --- a/GaudiAlg/include/GaudiAlg/GaudiHistos.icpp +++ b/GaudiAlg/include/GaudiAlg/GaudiHistos.icpp @@ -111,9 +111,7 @@ StatusCode GaudiHistos<PBASE>:: } // Finally, print the location histogram will be written to - this->Print( "The histogram path is set to be '" + histoPath() + "'", StatusCode( StatusCode::SUCCESS, true ), - MSG::DEBUG ) - .ignore(); + this->Print( "The histogram path is set to be '" + histoPath() + "'", StatusCode::SUCCESS, MSG::DEBUG ).ignore(); return sc; } diff --git a/GaudiAlg/include/GaudiAlg/GaudiTuples.icpp b/GaudiAlg/include/GaudiAlg/GaudiTuples.icpp index 1eccac08d36d082ccd7f9c0187b2951192b9cd2e..dab26fbff8aac60c5108d7ed13983ecef2a94e81 100644 --- a/GaudiAlg/include/GaudiAlg/GaudiTuples.icpp +++ b/GaudiAlg/include/GaudiAlg/GaudiTuples.icpp @@ -59,9 +59,7 @@ StatusCode GaudiTuples<PBASE>:: // check the existance of service if ( this->ntupleSvc() == 0 ) { return this->Error( "INTupleSvc* points to NULL!" ); } // Print ntuple path - this->Print( "The N-Tuple path is set to be '" + nTuplePath() + "'", StatusCode( StatusCode::SUCCESS, true ), - MSG::DEBUG ) - .ignore(); + this->Print( "The N-Tuple path is set to be '" + nTuplePath() + "'", StatusCode::SUCCESS, MSG::DEBUG ).ignore(); } else { this->debug() << "Production of N-Tuples is switched OFF" << endmsg; } @@ -70,9 +68,7 @@ StatusCode GaudiTuples<PBASE>:: // check the existance of service if ( 0 == this->evtColSvc() ) { return this->Error( "INTupleSvc* points to NULL!" ); } // Print EvtCol path - this->Print( "The EventCol path is set to be '" + evtColPath() + "'", StatusCode( StatusCode::SUCCESS, true ), - MSG::DEBUG ) - .ignore(); + this->Print( "The EventCol path is set to be '" + evtColPath() + "'", StatusCode::SUCCESS, MSG::DEBUG ).ignore(); } else { this->debug() << "Production of Event Collections is switched OFF" << endmsg; } diff --git a/GaudiAlg/src/lib/GaudiSequencer.cpp b/GaudiAlg/src/lib/GaudiSequencer.cpp index 5360546344dd9c1c36a7d5600164a63f82f03bcd..1082225b4c5cc7139034617fe30112cf90e3d736 100644 --- a/GaudiAlg/src/lib/GaudiSequencer.cpp +++ b/GaudiAlg/src/lib/GaudiSequencer.cpp @@ -77,7 +77,7 @@ StatusCode GaudiSequencer::execute( const EventContext& ctx ) const { if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg; - StatusCode result = StatusCode( StatusCode::SUCCESS, true ); + StatusCode result = StatusCode::SUCCESS; bool seqPass = !m_modeOR; // for OR, result will be false, unless (at least) one is true // for AND, result will be true, unless (at least) one is false diff --git a/GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp b/GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp index 387f665531e0b064275b061da21ab2d62fd1450d..da36270f57ed5d1c8852978c1ef4289bd74f447b 100644 --- a/GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp +++ b/GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp @@ -348,7 +348,7 @@ void OutputStream::addItem( Items& itms, const std::string& descriptor ) { // Connect to proper conversion service StatusCode OutputStream::connectConversionSvc() { - StatusCode status = StatusCode( StatusCode::FAILURE, true ); + StatusCode status = StatusCode::FAILURE; // Get output file from input std::string dbType, svc, shr; for ( auto attrib : Gaudi::Utils::AttribStringParser( m_output ) ) { diff --git a/GaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp b/GaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp index ef1fadef6eb81f043e517a54fdecef615e5271d1..fca65090ca9769d81d8ec8f9ac72dade7447b2ae 100644 --- a/GaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp +++ b/GaudiCommonSvc/src/PersistencySvc/PersistencySvc.cpp @@ -74,7 +74,7 @@ StatusCode PersistencySvc::makeCall( int typ, IOpaqueAddress*& pAddress, DataObj break; } - StatusCode status( StatusCode::FAILURE, true ); + StatusCode status = StatusCode::FAILURE; switch ( typ ) { case CREATE_OBJ: pObject = nullptr; @@ -171,7 +171,7 @@ SmartIF<IAddressCreator>& PersistencySvc::addressCreator( long type ) { StatusCode PersistencySvc::setDataProvider( IDataProviderSvc* pDataSvc ) { m_dataSvc = pDataSvc; for ( auto& i : m_cnvServices ) { i.second.conversionSvc()->setDataProvider( m_dataSvc ).ignore(); } - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /// Access the dataprovider service @@ -180,7 +180,7 @@ SmartIF<IDataProviderSvc>& PersistencySvc::dataProvider() const { return m_dataS /// Set conversion service the converter is connected to StatusCode PersistencySvc::setConversionSvc( IConversionSvc* svc ) { m_cnvDefault = svc; - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /// Get conversion service the converter is connected to diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp index 62c4ec3fc0b7cd93e384e648434c3d30ddd4e835..c14b6e1e4ac8282b22b8500c5eb75792fb325d17 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp @@ -303,21 +303,6 @@ StatusCode ApplicationMgr::configure() { for ( const auto& property : properties ) { log << "Property ['Name': Value] = " << *property << endmsg; } } - // Check if StatusCode need to be checked - if ( m_codeCheck ) { - StatusCode::enableChecking(); - sc = svcManager()->addService( "StatusCodeSvc", -9999 ); - if ( sc.isFailure() ) { - log << MSG::FATAL << "Error adding StatusCodeSvc" << endmsg; - return StatusCode::FAILURE; - } else { - ON_VERBOSE - log << MSG::VERBOSE << "added service StatusCodeSvc" << endmsg; - } - } else { - StatusCode::disableChecking(); - } - // set the requested environment variables for ( auto& var : m_environment ) { const std::string& name = var.first; @@ -616,8 +601,6 @@ StatusCode ApplicationMgr::finalize() { // svcManager()->removeService( (IService*) m_processingMgr.get() ); // svcManager()->removeService( (IService*) m_runable.get() ); - if ( m_codeCheck ) { StatusCode::disableChecking(); } - if ( sc.isSuccess() ) { log << MSG::INFO << "Application Manager Finalized successfully" << endmsg; } else { @@ -686,7 +669,7 @@ StatusCode ApplicationMgr::terminate() { // Reach the required state going through all the needed transitions //============================================================================ StatusCode ApplicationMgr::GoToState( Gaudi::StateMachine::State state, bool ignoreFailures ) { - StatusCode sc = StatusCode( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; switch ( state ) { diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h index 98323e376475d2cf2a16e12944d72826f7a3d497..73517f87ca88bc4b40784ec70723a2c1cb1c3ca7 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.h @@ -1,5 +1,5 @@ /***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * +* (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations * * * * This software is distributed under the terms of the Apache version 2 licence, * * copied verbatim in the file "LICENSE". * @@ -264,7 +264,7 @@ protected: Gaudi::Property<std::string> m_appName{this, "AppName", "ApplicationMgr", "The name of the application"}; Gaudi::Property<std::string> m_appVersion{this, "AppVersion", {}, "The version of the application"}; Gaudi::Property<bool> m_actHistory{this, "ActivateHistory", false, "Activate HistorySvc"}; - Gaudi::Property<bool> m_codeCheck{this, "StatusCodeCheck", false, "Activate StatusCode checking"}; + Gaudi::Property<bool> m_codeCheck{this, "StatusCodeCheck", false, "[[deprecated]] will be removed"}; Gaudi::Property<int> m_pluginDebugLevel{this, "PluginDebugLevel", 0, [this]( auto& ) { // Setup debug level for the plugin system diff --git a/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp index 6484dc2e4ac0ca7a1db5e2e16ab168b2ddb6c4bd..5899aa08607c401c7121d23f71580dd637847ffd 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp @@ -279,7 +279,7 @@ StatusCode EventLoopMgr::nextEvent( int maxevt ) { const float oneOver1024 = 1.f / 1024.f; DataObject* pObject = nullptr; - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // loop over events if the maxevt (received as input) if different from -1. // if evtmax is -1 it means infinite loop diff --git a/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp b/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp index a35a10bf921e2b2938e04452edb64d36e8622525..1c86aa91d4a499d855eef35daced5f29c9c9bbba 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ServiceManager.cpp @@ -148,7 +148,7 @@ StatusCode ServiceManager::addService( const Gaudi::Utils::TypeNameString& typeN if ( !svc ) return StatusCode::FAILURE; it = find( svc.get() ); // now it is in the list because createService added it it->priority = prio; - StatusCode sc = StatusCode( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; if ( targetFSMState() >= Gaudi::StateMachine::INITIALIZED ) { // WARNING: this can trigger a recursion!!! sc = svc->sysInitialize(); if ( sc.isSuccess() && targetFSMState() >= Gaudi::StateMachine::RUNNING ) { sc = svc->sysStart(); } @@ -175,7 +175,7 @@ StatusCode ServiceManager::addService( const Gaudi::Utils::TypeNameString& typeN // 'it' is defined because either we found the service or we created it // Now we can activate the service it->active = true; // and make it active - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } //------------------------------------------------------------------------------ @@ -245,9 +245,9 @@ StatusCode ServiceManager::removeService( IService* svc ) //------------------------------------------------------------------------------ { auto it = find( svc ); - if ( it == m_listsvc.end() ) return StatusCode( StatusCode::FAILURE, true ); + if ( it == m_listsvc.end() ) return StatusCode::FAILURE; m_listsvc.erase( it ); - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } //------------------------------------------------------------------------------ @@ -277,7 +277,7 @@ StatusCode ServiceManager::initialize() // we work on a copy to avoid to operate twice on the services created on demand // which are already in the correct state. - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // call initialize() for all services for ( auto& it : activeSvc( m_listsvc ) ) { const std::string& name = it->name(); @@ -311,7 +311,7 @@ StatusCode ServiceManager::start() // we work on a copy to avoid to operate twice on the services created on demand // (which are already in the correct state. // only act on active services - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // call initialize() for all services for ( auto& it : activeSvc( m_listsvc ) ) { const std::string& name = it->name(); @@ -345,7 +345,7 @@ StatusCode ServiceManager::stop() // which are already in the correct state. // only act on active services - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // call stop() for all services for ( const auto& svc : reverse( activeSvc( m_listsvc ) ) ) { const std::string& name = svc->name(); @@ -378,7 +378,7 @@ StatusCode ServiceManager::reinitialize() // we work on a copy to avoid to operate twice on the services created on demand // which are already in the correct state. // only act on active services - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // Re-Initialize all services for ( auto& svc : activeSvc( m_listsvc ) ) { sc = svc->sysReinitialize(); @@ -399,7 +399,7 @@ StatusCode ServiceManager::restart() // we work on a copy to avoid to operate twice on the services created on demand // which are already in the correct state. // only act on active services - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; // Re-Start all services for ( auto& svc : activeSvc( m_listsvc ) ) { sc = svc->sysRestart(); @@ -416,7 +416,7 @@ StatusCode ServiceManager::finalize() //------------------------------------------------------------------------------ { // make sure that HistogramDataSvc and THistSvc get finalized after the - // ToolSvc, and the FileMgr and StatusCodeSvc after that + // ToolSvc, and the FileMgr after that int pri_tool = getPriority( "ToolSvc" ); if ( pri_tool != 0 ) { setPriority( "THistSvc", pri_tool - 10 ).ignore(); @@ -438,14 +438,11 @@ StatusCode ServiceManager::finalize() p_inc.reset(); } - // make sure the StatusCodeSvc gets finalized really late: - setPriority( "StatusCodeSvc", -9999 ).ignore(); - // ensure that the list is ordered by priority m_listsvc.sort(); // dump(); - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; { // we work on a copy to avoid to operate twice on the services created on demand // which are already in the correct state. diff --git a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp index c8c5549e1c9e1ed737a7f45ace0d85d9fda81689..9a43e07ebe046e5505a7fcd02c5238589eb76f7c 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ToolSvc.cpp @@ -495,7 +495,7 @@ StatusCode ToolSvc::create( const std::string& tooltype, const std::string& tool if ( mytool ) mytool->bindPropertiesTo( serviceLocator()->getOptsSvc() ); // Initialize the Tool - StatusCode sc( StatusCode::FAILURE, true ); + StatusCode sc = StatusCode::FAILURE; try { sc = toolguard->sysInitialize(); } diff --git a/GaudiCoreSvc/src/EventSelector/EventSelector.cpp b/GaudiCoreSvc/src/EventSelector/EventSelector.cpp index f557fd314fe6338af53b58ef93c06796a2ffc594..19869cbd5baa7f2102d492e466392a8064c914f4 100644 --- a/GaudiCoreSvc/src/EventSelector/EventSelector.cpp +++ b/GaudiCoreSvc/src/EventSelector/EventSelector.cpp @@ -103,7 +103,6 @@ StatusCode EventSelector::firstOfNextStream( bool shutDown, EvtSelectorContext& } iter.set( this, -1, 0, 0 ); - status.setChecked(); // m_incidentSvc->fireIncident(Incident(s->dbName(),IncidentType::FailInputFile)); return StatusCode::FAILURE; } diff --git a/GaudiExamples/CMakeLists.txt b/GaudiExamples/CMakeLists.txt index 083c2817ef7efce6dfa8692756bc313c9e942496..9dcf098cefdac4738465e8babe4a6dc34b990dd3 100644 --- a/GaudiExamples/CMakeLists.txt +++ b/GaudiExamples/CMakeLists.txt @@ -1,5 +1,5 @@ ##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # +# (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations # # # # This software is distributed under the terms of the Apache version 2 licence, # # copied verbatim in the file "LICENSE". # @@ -86,8 +86,6 @@ gaudi_add_module(GaudiExamples src/ReEntAlg/ReEntAlg.cpp src/Selections/SelCreate.cpp src/Selections/SelFilter.cpp - src/StatusCodeSvc/SCSAlg.cpp - src/StatusCodeSvc/special/SCSAlg_no_inline.cpp src/StringKeys/StringKeyEx.cpp src/SvcInitLoop/LoopAlg.cpp src/SvcInitLoop/ServiceA.cpp diff --git a/GaudiExamples/options/FileMgrTest.opts b/GaudiExamples/options/FileMgrTest.opts index 5e2c4b0d77548c9d638150ab7b2ffbc1159412af..45d1f6c1a39d7e2cc1bfe34340b30973ab4bbebe 100644 --- a/GaudiExamples/options/FileMgrTest.opts +++ b/GaudiExamples/options/FileMgrTest.opts @@ -21,11 +21,9 @@ FileMgr.LogFile = "filemgr.log"; //FileMgr.TSSL_CertDir = "NONE"; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; -StatusCodeSvc.OutputLevel = 1; //-------------------------------------------------------------- // Event related parameters //-------------------------------------------------------------- ApplicationMgr.EvtMax = 3; ApplicationMgr.EvtSel = "NONE"; - diff --git a/GaudiExamples/options/History.opts b/GaudiExamples/options/History.opts index 86d1bb81af75ff44756bab49e5260270d7838ca0..52f081202797812ac3bba5b704669b7e0a779ebb 100644 --- a/GaudiExamples/options/History.opts +++ b/GaudiExamples/options/History.opts @@ -18,7 +18,7 @@ MessageSvc.useColors = true; MessageSvc.setVerbose += { "HistorySvc" }; MessageSvc.setDebug += { "FastHistorySvc" }; -MessageSvc.setDebug += { "StatusCodeSvc", "IncidentSvc" }; +MessageSvc.setDebug += { "IncidentSvc" }; HistorySvc.Dump = false; HistorySvc.OutputFile = "history.dat"; diff --git a/GaudiExamples/options/QotdAlg.opts b/GaudiExamples/options/QotdAlg.opts index 3f4917cbd3b297b28273b3dac8e4bd78b90b347f..6f3b9c5b12a8331e98d82aecc72771fbb1518667 100644 --- a/GaudiExamples/options/QotdAlg.opts +++ b/GaudiExamples/options/QotdAlg.opts @@ -30,7 +30,6 @@ MessageSvc.OutputLevel = 3; // MessageSvc.UseColors = true; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; -StatusCodeSvc.OutputLevel = 1; @@ -39,5 +38,3 @@ StatusCodeSvc.OutputLevel = 1; //-------------------------------------------------------------- ApplicationMgr.EvtMax = 5; ApplicationMgr.EvtSel = "NONE"; - - diff --git a/GaudiExamples/options/THistRead.opts b/GaudiExamples/options/THistRead.opts index 9a5ffad2c903a6e2e6c9d74d69a353b903c4fb22..7eb43b4080db324eb8d7717520979f49973c1bf6 100644 --- a/GaudiExamples/options/THistRead.opts +++ b/GaudiExamples/options/THistRead.opts @@ -17,7 +17,6 @@ MessageSvc.useColors = true; THistSvc.OutputLevel = 2; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; -StatusCodeSvc.OutputLevel = 1; @@ -31,4 +30,3 @@ THistSvc.PrintAll = true; //-------------------------------------------------------------- ApplicationMgr.EvtMax = 20; ApplicationMgr.EvtSel = "NONE"; - diff --git a/GaudiExamples/options/THistWrite.opts b/GaudiExamples/options/THistWrite.opts index fbfa5d5ef5026bc33dda12892ab46eadcdbf7e7f..d9a29d937d4abc5dde7f3aa4a9a9385d2142ed08 100644 --- a/GaudiExamples/options/THistWrite.opts +++ b/GaudiExamples/options/THistWrite.opts @@ -17,7 +17,6 @@ MessageSvc.useColors = true; THistSvc.OutputLevel = 2; ApplicationMgr.OutputLevel = 1; ServiceManager.OutputLevel = 2; -StatusCodeSvc.OutputLevel = 1; @@ -32,5 +31,3 @@ THistSvc.PrintAll = true; //-------------------------------------------------------------- ApplicationMgr.EvtMax = 20; ApplicationMgr.EvtSel = "NONE"; - - diff --git a/GaudiExamples/python/GaudiExamples/StatusCodeSvcTestConf.py b/GaudiExamples/python/GaudiExamples/StatusCodeSvcTestConf.py deleted file mode 100644 index 2eec70e0633e6953f0355651dfe99388a78872ab..0000000000000000000000000000000000000000 --- a/GaudiExamples/python/GaudiExamples/StatusCodeSvcTestConf.py +++ /dev/null @@ -1,25 +0,0 @@ -##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # -# # -# This software is distributed under the terms of the Apache version 2 licence, # -# copied verbatim in the file "LICENSE". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -##################################################################################### -''' -Define common configuration for the StatusCodeSvc tests. -''' - - -def setup(): - from Gaudi.Configuration import VERBOSE - from Configurables import (ApplicationMgr, GaudiExamplesCommonConf, - StatusCodeSvc, SCSAlg) - - GaudiExamplesCommonConf(DummyEvents=5) - - StatusCodeSvc(OutputLevel=VERBOSE) - - ApplicationMgr(TopAlg=[SCSAlg()]) diff --git a/GaudiExamples/src/QueueingEventProcessor/QueueingEventLoopMgr.cpp b/GaudiExamples/src/QueueingEventProcessor/QueueingEventLoopMgr.cpp index bad679377c5e105980782eabcd2891b494ee79b7..9906478eb5aa96f7738fb5ffd48409ab8af5e973 100644 --- a/GaudiExamples/src/QueueingEventProcessor/QueueingEventLoopMgr.cpp +++ b/GaudiExamples/src/QueueingEventProcessor/QueueingEventLoopMgr.cpp @@ -117,7 +117,7 @@ StatusCode QueueingEventLoopMgr::start() { --m_inFlight; // yes, this is not accurate. } else { DEBMSG << "exiting event loop thread" << endmsg; - m_done.emplace( StatusCode{StatusCode::SUCCESS, true}, std::move( ctx ) ); + m_done.emplace( StatusCode::SUCCESS, std::move( ctx ) ); --m_inFlight; // yes, this is not accurate. break; } @@ -186,14 +186,14 @@ std::tuple<StatusCode, EventContext> QueueingEventLoopMgr::processEvent( EventCo } } - StatusCode outcome{StatusCode::SUCCESS, true}; + StatusCode outcome = StatusCode::SUCCESS; // Check if there was an error processing current event if ( UNLIKELY( eventfailed ) ) { error() << "Error processing event loop." << endmsg; std::ostringstream ost; m_aess->dump( ost, context ); DEBMSG << "Dumping AlgExecStateSvc status:\n" << ost.str() << endmsg; - outcome = StatusCode{StatusCode::FAILURE, true}; + outcome = StatusCode::FAILURE; } return {std::move( outcome ), std::move( context )}; diff --git a/GaudiExamples/src/StatusCodeSvc/SCSAlg.cpp b/GaudiExamples/src/StatusCodeSvc/SCSAlg.cpp deleted file mode 100644 index c80a729e52beb71e069d7f3ba966d06a3cdce323..0000000000000000000000000000000000000000 --- a/GaudiExamples/src/StatusCodeSvc/SCSAlg.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * -* * -* This software is distributed under the terms of the Apache version 2 licence, * -* copied verbatim in the file "LICENSE". * -* * -* In applying this licence, CERN does not waive the privileges and immunities * -* granted to it by virtue of its status as an Intergovernmental Organization * -* or submit itself to any jurisdiction. * -\***********************************************************************************/ -#include "SCSAlg.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/MsgStream.h" - -#if __cplusplus >= 201703L && !defined( __CLING__ ) -# pragma GCC diagnostic ignored "-Wunused-result" -#endif -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -StatusCode SCSAlg::execute() { - - fncChecked(); - fncUnchecked(); - fncUnchecked2(); - fncIgnored(); - - return StatusCode::SUCCESS; -} - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -StatusCode SCSAlg::test() { return StatusCode::SUCCESS; } - -void __attribute__( ( noinline ) ) SCSAlg::fncChecked() { test().isSuccess(); } - -void __attribute__( ( noinline ) ) SCSAlg::fncUnchecked() { test(); } - -void SCSAlg::fncIgnored() { - // Ignore all unchecked StatusCode instances in the current scope. - StatusCode::ScopedDisableChecking _sc_ignore; - - test(); -} - -// Static Factory declaration -DECLARE_COMPONENT( SCSAlg ) diff --git a/GaudiExamples/src/StatusCodeSvc/SCSAlg.h b/GaudiExamples/src/StatusCodeSvc/SCSAlg.h deleted file mode 100644 index 03e3ab187fdeee19bd3b512dc7ab03a3a6936058..0000000000000000000000000000000000000000 --- a/GaudiExamples/src/StatusCodeSvc/SCSAlg.h +++ /dev/null @@ -1,36 +0,0 @@ -/***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * -* * -* This software is distributed under the terms of the Apache version 2 licence, * -* copied verbatim in the file "LICENSE". * -* * -* In applying this licence, CERN does not waive the privileges and immunities * -* granted to it by virtue of its status as an Intergovernmental Organization * -* or submit itself to any jurisdiction. * -\***********************************************************************************/ -#ifndef SCS_SCSALG_H -#define SCS_SCSALG_H - -#include "GaudiKernel/Algorithm.h" - -/** - * @brief an algorithm to test the StatusCodeSvc - * @author Charles Leggett, Marco Clemencic - */ -class SCSAlg : public Algorithm { - -public: - using Algorithm::Algorithm; - StatusCode execute() override; - - StatusCode test(); - - void fncChecked(); - void fncUnchecked(); - void fncUnchecked2(); - void fncIgnored(); - -private: -}; - -#endif diff --git a/GaudiExamples/src/StatusCodeSvc/special/SCSAlg_no_inline.cpp b/GaudiExamples/src/StatusCodeSvc/special/SCSAlg_no_inline.cpp deleted file mode 100644 index 0ece00834d1fec0bf2f3ca47904e19fc8bd0831a..0000000000000000000000000000000000000000 --- a/GaudiExamples/src/StatusCodeSvc/special/SCSAlg_no_inline.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * -* * -* This software is distributed under the terms of the Apache version 2 licence, * -* copied verbatim in the file "LICENSE". * -* * -* In applying this licence, CERN does not waive the privileges and immunities * -* granted to it by virtue of its status as an Intergovernmental Organization * -* or submit itself to any jurisdiction. * -\***********************************************************************************/ -#include "../SCSAlg.h" -#define STATUSCODE_DESTRUCTOR_LINKAGE __attribute__( ( noinline ) ) -#include "GaudiKernel/StatusCode.h" - -#if __cplusplus >= 201703L && !defined( __CLING__ ) -# pragma GCC diagnostic ignored "-Wunused-result" -#endif - -void SCSAlg::fncUnchecked2() { test(); } diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/configurableuser.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/configurableuser.qmt index 842fa84a005fe8292dd1bab0cdb94b03f8ff71d3..1a346f0ca40a762bc1cfd45b23da695a2cccfa61 100644 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/configurableuser.qmt +++ b/GaudiExamples/tests/qmtest/gaudiexamples.qms/configurableuser.qmt @@ -16,7 +16,6 @@ <text>ConfigurableUser.py</text></set></argument> <argument name="validator"><text> countErrorLines() -findReferenceBlock("ServiceManager DEBUG Initializing service StatusCodeSvc") findReferenceBlock(""" ==== Configuration completed ==== /***** Service ApplicationMgr/ApplicationMgr ******************************************************* diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/basic.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/basic.qmt deleted file mode 100644 index a9674b72d5804341712963a661ccb5a3f48d61e9..0000000000000000000000000000000000000000 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/basic.qmt +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> -<!-- - (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations - - This software is distributed under the terms of the Apache version 2 licence, - copied verbatim in the file "LICENSE". - - In applying this licence, CERN does not waive the privileges and immunities - granted to it by virtue of its status as an Intergovernmental Organization - or submit itself to any jurisdiction. ---> -<extension class="GaudiTest.GaudiExeTest" kind="test"> -<argument name="program"><text>gaudirun.py</text></argument> -<argument name="options"><text> -from Configurables import StatusCodeSvc - -import GaudiExamples.StatusCodeSvcTestConf -GaudiExamples.StatusCodeSvcTestConf.setup() -</text></argument> -<argument name="use_temp_dir"><enumeral>true</enumeral></argument> -<argument name="validator"><text> -findReferenceBlock(''' -StatusCodeSvc INFO listing all unchecked return codes: -StatusCodeSvc INFO -Num | Function | Source Library -----+--------------------------------+------------------------------------------ - 5 | SCSAlg::fncUnchecked() | libGaudiExamples.so - 5 | SCSAlg::fncUnchecked2() | libGaudiExamples.so - -''') -</text></argument> -</extension> diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter1.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter1.qmt deleted file mode 100644 index 19e6f5ab93ad9298e2c47cbf5ec23e143a1dbc16..0000000000000000000000000000000000000000 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter1.qmt +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> -<!-- - (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations - - This software is distributed under the terms of the Apache version 2 licence, - copied verbatim in the file "LICENSE". - - In applying this licence, CERN does not waive the privileges and immunities - granted to it by virtue of its status as an Intergovernmental Organization - or submit itself to any jurisdiction. ---> -<extension class="GaudiTest.GaudiExeTest" kind="test"> -<argument name="program"><text>gaudirun.py</text></argument> -<argument name="options"><text> -from Configurables import StatusCodeSvc - -import GaudiExamples.StatusCodeSvcTestConf -GaudiExamples.StatusCodeSvcTestConf.setup() - -StatusCodeSvc().Filter = ['SCSAlg::fncUnchecked2()'] -</text></argument> -<argument name="use_temp_dir"><enumeral>true</enumeral></argument> -<argument name="validator"><text> -findReferenceBlock(''' -StatusCodeSvc INFO listing all unchecked return codes: -StatusCodeSvc INFO -Num | Function | Source Library -----+--------------------------------+------------------------------------------ - 5 | SCSAlg::fncUnchecked() | libGaudiExamples.so - -''') -</text></argument> -</extension> diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter2.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter2.qmt deleted file mode 100644 index 5415b1b61ff65bd2acddc16365039cf37dfef3b8..0000000000000000000000000000000000000000 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter2.qmt +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> -<!-- - (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations - - This software is distributed under the terms of the Apache version 2 licence, - copied verbatim in the file "LICENSE". - - In applying this licence, CERN does not waive the privileges and immunities - granted to it by virtue of its status as an Intergovernmental Organization - or submit itself to any jurisdiction. ---> -<extension class="GaudiTest.GaudiExeTest" kind="test"> -<argument name="program"><text>gaudirun.py</text></argument> -<argument name="options"><text> -from Configurables import StatusCodeSvc - -import GaudiExamples.StatusCodeSvcTestConf -GaudiExamples.StatusCodeSvcTestConf.setup() - -StatusCodeSvc().Filter = ['FNC=SCSAlg::fncUnchecked()'] -</text></argument> -<argument name="use_temp_dir"><enumeral>true</enumeral></argument> -<argument name="validator"><text> -findReferenceBlock(''' -StatusCodeSvc INFO listing all unchecked return codes: -StatusCodeSvc INFO -Num | Function | Source Library -----+--------------------------------+------------------------------------------ - 5 | SCSAlg::fncUnchecked2() | libGaudiExamples.so - -''') -</text></argument> -</extension> diff --git a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter_lib.qmt b/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter_lib.qmt deleted file mode 100644 index 4e60e612da29b9927f9022a0a680898a13825f68..0000000000000000000000000000000000000000 --- a/GaudiExamples/tests/qmtest/gaudiexamples.qms/statuscodesvc.qms/filter_lib.qmt +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'> -<!-- - (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations - - This software is distributed under the terms of the Apache version 2 licence, - copied verbatim in the file "LICENSE". - - In applying this licence, CERN does not waive the privileges and immunities - granted to it by virtue of its status as an Intergovernmental Organization - or submit itself to any jurisdiction. ---> -<extension class="GaudiTest.GaudiExeTest" kind="test"> -<argument name="program"><text>gaudirun.py</text></argument> -<argument name="options"><text> -from Configurables import StatusCodeSvc - -import GaudiExamples.StatusCodeSvcTestConf -GaudiExamples.StatusCodeSvcTestConf.setup() - -StatusCodeSvc().Filter = ['LIB=libGaudiExamples.so'] -</text></argument> -<argument name="use_temp_dir"><enumeral>true</enumeral></argument> -<argument name="validator"><text> -findReferenceBlock(''' -StatusCodeSvc DEBUG all StatusCode instances where checked -''') -</text></argument> -</extension> diff --git a/GaudiExamples/tests/qmtest/refs/ColorMsg.ref b/GaudiExamples/tests/qmtest/refs/ColorMsg.ref index ce67567d20c976b433ae341b0ed286330c77301c..1ccfb71e92041cb626e9e747ac8019b9586a7266 100644 --- a/GaudiExamples/tests/qmtest/refs/ColorMsg.ref +++ b/GaudiExamples/tests/qmtest/refs/ColorMsg.ref @@ -23,9 +23,6 @@ ApplicationMgr SUCCESS running on pcphlbc16 on Sat Oct 7 10:17:01 2017 ====================================================================================================================================[m [96;1mApplicationMgr INFO Application Manager Configured successfully[m -[92;1mServiceManager DEBUG Initializing service StatusCodeSvc[m -[92;1mStatusCodeSvc DEBUG Service base class initialized successfully[m -[96;1mStatusCodeSvc INFO initialize[m [92;1mServiceManager DEBUG Initializing service AppMgrRunable[m [92;1mAppMgrRunable DEBUG Service base class initialized successfully[m [92;1mServiceManager DEBUG Initializing service EventLoopMgr[m @@ -55,7 +52,6 @@ ApplicationMgr SUCCESS [93;1mHistogramPersis...WARNING Histograms saving not required.[m [95;4mHistogramDataSvc VERBOSE ServiceLocatorHelper::service: found service HistogramPersistencySvc[m [96;1mApplicationMgr INFO Application Manager Initialized successfully[m -[92;1mServiceManager DEBUG Starting service StatusCodeSvc[m [92;1mServiceManager DEBUG Starting service AppMgrRunable[m [92;1mServiceManager DEBUG Starting service IncidentSvc[m [92;1mServiceManager DEBUG Starting service EventPersistencySvc[m @@ -109,7 +105,6 @@ ApplicationMgr SUCCESS [92;1mServiceManager DEBUG Stopping service EventPersistencySvc[m [92;1mServiceManager DEBUG Stopping service IncidentSvc[m [92;1mServiceManager DEBUG Stopping service AppMgrRunable[m -[92;1mServiceManager DEBUG Stopping service StatusCodeSvc[m [96;1mApplicationMgr INFO Application Manager Stopped successfully[m [92;1mServiceManager DEBUG Finalizing service EventLoopMgr[m [92;1mIncidentSvc DEBUG Removing [AbortEvent] listener '<unknown>'[m @@ -123,11 +118,8 @@ ApplicationMgr SUCCESS [92;1mServiceManager DEBUG Finalizing service IncidentSvc[m [92;1mIncidentSvc DEBUG Incident timing: Mean(+-rms)/Min/Max:0(+-0)/0/0[ms] Total:0[s][m [92;1mServiceManager DEBUG Finalizing service AppMgrRunable[m -[92;1mServiceManager DEBUG Finalizing service StatusCodeSvc[m -[92;1mStatusCodeSvc DEBUG all StatusCode instances where checked[m [92;1mServiceManager DEBUG Looping over all active services...[m -[92;1mServiceManager DEBUG ---- StatusCodeSvc (refCount = 2)[m -[92;1mServiceManager DEBUG ---- MessageSvc (refCount = 18)[m +[92;1mServiceManager DEBUG ---- MessageSvc (refCount = 17)[m [92;1mServiceManager DEBUG ---- JobOptionsSvc (refCount = 3)[m [92;1mServiceManager DEBUG ---- AppMgrRunable (refCount = 3)[m [92;1mServiceManager DEBUG ---- IncidentSvc (refCount = 2)[m diff --git a/GaudiExamples/tests/qmtest/refs/ColorMsg_py.ref b/GaudiExamples/tests/qmtest/refs/ColorMsg_py.ref index 5f686b4b725a17965e3a77284a2857efb63262ea..8cea9a86dcd749ed08df78eb9a46a75bc60407a6 100644 --- a/GaudiExamples/tests/qmtest/refs/ColorMsg_py.ref +++ b/GaudiExamples/tests/qmtest/refs/ColorMsg_py.ref @@ -24,9 +24,6 @@ ApplicationMgr SUCCESS running on pcphlbc16 on Tue Mar 7 13:08:55 2017 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -[92;1mServiceManager DEBUG Initializing service StatusCodeSvc[m -[92;1mStatusCodeSvc DEBUG Service base class initialized successfully[m -[96;1mStatusCodeSvc INFO initialize[m [92;1mServiceManager DEBUG Initializing service AppMgrRunable[m [92;1mAppMgrRunable DEBUG Service base class initialized successfully[m [92;1mServiceManager DEBUG Initializing service EventLoopMgr[m @@ -56,7 +53,6 @@ ApplicationMgr INFO Application Manager Configured successfully [93;1mHistogramPersis...WARNING Histograms saving not required.[m [95;4mHistogramDataSvc VERBOSE ServiceLocatorHelper::service: found service HistogramPersistencySvc[m [96;1mApplicationMgr INFO Application Manager Initialized successfully[m -[92;1mServiceManager DEBUG Starting service StatusCodeSvc[m [92;1mServiceManager DEBUG Starting service AppMgrRunable[m [92;1mServiceManager DEBUG Starting service IncidentSvc[m [92;1mServiceManager DEBUG Starting service EventPersistencySvc[m @@ -110,7 +106,6 @@ ApplicationMgr INFO Application Manager Configured successfully [92;1mServiceManager DEBUG Stopping service EventPersistencySvc[m [92;1mServiceManager DEBUG Stopping service IncidentSvc[m [92;1mServiceManager DEBUG Stopping service AppMgrRunable[m -[92;1mServiceManager DEBUG Stopping service StatusCodeSvc[m [96;1mApplicationMgr INFO Application Manager Stopped successfully[m [92;1mServiceManager DEBUG Finalizing service EventLoopMgr[m [92;1mIncidentSvc DEBUG Removing [AbortEvent] listener '<unknown>'[m @@ -124,11 +119,8 @@ ApplicationMgr INFO Application Manager Configured successfully [92;1mServiceManager DEBUG Finalizing service IncidentSvc[m [92;1mIncidentSvc DEBUG Incident timing: Mean(+-rms)/Min/Max:0(+-0)/0/0[ms] Total:0[s][m [92;1mServiceManager DEBUG Finalizing service AppMgrRunable[m -[92;1mServiceManager DEBUG Finalizing service StatusCodeSvc[m -[92;1mStatusCodeSvc DEBUG all StatusCode instances where checked[m [92;1mServiceManager DEBUG Looping over all active services...[m -[92;1mServiceManager DEBUG ---- StatusCodeSvc (refCount = 2)[m -[92;1mServiceManager DEBUG ---- MessageSvc (refCount = 18)[m +[92;1mServiceManager DEBUG ---- MessageSvc (refCount = 17)[m [92;1mServiceManager DEBUG ---- JobOptionsSvc (refCount = 3)[m [92;1mServiceManager DEBUG ---- AppMgrRunable (refCount = 3)[m [92;1mServiceManager DEBUG ---- IncidentSvc (refCount = 2)[m diff --git a/GaudiExamples/tests/qmtest/refs/History.ref b/GaudiExamples/tests/qmtest/refs/History.ref index 4f81452d58999789ba5f9679e489ae9864482dba..31f66304c572d5f57284932276c023c4c933ed11 100644 --- a/GaudiExamples/tests/qmtest/refs/History.ref +++ b/GaudiExamples/tests/qmtest/refs/History.ref @@ -26,9 +26,6 @@ ApplicationMgr SUCCESS running on pcphlbc16 on Sat Oct 7 10:18:11 2017 ====================================================================================================================================[m ApplicationMgr INFO Application Manager Configured successfully[m -ServiceManager DEBUG Initializing service StatusCodeSvc[m -StatusCodeSvc DEBUG Service base class initialized successfully[m -StatusCodeSvc INFO initialize[m ServiceManager DEBUG Initializing service AppMgrRunable[m AppMgrRunable DEBUG Service base class initialized successfully[m ServiceManager DEBUG Initializing service EventLoopMgr[m @@ -71,7 +68,6 @@ HistorySvc VERBOSE ServiceLocatorHelper::service: found service IncidentS ToolSvc DEBUG Service base class initialized successfully[m IncidentSvc DEBUG Adding [BeginEvent] listener 'HistorySvc' with priority -9223372036854775808[m ApplicationMgr INFO Application Manager Initialized successfully[m -ServiceManager DEBUG Starting service StatusCodeSvc[m ServiceManager DEBUG Starting service AppMgrRunable[m ServiceManager DEBUG Starting service IncidentSvc[m ServiceManager DEBUG Starting service EventPersistencySvc[m @@ -89,8 +85,7 @@ ApplicationMgr INFO Application Manager Started successfully[m HistorySvc DEBUG Registering algorithm: [96;1mHistory[m HistorySvc INFO [mRegistered 1 Algorithms[m HistorySvc INFO Registered 0 AlgTools[m -HistorySvc DEBUG Registering Service: [96;1mStatusCodeSvc[m -HistorySvc DEBUG [mRegistering Service: [96;1mMessageSvc[m +HistorySvc DEBUG Registering Service: [96;1mMessageSvc[m HistorySvc DEBUG [mRegistering Service: [96;1mJobOptionsSvc[m HistorySvc DEBUG [mRegistering Service: [96;1mAppMgrRunable[m HistorySvc DEBUG [mRegistering Service: [96;1mIncidentSvc[m @@ -104,7 +99,7 @@ HistorySvc DEBUG [mRegistering Service: [96;1mAlgContextSvc[m HistorySvc DEBUG [mRegistering Service: [96;1mToolSvc[m HistorySvc DEBUG [mRegistering Service: [96;1mEventLoopMgr[m HistorySvc DEBUG [mRegistering Service: [96;1mHistorySvc[m -HistorySvc INFO [mRegistered 15 Services[m +HistorySvc INFO [mRegistered 14 Services[m AlgExecStateSvc VERBOSE reset(0)[m AlgExecStateSvc DEBUG resizing state containers to : 1[m AlgExecStateSvc DEBUG adding alg History to 1 slots[m @@ -128,7 +123,6 @@ HistorySvc VERBOSE HistorySvc is Service[m HistorySvc VERBOSE IncidentSvc is Service[m HistorySvc VERBOSE JobOptionsSvc is Service[m HistorySvc VERBOSE MessageSvc is Service[m -HistorySvc VERBOSE StatusCodeSvc is Service[m HistorySvc VERBOSE TimelineSvc is Service[m HistorySvc VERBOSE ToolSvc is Service[m HistorySvc VERBOSE History is Alg[m @@ -144,7 +138,6 @@ ServiceManager DEBUG Stopping service EventDataSvc[m ServiceManager DEBUG Stopping service EventPersistencySvc[m ServiceManager DEBUG Stopping service IncidentSvc[m ServiceManager DEBUG Stopping service AppMgrRunable[m -ServiceManager DEBUG Stopping service StatusCodeSvc[m ApplicationMgr INFO Application Manager Stopped successfully[m ServiceManager DEBUG Finalizing service EventLoopMgr[m IncidentSvc DEBUG Removing [AbortEvent] listener '<unknown>'[m @@ -168,11 +161,8 @@ ServiceManager DEBUG Finalizing service HistogramPersistencySvc[m ServiceManager DEBUG Finalizing service HistorySvc[m HistorySvc VERBOSE HistorySvc::finalize()[m HistorySvc INFO Service finalised successfully[m -ServiceManager DEBUG Finalizing service StatusCodeSvc[m -StatusCodeSvc DEBUG all StatusCode instances where checked[m ServiceManager DEBUG Looping over all active services...[m -ServiceManager DEBUG ---- StatusCodeSvc (refCount = 3)[m -ServiceManager DEBUG ---- MessageSvc (refCount = 22)[m +ServiceManager DEBUG ---- MessageSvc (refCount = 21)[m ServiceManager DEBUG ---- JobOptionsSvc (refCount = 4)[m ServiceManager DEBUG ---- HistorySvc (refCount = 3)[m ServiceManager DEBUG ---- HistogramPersistencySvc (refCount = 3)[m diff --git a/GaudiHive/options/AvalancheSchedulerErrorTest.py b/GaudiHive/options/AvalancheSchedulerErrorTest.py index 57ac1dc21eadf59ad2b2f23e30de998745b994fc..d034c4cc7f9dee5d69de9e0ad2047b55f2bec4ea 100644 --- a/GaudiHive/options/AvalancheSchedulerErrorTest.py +++ b/GaudiHive/options/AvalancheSchedulerErrorTest.py @@ -18,8 +18,7 @@ Test the correct handling on errors during the event processing: from Gaudi.Configuration import * from Configurables import (HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc, AlgResourcePool, CPUCruncher, - InertMessageSvc, ApplicationMgr, StatusCodeSvc, - CPUCrunchSvc) + InertMessageSvc, ApplicationMgr, CPUCrunchSvc) evtslots = 8 evtMax = 50 @@ -38,8 +37,6 @@ scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=DEBUG) AlgResourcePool(OutputLevel=DEBUG) CPUCrunchSvc(shortCalib=True) -scs = StatusCodeSvc("StatusCodeSvc", OutputLevel=DEBUG) - # # - A3 returns an ERROR once in a while # - A1-A2-A4 execute normally and then a stall is detected @@ -80,7 +77,7 @@ ApplicationMgr().SvcMapping.append(msgSvc) ApplicationMgr( EvtMax=evtMax, EvtSel='NONE', - ExtSvc=[whiteboard, scs], + ExtSvc=[whiteboard], EventLoop=slimeventloopmgr, TopAlg=[a1, a2, a3, a4, a5], MessageSvcType="InertMessageSvc") diff --git a/GaudiHive/src/AvalancheSchedulerSvc.cpp b/GaudiHive/src/AvalancheSchedulerSvc.cpp index cdf8c4bf5b51c4fe1dc3a4332a06dc84cd2cedb7..587ed70877fa3affae54f9126d3a54e6869f1903 100644 --- a/GaudiHive/src/AvalancheSchedulerSvc.cpp +++ b/GaudiHive/src/AvalancheSchedulerSvc.cpp @@ -604,7 +604,7 @@ StatusCode AvalancheSchedulerSvc::iterate() { // Cache the states of the algorithms to improve readability and performance AlgsExecutionStates& thisAlgsStates = thisSlot.algsStates; - StatusCode partial_sc( StatusCode::FAILURE, true ); + StatusCode partial_sc = StatusCode::FAILURE; // Make an occupancy snapshot if ( m_snapshotInterval != std::chrono::duration<int64_t, std::milli>::min() && diff --git a/GaudiHive/src/PRGraph/PrecedenceRulesGraph.cpp b/GaudiHive/src/PRGraph/PrecedenceRulesGraph.cpp index 4f5c75b54591585c5776bcb8640ae6939037e283..717916f75b2ec1159e77c6afb4f94c069bcf79e2 100644 --- a/GaudiHive/src/PRGraph/PrecedenceRulesGraph.cpp +++ b/GaudiHive/src/PRGraph/PrecedenceRulesGraph.cpp @@ -317,7 +317,7 @@ namespace concurrency { //--------------------------------------------------------------------------- StatusCode PrecedenceRulesGraph::buildDataDependenciesRealm() { - StatusCode global_sc( StatusCode::SUCCESS, true ); + StatusCode global_sc = StatusCode::SUCCESS; // Production of DataNodes by AlgorithmNodes (DataNodes are created here) std::vector<decltype( m_algoNameToAlgoNodeMap )::value_type*> sortedAlgs; diff --git a/GaudiKernel/dict/dictionary.h b/GaudiKernel/dict/dictionary.h index ab98df753520fc28f8685f4701f24b032b2cfea7..23462d348b89c6c875ceb3e8e04d8a2b9f4c6d61 100644 --- a/GaudiKernel/dict/dictionary.h +++ b/GaudiKernel/dict/dictionary.h @@ -98,7 +98,6 @@ #include "GaudiKernel/ISerialize.h" #include "GaudiKernel/IService.h" #include "GaudiKernel/IStagerSvc.h" -#include "GaudiKernel/IStatusCodeSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcManager.h" #include "GaudiKernel/ITHistSvc.h" diff --git a/GaudiKernel/dict/dictionary.xml b/GaudiKernel/dict/dictionary.xml index 9d0a4bda8f6ecc055d976c1706568bebde6c5421..51b787a207b250f9b8d79a81446b47241324aee5 100644 --- a/GaudiKernel/dict/dictionary.xml +++ b/GaudiKernel/dict/dictionary.xml @@ -107,7 +107,6 @@ <class name="IService"/> <class name="IStagerSvc"/> <class name="IStateful"/> - <class name="IStatusCodeSvc"/> <!--class name="ISvcFactory"/--> <class name="ISvcLocator"/> <class name="ISvcManager"/> diff --git a/GaudiKernel/include/GaudiKernel/BoostArrayAsProperty.h b/GaudiKernel/include/GaudiKernel/BoostArrayAsProperty.h index 8d49a21c97b8cfc59b987ccd4e1028fe3130352b..6ed57e272b22121639a500b1e774fad1ed89ef90 100644 --- a/GaudiKernel/include/GaudiKernel/BoostArrayAsProperty.h +++ b/GaudiKernel/include/GaudiKernel/BoostArrayAsProperty.h @@ -86,8 +86,8 @@ namespace Gaudi { _Vct tmp; // parse the string StatusCode sc = parse( tmp, input ); - if ( sc.isFailure() ) { return sc; } // RETURN - if ( N != tmp.size() ) { return StatusCode( StatusCode::FAILURE, true ); } // RETURN + if ( sc.isFailure() ) { return sc; } + if ( N != tmp.size() ) { return StatusCode::FAILURE; } // copy vector into array std::copy( tmp.begin(), tmp.end(), result.begin() ); // diff --git a/GaudiKernel/include/GaudiKernel/IAlgExecStateSvc.h b/GaudiKernel/include/GaudiKernel/IAlgExecStateSvc.h index 7dae1436cfc25d2e3815340b0039ae80eb0fdce9..93b7d40f602f143f09ce65c64af1efecbd299827 100644 --- a/GaudiKernel/include/GaudiKernel/IAlgExecStateSvc.h +++ b/GaudiKernel/include/GaudiKernel/IAlgExecStateSvc.h @@ -54,7 +54,7 @@ public: private: bool m_filterPassed{true}; State m_state{State::None}; - StatusCode m_execStatus{StatusCode( StatusCode::FAILURE, true )}; + StatusCode m_execStatus{StatusCode::FAILURE}; }; inline std::ostream& operator<<( std::ostream& ost, const AlgExecState& s ) { diff --git a/GaudiKernel/include/GaudiKernel/IAuditor.h b/GaudiKernel/include/GaudiKernel/IAuditor.h index c481def64abda8098e351fc6d4d48037f9659a05..326d5a3689bc363d790727198f8b62f32652c645 100644 --- a/GaudiKernel/include/GaudiKernel/IAuditor.h +++ b/GaudiKernel/include/GaudiKernel/IAuditor.h @@ -51,18 +51,14 @@ public: virtual void before( CustomEventTypeRef, const std::string& ) = 0; /// Audit the end of a standard "event". - virtual void after( StandardEventType, INamedInterface*, - const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0; + virtual void after( StandardEventType, INamedInterface*, const StatusCode& sc = StatusCode::SUCCESS ) = 0; /// Audit the end of a standard "event" for callers that do not implement INamedInterface. - virtual void after( StandardEventType, const std::string&, - const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0; + virtual void after( StandardEventType, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 0; /// Audit the end of a custom "event". - virtual void after( CustomEventTypeRef, INamedInterface*, - const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0; + virtual void after( CustomEventTypeRef, INamedInterface*, const StatusCode& sc = StatusCode::SUCCESS ) = 0; /// Audit the end of a custom "event" for callers that do not implement INamedInterface. - virtual void after( CustomEventTypeRef, const std::string&, - const StatusCode& sc = StatusCode( StatusCode::SUCCESS, true ) ) = 0; + virtual void after( CustomEventTypeRef, const std::string&, const StatusCode& sc = StatusCode::SUCCESS ) = 0; /// Tell if the auditor is enabled or not. virtual bool isEnabled() const = 0; diff --git a/GaudiKernel/include/GaudiKernel/PropertyHolder.h b/GaudiKernel/include/GaudiKernel/PropertyHolder.h index 240b7c3e83a788f982900c88d9c39eb81c167b35..4d8c447c433df370522b49f8db3cde9b4b475915 100644 --- a/GaudiKernel/include/GaudiKernel/PropertyHolder.h +++ b/GaudiKernel/include/GaudiKernel/PropertyHolder.h @@ -1,5 +1,5 @@ /***********************************************************************************\ -* (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations * +* (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations * * * * This software is distributed under the terms of the Apache version 2 licence, * * copied verbatim in the file "LICENSE". * @@ -178,8 +178,7 @@ public: try { Gaudi::Details::PropertyBase* p = property( n ); /// @fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty - return ( p && p->fromString( r ) ) ? StatusCode{StatusCode::SUCCESS, true} - : StatusCode{StatusCode::FAILURE, true}; + return ( p && p->fromString( r ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE; } catch ( const std::invalid_argument& err ) { throw GaudiException{"error setting property " + n, this->name(), StatusCode::FAILURE, err}; } diff --git a/GaudiKernel/include/GaudiKernel/SmartDataObjectPtr.h b/GaudiKernel/include/GaudiKernel/SmartDataObjectPtr.h index 187e5014b7fbe351ff9dd7ec6595e796f7d3ffed..08c4b9d47e7361fb09828b1c72141a4b58d2ea7c 100644 --- a/GaudiKernel/include/GaudiKernel/SmartDataObjectPtr.h +++ b/GaudiKernel/include/GaudiKernel/SmartDataObjectPtr.h @@ -171,7 +171,7 @@ protected: /// Pointer to the data registry containing the object mutable IRegistry* m_pRegistry = nullptr; /// Keep track of the last error - mutable StatusCode m_status = {StatusCode::SUCCESS, true}; + mutable StatusCode m_status = StatusCode::SUCCESS; /// Path to object std::string m_path; /// Data access function diff --git a/GaudiKernel/include/GaudiKernel/StatusCode.h b/GaudiKernel/include/GaudiKernel/StatusCode.h index 98269cd5e84ccb9a1b11d24e36fa01f968dd9431..0a1963ea54adca6e969aa056a874457fa6a5c109 100644 --- a/GaudiKernel/include/GaudiKernel/StatusCode.h +++ b/GaudiKernel/include/GaudiKernel/StatusCode.h @@ -133,11 +133,7 @@ public: /// Move constructor StatusCode( StatusCode && rhs ) noexcept = default; -/// Destructor. -#ifdef STATUSCODE_DESTRUCTOR_LINKAGE - STATUSCODE_DESTRUCTOR_LINKAGE -// Used in GaudiExamples.statuscodesvc.* tests -#endif + /// Destructor. ~StatusCode() = default; StatusCode& operator=( const StatusCode& rhs ) noexcept = default; diff --git a/GaudiKernel/include/GaudiKernel/StdArrayAsProperty.h b/GaudiKernel/include/GaudiKernel/StdArrayAsProperty.h index e1924106c8ec96af810579245c575a722f2edd50..caa5c206cf94692cefdec92514e98c644a9ec424 100644 --- a/GaudiKernel/include/GaudiKernel/StdArrayAsProperty.h +++ b/GaudiKernel/include/GaudiKernel/StdArrayAsProperty.h @@ -48,8 +48,8 @@ namespace Gaudi { StatusCode parse( std::array<TYPE, N>& result, const std::string& input ) { std::vector<TYPE> tmp; StatusCode sc = parse( tmp, input ); - if ( sc.isFailure() ) return sc; // RETURN - if ( N != tmp.size() ) return StatusCode( StatusCode::FAILURE, true ); + if ( sc.isFailure() ) return sc; + if ( N != tmp.size() ) return StatusCode::FAILURE; std::copy( tmp.begin(), tmp.end(), result.begin() ); return StatusCode::SUCCESS; } diff --git a/GaudiKernel/src/Lib/ConversionSvc.cpp b/GaudiKernel/src/Lib/ConversionSvc.cpp index afd110d82206951a4451ec093335329d7c71d9c3..d99ccd68a7bfeff4bb09716b53398aac7e406d11 100644 --- a/GaudiKernel/src/Lib/ConversionSvc.cpp +++ b/GaudiKernel/src/Lib/ConversionSvc.cpp @@ -48,7 +48,7 @@ StatusCode ConversionSvc::makeCall( int typ, bool ignore_add, bool ignore_obj, b cnv = converter( obj_class ); } - StatusCode status( StatusCode::FAILURE, true ); + StatusCode status{StatusCode::FAILURE}; if ( cnv ) { switch ( typ ) { case CREATE_OBJ: diff --git a/GaudiKernel/src/Lib/DataSvc.cpp b/GaudiKernel/src/Lib/DataSvc.cpp index 1e7865593768358f5aea804d0c32914c1e298dad..e5328353fc1c21f96e8d64c9274e150e180b3095 100644 --- a/GaudiKernel/src/Lib/DataSvc.cpp +++ b/GaudiKernel/src/Lib/DataSvc.cpp @@ -540,7 +540,7 @@ StatusCode DataSvc::retrieveEntry( RegEntry* parentObj, std::string_view path, R StatusCode DataSvc::i_retrieveEntry( RegEntry* parentObj, std::string_view path, RegEntry*& pEntry ) { // A.Valassi 16.08.2001 avoid core dump if store is empty - if ( !checkRoot() ) return StatusCode( Status::INVALID_ROOT, true ); + if ( !checkRoot() ) return Status::INVALID_ROOT; static constexpr auto empty = std::string_view{}; auto sep = find( path, SEPARATOR, 1 ); @@ -566,7 +566,7 @@ StatusCode DataSvc::i_retrieveEntry( RegEntry* parentObj, std::string_view path, sep = find( path, SEPARATOR, 1 ); } - StatusCode status = StatusCode( Status::INVALID_ROOT, true ); + StatusCode status{Status::INVALID_ROOT}; if ( sep != std::string_view::npos ) { // the string contains a separator (after pos 0) if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now status = loadObject( parentObj ); diff --git a/GaudiKernel/src/Lib/GaudiException.cpp b/GaudiKernel/src/Lib/GaudiException.cpp index fe2ba19a083346dc0c5c924c35ff3b926f39d3e6..5b2e5340bd9cc4478e53cd88bd0bd5892492c414 100644 --- a/GaudiKernel/src/Lib/GaudiException.cpp +++ b/GaudiKernel/src/Lib/GaudiException.cpp @@ -54,10 +54,7 @@ GaudiException::GaudiException( const GaudiException& Exception ) s_proc = true; } -GaudiException::~GaudiException() throw() { - m_code.setChecked(); - s_proc = false; -} +GaudiException::~GaudiException() throw() { s_proc = false; } GaudiException& GaudiException::operator=( const GaudiException& Exception ) { m_message = Exception.message(); diff --git a/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp b/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp index fee8b36f9e44e85603ce0181f912e08632bec354..9d935ca2193c1d44354b366af58fc7b242bc32ed 100644 --- a/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp +++ b/GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp @@ -167,7 +167,7 @@ StatusCode MinimalEventLoopMgr::start() { //-------------------------------------------------------------------------------------------- StatusCode MinimalEventLoopMgr::stop() { - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc{StatusCode::SUCCESS}; // Stop all the TopAlgs. In fact Algorithms are protected against getting // stopped twice. @@ -390,10 +390,10 @@ StatusCode MinimalEventLoopMgr::executeEvent( EventContext&& context ) { std::ostringstream ost; m_aess->dump( ost, context ); debug() << "Dumping AlgExecStateSvc status:\n" << ost.str() << endmsg; - return StatusCode( StatusCode::FAILURE, true ); + return StatusCode::FAILURE; } - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } //-------------------------------------------------------------------------------------------- // Implementation of IEventProcessor::stopRun() diff --git a/GaudiKernel/src/Lib/StateMachine.cpp b/GaudiKernel/src/Lib/StateMachine.cpp index 3a9996f8d69b7f94428cba0bf58dc7d14ca1ef62..d2f2a541ec6cb1117e93e5d8b5d854c6b6836d82 100644 --- a/GaudiKernel/src/Lib/StateMachine.cpp +++ b/GaudiKernel/src/Lib/StateMachine.cpp @@ -41,7 +41,7 @@ namespace Gaudi { } std::stringstream msg; msg << "Invalid transition '" << transition << "' from state '" << state << "'"; - throw GaudiException( msg.str(), "Gaudi::StateMachine::ChangeState", StatusCode( StatusCode::FAILURE, true ) ); + throw GaudiException( msg.str(), "Gaudi::StateMachine::ChangeState", StatusCode::FAILURE ); return OFFLINE; // never reached, but maked the compiler happy } } // namespace StateMachine diff --git a/GaudiKernel/src/Lib/TsDataSvc.cpp b/GaudiKernel/src/Lib/TsDataSvc.cpp index 022f3e517fb875ad0698e730cb069ec32f086bbe..5197bb17836b25ec52ad178cd476d1c5cac93f5a 100644 --- a/GaudiKernel/src/Lib/TsDataSvc.cpp +++ b/GaudiKernel/src/Lib/TsDataSvc.cpp @@ -544,7 +544,7 @@ StatusCode TsDataSvc::loadObject( IConversionSvc* pLoader, IRegistry* pRegistry /// Retrieve registry entry from store StatusCode TsDataSvc::retrieveEntry( RegEntry* parentObj, std::string_view path, RegEntry*& pEntry ) { auto sep = find( path, SEPARATOR, 1 ); - StatusCode status = StatusCode( Status::INVALID_ROOT, true ); + StatusCode status = Status::INVALID_ROOT; pEntry = nullptr; STD_LOCK_GUARD_MACRO // A.Valassi 16.08.2001 avoid core dump if store is empty diff --git a/GaudiKernel/src/Util/genconf.cpp b/GaudiKernel/src/Util/genconf.cpp index d26b19fe2921704432d6ae48f801fcde1ca338d6..88bc110451eccfbdf5b8d1df877443e2ea6c9be4 100644 --- a/GaudiKernel/src/Util/genconf.cpp +++ b/GaudiKernel/src/Util/genconf.cpp @@ -431,9 +431,6 @@ int main( int argc, char** argv ) int configGenerator::genConfig( const Strings_t& libs, const string& userModule ) //----------------------------------------------------------------------------- { - //--- Disable checking StatusCode ------------------------------------------- - StatusCode::disableChecking(); - const auto endLib = libs.end(); static const std::string gaudiSvc = "GaudiCoreSvc"; diff --git a/GaudiKernel/tests/src/test_StatusCode.cpp b/GaudiKernel/tests/src/test_StatusCode.cpp index b436ea66581958d4498a9c6f3cd58151ce102070..b30df517eaa6efb3239b86077d04c31a935fbc1d 100644 --- a/GaudiKernel/tests/src/test_StatusCode.cpp +++ b/GaudiKernel/tests/src/test_StatusCode.cpp @@ -227,124 +227,6 @@ BOOST_AUTO_TEST_CASE( short_circuiting ) { } } -BOOST_AUTO_TEST_CASE( checking ) { - { - StatusCode sc; - BOOST_CHECK( sc.checked() == false ); - sc.isSuccess(); - BOOST_CHECK( sc.checked() == true ); - } - { - StatusCode sc( StatusCode::SUCCESS ); - sc.ignore(); - BOOST_CHECK( sc.checked() == true ); - } - // Comparison checks - { - StatusCode sc( StatusCode::SUCCESS ); - if ( sc == StatusCode::SUCCESS ) {} - BOOST_CHECK( sc.checked() == true ); - } - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( StatusCode::FAILURE ); - BOOST_CHECK( sc2 < sc1 ); - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == true ); - } - // Cast to bool --> checked - { - StatusCode sc; - if ( sc ) {} - BOOST_CHECK( sc.checked() == true ); - } - // Copy constructor checks source - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( sc1 ); - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == false ); - } - // Assignment operator checks rhs - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2; - sc2 = sc1; - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == false ); - } - // Function return check - { - StatusCode sc = func(); - BOOST_CHECK( sc.checked() == false ); - BOOST_CHECK( func().checked() == false ); - } - // Logical AND checks both if first is SUCCESS - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( StatusCode::FAILURE ); - bool b = sc1 && sc2; - BOOST_CHECK( b == false ); - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == true ); - } - // Logical OR checks only first if SUCCESS - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( StatusCode::FAILURE ); - bool b = sc1 || sc2; - BOOST_CHECK( b == true ); - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == false ); - } - // Ternary AND checks both - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( StatusCode::FAILURE ); - StatusCode sc3 = sc1 & sc2; - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == true ); - BOOST_CHECK( sc3.checked() == false ); - } - // Ternary OR checks both - { - StatusCode sc1( StatusCode::SUCCESS ); - StatusCode sc2( StatusCode::FAILURE ); - StatusCode sc3 = sc1 | sc2; - BOOST_CHECK( sc1.checked() == true ); - BOOST_CHECK( sc2.checked() == true ); - BOOST_CHECK( sc3.checked() == false ); - } - // AND assignment checks rhs - { - StatusCode sc; - bool b = false; - b &= sc; - BOOST_CHECK( sc.checked() == true ); - } - // OR assignment checks rhs - { - StatusCode sc; - bool b = true; - b |= sc; - BOOST_CHECK( sc.checked() == true ); - } - // Ternary AND assignment checks rhs - { - StatusCode r, sc; - r &= sc; - BOOST_CHECK( sc.checked() == true ); - BOOST_CHECK( r.checked() == false ); - } - // Ternary OR assignment checks rhs - { - StatusCode r, sc; - r |= sc; - BOOST_CHECK( sc.checked() == true ); - BOOST_CHECK( r.checked() == false ); - } -} - BOOST_AUTO_TEST_CASE( user_values ) { { enum Status { ERR1 = 10, ERR2 = 12 }; diff --git a/GaudiMP/src/component/ReplayOutputStream.cpp b/GaudiMP/src/component/ReplayOutputStream.cpp index fee6a4e7b472278b2c598e42381e49ad3cb1d776..2fa7cf274ad9698d6d1589eead78178ebbf79f18 100644 --- a/GaudiMP/src/component/ReplayOutputStream.cpp +++ b/GaudiMP/src/component/ReplayOutputStream.cpp @@ -35,7 +35,7 @@ namespace { class OutStreamTransition { public: typedef ReplayOutputStream::OutStreamsMapType::value_type ItemType; - OutStreamTransition( MsgStream& msg ) : m_msg( msg ), m_code( StatusCode::SUCCESS, false ) {} + OutStreamTransition( MsgStream& msg ) : m_msg( msg ), m_code( StatusCode::SUCCESS ) {} void operator()( ItemType& item ); diff --git a/GaudiMonitor/src/HistorySvc.cpp b/GaudiMonitor/src/HistorySvc.cpp index 240cf7b275be0f247b30496036803e29a7a17131..937ba41cca8c637ea929e40d48d80f315087af6f 100644 --- a/GaudiMonitor/src/HistorySvc.cpp +++ b/GaudiMonitor/src/HistorySvc.cpp @@ -297,7 +297,7 @@ StatusCode HistorySvc::registerAlg( const Gaudi::Algorithm& alg ) { log.resetColor(); } - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -311,7 +311,7 @@ StatusCode HistorySvc::listProperties( const Gaudi::Algorithm& alg ) const { info() << alg.name() << " --> " << endl << *hist << endmsg; - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -339,7 +339,7 @@ AlgorithmHistory* HistorySvc::getAlgHistory( const Gaudi::Algorithm& alg ) const void HistorySvc::getAlgHistory( std::set<AlgorithmHistory*>& algs ) const { map_to_set( m_algmap, algs ); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -StatusCode HistorySvc::registerJob() { return StatusCode( StatusCode::SUCCESS, true ); } +StatusCode HistorySvc::registerJob() { return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ StatusCode HistorySvc::listProperties() const { @@ -374,7 +374,7 @@ StatusCode HistorySvc::listProperties() const { log << std::endl << *m_jobHistory << endmsg; - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -498,7 +498,7 @@ int HistorySvc::getDataHistory( const CLID& id, const std::string& key, const st StatusCode HistorySvc::registerSvc( const IService& svc ) { - if ( svc.name() == "HistoryStore" ) { return StatusCode( StatusCode::SUCCESS, true ); } + if ( svc.name() == "HistoryStore" ) { return StatusCode::SUCCESS; } JobHistory* job = getJobHistory(); const IService* psvc = &svc; @@ -518,7 +518,7 @@ StatusCode HistorySvc::registerSvc( const IService& svc ) { ( const_cast<IService*>( psvc ) )->addRef(); } - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -548,7 +548,7 @@ StatusCode HistorySvc::listProperties( const IService& svc ) const { info() << svc.name() << " --> " << endl << *hist << endmsg; - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index 53c50c489f26ebf9d4130652223a9f52152ef8b6..64edf37642f0740cf222f59afd405ddd3b15100a 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -1027,9 +1027,8 @@ lineSkipper = LineSkipper( r"INFO Disconnected from dataset", r"INFO Disconnected data IO:", r"IncidentSvc\s*(DEBUG (Adding|Removing)|VERBOSE Calling)", - # I want to ignore the header of the unchecked StatusCode report - r"^StatusCodeSvc.*listing all unchecked return codes:", - r"^StatusCodeSvc\s*INFO\s*$", + # Ignore StatusCodeSvc related messages + r".*StatusCodeSvc.*", r"Num\s*\|\s*Function\s*\|\s*Source Library", r"^[-+]*\s*$", # Hide the fake error message coming from POOL/ROOT (ROOT 5.21) @@ -1037,8 +1036,6 @@ lineSkipper = LineSkipper( # Hide unchecked StatusCodes from dictionaries r"^ +[0-9]+ \|.*ROOT", r"^ +[0-9]+ \|.*\|.*Dict", - # Hide success StatusCodeSvc message - r"StatusCodeSvc.*all StatusCode instances where checked", # Hide EventLoopMgr total timing report r"EventLoopMgr.*---> Loop Finished", r"HiveSlimEventLo.*---> Loop Finished", diff --git a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp index 1d03c72ab5eb4aed49d14ff33e0df7528e7253fb..948d4626b9d0f2a72133fb2107fc4f5308e07347 100644 --- a/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp +++ b/GaudiSvc/src/NTupleSvc/NTupleSvc.cpp @@ -1,5 +1,5 @@ /***********************************************************************************\ -* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations * +* (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations * * * * This software is distributed under the terms of the Apache version 2 licence, * * copied verbatim in the file "LICENSE". * @@ -67,7 +67,7 @@ NTupleSvc::NTupleSvc( const std::string& name, ISvcLocator* svc ) : base_class( StatusCode NTupleSvc::initialize() { StatusCode status = DataSvc::initialize(); if ( status.isSuccess() ) { - StatusCode iret( StatusCode::SUCCESS, true ); + StatusCode iret = StatusCode::SUCCESS; DataObject* root = new NTuple::Directory(); status = setRoot( m_rootName, root ); for ( auto& i : m_output ) { diff --git a/GaudiUtils/src/component/IODataManager.cpp b/GaudiUtils/src/component/IODataManager.cpp index 3e500b18c2c0ae5a71f79261eca60cc585304c31..11382c98893bbb74d91a77d3b1909dc2d8e1b633 100644 --- a/GaudiUtils/src/component/IODataManager.cpp +++ b/GaudiUtils/src/component/IODataManager.cpp @@ -231,7 +231,7 @@ StatusCode IODataManager::connectDataIO( int typ, IoType rw, CSTR dataset, CSTR MsgStream log( msgSvc(), name() ); std::string dsn = dataset; try { - StatusCode sc( StatusCode::SUCCESS, true ); + StatusCode sc = StatusCode::SUCCESS; if ( ::strncasecmp( dsn.c_str(), "FID:", 4 ) == 0 ) dsn = dataset.substr( 4 ), typ = FID; else if ( ::strncasecmp( dsn.c_str(), "LFN:", 4 ) == 0 ) diff --git a/RootCnv/src/RootDirectoryCnv.cpp b/RootCnv/src/RootDirectoryCnv.cpp index 65ba8f24d98759d78f068f0516c9b87eb07e0a5a..f71230b3548b575b176840e86757fe7f43df0b49 100644 --- a/RootCnv/src/RootDirectoryCnv.cpp +++ b/RootCnv/src/RootDirectoryCnv.cpp @@ -70,7 +70,7 @@ StatusCode RootDirectoryCnv::fillObjRefs( IOpaqueAddress* pAddr, DataObject* pOb StatusCode RootDirectoryCnv::updateObjRefs( IOpaqueAddress* pAddr, DataObject* pObject ) { typedef vector<RootNTupleDescriptor*> REFS; REFS refs; - StatusCode status = StatusCode( StatusCode::FAILURE, true ); + StatusCode status = StatusCode::FAILURE; if ( pAddr ) { IRegistry* pReg = pAddr->registry(); if ( pReg ) { diff --git a/RootCnv/src/RootTool.h b/RootCnv/src/RootTool.h index b38dee9a49c1b5e99f89b2455a841520202c5143..611dbad3cd74202d0181b008414d5c9ca11c073e 100644 --- a/RootCnv/src/RootTool.h +++ b/RootCnv/src/RootTool.h @@ -192,8 +192,8 @@ namespace Gaudi { } /// Read reference tables StatusCode readRefs() override { - TTree* t = (TTree*)c->file()->Get( "Sections" ); - StatusCode sc( StatusCode::SUCCESS, true ); + TTree* t = (TTree*)c->file()->Get( "Sections" ); + StatusCode sc = StatusCode::SUCCESS; StringVec tmp; if ( t && !( sc = readBranch( t, "Sections", tmp, &RootTool::addEntry ) ).isSuccess() ) return sc; diff --git a/RootHistCnv/src/PersSvc.cpp b/RootHistCnv/src/PersSvc.cpp index 03dbfbbb8f9ad209f8daa7403558e3c05378c563..3d4605fc4110254a3fe01374e236d5fd4a82d282 100644 --- a/RootHistCnv/src/PersSvc.cpp +++ b/RootHistCnv/src/PersSvc.cpp @@ -57,7 +57,7 @@ StatusCode RootHistCnv::PersSvc::initialize() } else { info() << "Writing ROOT histograms disabled." << endmsg; } - return StatusCode( StatusCode::SUCCESS, true ); + return StatusCode::SUCCESS; } //----------------------------------------------------------------------------- diff --git a/cmake/tests/testGaudiInstallation.cmake b/cmake/tests/testGaudiInstallation.cmake index 5b3c8a6449808c2ad8fb5d8d2402293bd4be9940..d6af88710a1a36cb761a0a5ad9bb595e1614142b 100644 --- a/cmake/tests/testGaudiInstallation.cmake +++ b/cmake/tests/testGaudiInstallation.cmake @@ -198,10 +198,6 @@ elseif(DEFINED TEST_GAUDI_INSTALL_FILES_EXIST) # check some files that should be message(FATAL_ERROR "Python modules not installed correctly," " ExtraModules.py not found in python/GaudiSvc/") endif() - if(NOT EXISTS ${GAUDI_INSTALL_DIR}/python/GaudiExamples/StatusCodeSvcTestConf.py) - message(FATAL_ERROR "Python modules not installed correctly," - " StatusCodeSvcTestConf.py not found in python/GaudiExamples/") - endif() if(NOT EXISTS ${GAUDI_INSTALL_DIR}/python/GaudiTesting/Run.py) message(FATAL_ERROR "Python modules not installed correctly," " Run.py not found in python/GaudiTesting/")