mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-23 04:55:40 +02:00
Section no longer relies on copy-elision for correctness
- should address #293 - *may* address #271
This commit is contained in:
@@ -15,10 +15,17 @@
|
||||
|
||||
namespace Catch {
|
||||
|
||||
Section::Section( SourceLineInfo const& lineInfo,
|
||||
std::string const& name,
|
||||
std::string const& description )
|
||||
: m_info( name, description, lineInfo ),
|
||||
SectionInfo::SectionInfo
|
||||
( SourceLineInfo const& _lineInfo,
|
||||
std::string const& _name,
|
||||
std::string const& _description )
|
||||
: name( _name ),
|
||||
description( _description ),
|
||||
lineInfo( _lineInfo )
|
||||
{}
|
||||
|
||||
Section::Section( SectionInfo const& info )
|
||||
: m_info( info ),
|
||||
m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
|
||||
{
|
||||
m_timer.start();
|
||||
@@ -30,7 +37,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
// This indicates whether the section should be executed or not
|
||||
Section::operator bool() {
|
||||
Section::operator bool() const {
|
||||
return m_sectionIncluded;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user