Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-09-08 18:20:49 +0200
committerMartin Hořeňovský2019-09-08 18:20:49 +0200
commit293012a002ef5351adbfcc0cbf7cdfdc93aed115 (patch)
treec178c44ce7b0dd94564ad3887c52b1e07ad7e328 /include
parente2b3443fe7211f265c95f878d06d8fd4abf38f27 (diff)
downloadcatch3-293012a002ef5351adbfcc0cbf7cdfdc93aed115.tar.gz
Inline SourceLineInfo::empty definition
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_common.cpp3
-rw-r--r--include/internal/catch_common.h2
-rw-r--r--include/reporters/catch_reporter_console.cpp9
-rw-r--r--include/reporters/catch_reporter_teamcity.hpp3
4 files changed, 6 insertions, 11 deletions
diff --git a/include/internal/catch_common.cpp b/include/internal/catch_common.cpp
index b2fca4c4..790acbe5 100644
--- a/include/internal/catch_common.cpp
+++ b/include/internal/catch_common.cpp
@@ -15,9 +15,6 @@
namespace Catch {
- bool SourceLineInfo::empty() const noexcept {
- return file[0] == '\0';
- }
bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept {
return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
}
diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
index e4745622..5e097fbf 100644
--- a/include/internal/catch_common.h
+++ b/include/internal/catch_common.h
@@ -57,7 +57,7 @@ namespace Catch {
SourceLineInfo( SourceLineInfo&& ) noexcept = default;
SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
- bool empty() const noexcept;
+ bool empty() const noexcept { return file[0] == '\0'; }
bool operator == ( SourceLineInfo const& other ) const noexcept;
bool operator < ( SourceLineInfo const& other ) const noexcept;
diff --git a/include/reporters/catch_reporter_console.cpp b/include/reporters/catch_reporter_console.cpp
index e38e34cf..55b0c9ed 100644
--- a/include/reporters/catch_reporter_console.cpp
+++ b/include/reporters/catch_reporter_console.cpp
@@ -530,11 +530,10 @@ void ConsoleReporter::printTestCaseAndSectionHeader() {
SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
- if (!lineInfo.empty()) {
- stream << getLineOfChars<'-'>() << '\n';
- Colour colourGuard(Colour::FileName);
- stream << lineInfo << '\n';
- }
+
+ stream << getLineOfChars<'-'>() << '\n';
+ Colour colourGuard(Colour::FileName);
+ stream << lineInfo << '\n';
stream << getLineOfChars<'.'>() << '\n' << std::endl;
}
diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp
index eca2885c..47b7e4aa 100644
--- a/include/reporters/catch_reporter_teamcity.hpp
+++ b/include/reporters/catch_reporter_teamcity.hpp
@@ -183,8 +183,7 @@ namespace Catch {
SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
- if( !lineInfo.empty() )
- os << lineInfo << "\n";
+ os << lineInfo << "\n";
os << getLineOfChars<'.'>() << "\n\n";
}