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