Move std::exception_ptr out of interfaces

This commit is contained in:
Martin Hořeňovský 2017-07-27 12:24:52 +02:00
parent 307eeefa8f
commit 446bad752f
4 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@ namespace Catch {
virtual void registerTest( TestCase const& testInfo ) = 0;
virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
virtual void registerStartupException( std::exception_ptr const& exception ) noexcept = 0;
virtual void registerStartupException() noexcept = 0;
};
IRegistryHub& getRegistryHub();

View File

@ -56,8 +56,8 @@ namespace Catch {
void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
m_tagAliasRegistry.add( alias, tag, lineInfo );
}
void registerStartupException( std::exception_ptr const& exception ) noexcept override {
m_exceptionRegistry.add(exception);
void registerStartupException() noexcept override {
m_exceptionRegistry.add(std::current_exception());
}
private:

View File

@ -8,7 +8,7 @@ namespace Catch {
getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
} catch (...) {
// Do not throw when constructing global objects, instead register the exception to be processed later
getMutableRegistryHub().registerStartupException(std::current_exception());
getMutableRegistryHub().registerStartupException();
}
}

View File

@ -29,7 +29,7 @@ namespace Catch {
lineInfo));
} catch (...) {
// Do not throw when constructing global objects, instead register the exception to be processed later
getMutableRegistryHub().registerStartupException( std::current_exception() );
getMutableRegistryHub().registerStartupException();
}
}
}