mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -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" ) {
|
||||
|
Loading…
Reference in New Issue
Block a user