mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-06 21:45:40 +02:00
Refactor SectionInfo constructors
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* 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 )
|
||||
: name( _name ),
|
||||
lineInfo( _lineInfo )
|
||||
{}
|
||||
|
||||
} // end namespace Catch
|
@@ -17,17 +17,14 @@
|
||||
namespace Catch {
|
||||
|
||||
struct SectionInfo {
|
||||
SectionInfo
|
||||
( SourceLineInfo const& _lineInfo,
|
||||
std::string const& _name );
|
||||
|
||||
// The last argument is ignored, so that people can write
|
||||
// SECTION("ShortName", "Proper description that is long") and
|
||||
// still use the `-c` flag comfortably.
|
||||
SectionInfo
|
||||
( SourceLineInfo const& _lineInfo,
|
||||
std::string const& _name,
|
||||
const char* const ) : SectionInfo( _lineInfo, _name ) {}
|
||||
SectionInfo( SourceLineInfo const& _lineInfo, std::string _name,
|
||||
const char* const = nullptr ):
|
||||
name(std::move(_name)),
|
||||
lineInfo(_lineInfo)
|
||||
{}
|
||||
|
||||
std::string name;
|
||||
SourceLineInfo lineInfo;
|
||||
|
Reference in New Issue
Block a user