From 446bad752f7b5c11aa4d0123ee48634ff8314bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 27 Jul 2017 12:24:52 +0200 Subject: [PATCH] Move std::exception_ptr out of interfaces --- include/internal/catch_interfaces_registry_hub.h | 2 +- include/internal/catch_registry_hub.cpp | 4 ++-- include/internal/catch_tag_alias_autoregistrar.cpp | 2 +- include/internal/catch_test_registry.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/internal/catch_interfaces_registry_hub.h b/include/internal/catch_interfaces_registry_hub.h index f71178be..1afbbec7 100644 --- a/include/internal/catch_interfaces_registry_hub.h +++ b/include/internal/catch_interfaces_registry_hub.h @@ -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(); diff --git a/include/internal/catch_registry_hub.cpp b/include/internal/catch_registry_hub.cpp index 01208e77..454b5e06 100644 --- a/include/internal/catch_registry_hub.cpp +++ b/include/internal/catch_registry_hub.cpp @@ -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: diff --git a/include/internal/catch_tag_alias_autoregistrar.cpp b/include/internal/catch_tag_alias_autoregistrar.cpp index a2f01cba..35ed059f 100644 --- a/include/internal/catch_tag_alias_autoregistrar.cpp +++ b/include/internal/catch_tag_alias_autoregistrar.cpp @@ -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(); } } diff --git a/include/internal/catch_test_registry.cpp b/include/internal/catch_test_registry.cpp index 28517628..2862879c 100644 --- a/include/internal/catch_test_registry.cpp +++ b/include/internal/catch_test_registry.cpp @@ -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(); } } }