Move Section(End)Info bodies to proper .cpp file

This commit is contained in:
Martin Hořeňovský 2017-08-01 17:51:32 +02:00
parent 0a3f899d6a
commit d4e796c138
4 changed files with 27 additions and 12 deletions

View File

@ -217,6 +217,7 @@ set(IMPL_SOURCES
${HEADER_DIR}/internal/catch_result_type.cpp ${HEADER_DIR}/internal/catch_result_type.cpp
${HEADER_DIR}/internal/catch_run_context.cpp ${HEADER_DIR}/internal/catch_run_context.cpp
${HEADER_DIR}/internal/catch_section.cpp ${HEADER_DIR}/internal/catch_section.cpp
${HEADER_DIR}/internal/catch_section_info.cpp
${HEADER_DIR}/internal/catch_startup_exception_registry.cpp ${HEADER_DIR}/internal/catch_startup_exception_registry.cpp
${HEADER_DIR}/internal/catch_string.cpp ${HEADER_DIR}/internal/catch_string.cpp
${HEADER_DIR}/internal/catch_stringbuilder.cpp ${HEADER_DIR}/internal/catch_stringbuilder.cpp

View File

@ -12,15 +12,6 @@
namespace Catch { namespace Catch {
SectionInfo::SectionInfo
( SourceLineInfo const& _lineInfo,
std::string const& _name,
std::string const& _description )
: name( _name ),
description( _description ),
lineInfo( _lineInfo )
{}
Section::Section( SectionInfo const& info ) Section::Section( SectionInfo const& info )
: m_info( info ), : m_info( info ),
m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )

View File

@ -0,0 +1,25 @@
/*
* Created by Martin on 01/08/2017.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#include "catch_section_info.h"
namespace Catch {
SectionInfo::SectionInfo
( SourceLineInfo const& _lineInfo,
std::string const& _name,
std::string const& _description )
: name( _name ),
description( _description ),
lineInfo( _lineInfo )
{}
SectionEndInfo::SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds )
: sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
{}
} // end namespace Catch

View File

@ -27,9 +27,7 @@ namespace Catch {
}; };
struct SectionEndInfo { struct SectionEndInfo {
SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds ) SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds );
: sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
{}
SectionInfo sectionInfo; SectionInfo sectionInfo;
Counts prevAssertions; Counts prevAssertions;