Removed default ctors for AssertionInfo, AssertionResult and SourceLineInfo

This commit is contained in:
Phil Nash 2017-08-08 01:02:24 +01:00
parent e658bacb04
commit 5e60050299
9 changed files with 11 additions and 15 deletions

View File

@ -49,8 +49,6 @@ namespace Catch {
return reconstructedExpression;
}
AssertionResult::AssertionResult() {}
AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
: m_info( info ),
m_resultData( data )

View File

@ -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();

View File

@ -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 )

View File

@ -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;

View File

@ -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";

View File

@ -25,7 +25,6 @@ namespace Catch {
private:
std::string m_what;
SourceLineInfo m_lineInfo;
};
} // end namespace Catch

View File

@ -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() {

View File

@ -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;

View File

@ -37,7 +37,7 @@ using namespace Catch;
//}
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" ) {