mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Removed default ctors for AssertionInfo, AssertionResult and SourceLineInfo
This commit is contained in:
		| @@ -49,8 +49,6 @@ namespace Catch { | ||||
|         return reconstructedExpression; | ||||
|     } | ||||
|  | ||||
|     AssertionResult::AssertionResult() {} | ||||
|  | ||||
|     AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) | ||||
|     :   m_info( info ), | ||||
|         m_resultData( data ) | ||||
|   | ||||
| @@ -39,7 +39,7 @@ namespace Catch { | ||||
|  | ||||
|     struct AssertionInfo | ||||
|     { | ||||
|         AssertionInfo() = default; | ||||
|         AssertionInfo() = delete; | ||||
|         AssertionInfo(  char const * _macroName, | ||||
|                         SourceLineInfo const& _lineInfo, | ||||
|                         char const * _capturedExpression, | ||||
| @@ -66,7 +66,6 @@ namespace Catch { | ||||
|  | ||||
|     class AssertionResult { | ||||
|     public: | ||||
|         AssertionResult(); | ||||
|         AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); | ||||
|         ~AssertionResult(); | ||||
|  | ||||
|   | ||||
| @@ -15,7 +15,6 @@ | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     SourceLineInfo::SourceLineInfo() noexcept : file(""), line( 0 ){} | ||||
|     SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) noexcept | ||||
|     :   file( _file ), | ||||
|         line( _line ) | ||||
|   | ||||
| @@ -47,10 +47,10 @@ namespace Catch { | ||||
|  | ||||
|     struct SourceLineInfo { | ||||
|  | ||||
|         SourceLineInfo() noexcept; | ||||
|         SourceLineInfo() = delete; | ||||
|         SourceLineInfo( char const* _file, std::size_t _line ) noexcept; | ||||
|  | ||||
|         SourceLineInfo(SourceLineInfo const& other)          = default; | ||||
|         SourceLineInfo( SourceLineInfo const& other )        = default; | ||||
|         SourceLineInfo( SourceLineInfo && )                  = default; | ||||
|         SourceLineInfo& operator = ( SourceLineInfo const& ) = default; | ||||
|         SourceLineInfo& operator = ( SourceLineInfo && )     = default; | ||||
|   | ||||
| @@ -11,8 +11,7 @@ | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) | ||||
|     :   m_lineInfo( lineInfo ) { | ||||
|     NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) { | ||||
|         std::ostringstream oss; | ||||
|         oss << lineInfo << ": function "; | ||||
|         oss << "not implemented"; | ||||
|   | ||||
| @@ -25,7 +25,6 @@ namespace Catch { | ||||
|  | ||||
|     private: | ||||
|         std::string m_what; | ||||
|         SourceLineInfo m_lineInfo; | ||||
|     }; | ||||
|  | ||||
| } // end namespace Catch | ||||
|   | ||||
| @@ -19,10 +19,12 @@ namespace Catch { | ||||
|     } | ||||
|  | ||||
|     RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter) | ||||
|         : m_runInfo(_config->name()), | ||||
|     :   m_runInfo(_config->name()), | ||||
|         m_context(getCurrentMutableContext()), | ||||
|         m_config(_config), | ||||
|         m_reporter(std::move(reporter)) { | ||||
|         m_reporter(std::move(reporter)), | ||||
|         m_lastAssertionInfo( "", SourceLineInfo("",0), "", ResultDisposition::Normal ) | ||||
|     { | ||||
|         m_context.setRunner(this); | ||||
|         m_context.setConfig(m_config); | ||||
|         m_context.setResultCapture(this); | ||||
| @@ -180,7 +182,7 @@ namespace Catch { | ||||
|     } | ||||
|  | ||||
|     const AssertionResult * RunContext::getLastResult() const { | ||||
|         return &m_lastResult; | ||||
|         return &(*m_lastResult); | ||||
|     } | ||||
|  | ||||
|     void RunContext::exceptionEarlyReported() { | ||||
|   | ||||
| @@ -111,7 +111,7 @@ namespace Catch { | ||||
|         IMutableContext& m_context; | ||||
|         TestCase const* m_activeTestCase = nullptr; | ||||
|         ITracker* m_testCaseTracker; | ||||
|         AssertionResult m_lastResult; | ||||
|         Option<AssertionResult> m_lastResult; | ||||
|  | ||||
|         IConfigPtr m_config; | ||||
|         Totals m_totals; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash