mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Replace most naked throws with macros from catch_enforce.h
This is a first step towards support a no-exceptions mode
This commit is contained in:
		| @@ -8,6 +8,7 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED | ||||
|  | ||||
| #include "../internal/catch_enforce.h" | ||||
| #include "../internal/catch_interfaces_reporter.h" | ||||
|  | ||||
| #include <algorithm> | ||||
| @@ -33,7 +34,7 @@ namespace Catch { | ||||
|         { | ||||
|             m_reporterPrefs.shouldRedirectStdOut = false; | ||||
|             if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) ) | ||||
|                 throw std::domain_error( "Verbosity level not supported by this reporter" ); | ||||
|                 CATCH_ERROR( "Verbosity level not supported by this reporter" ); | ||||
|         } | ||||
|  | ||||
|         ReporterPreferences getPreferences() const override { | ||||
| @@ -148,7 +149,7 @@ namespace Catch { | ||||
|         { | ||||
|             m_reporterPrefs.shouldRedirectStdOut = false; | ||||
|             if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) ) | ||||
|                 throw std::domain_error( "Verbosity level not supported by this reporter" ); | ||||
|                 CATCH_ERROR( "Verbosity level not supported by this reporter" ); | ||||
|         } | ||||
|         ~CumulativeReporterBase() override = default; | ||||
|  | ||||
|   | ||||
| @@ -97,12 +97,12 @@ namespace Catch { | ||||
|                     case ResultWas::Ok: | ||||
|                     case ResultWas::Info: | ||||
|                     case ResultWas::Warning: | ||||
|                         throw std::domain_error( "Internal error in TeamCity reporter" ); | ||||
|                         CATCH_ERROR( "Internal error in TeamCity reporter" ); | ||||
|                     // These cases are here to prevent compiler warnings | ||||
|                     case ResultWas::Unknown: | ||||
|                     case ResultWas::FailureBit: | ||||
|                     case ResultWas::Exception: | ||||
|                         throw std::domain_error( "Not implemented" ); | ||||
|                         CATCH_ERROR( "Not implemented" ); | ||||
|                 } | ||||
|                 if( assertionStats.infoMessages.size() == 1 ) | ||||
|                     msg << " with message:"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský