diff options
| author | Phil Nash | 2017-07-13 08:25:47 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-07-13 08:25:47 +0100 |
| commit | e01ed48a70925a6b18f70882f0065a42a560782b (patch) | |
| tree | 4db61e3c814a78b15346dac42054f2ff3e86df89 /include/internal/catch_common.cpp | |
| parent | 989222eceb34f749cd547d4d419ec2f7ac948a70 (diff) | |
| download | catch3-e01ed48a70925a6b18f70882f0065a42a560782b.tar.gz | |
Made everything used in test case registration noexcept
- this prevents warnings about startup-time exceptions
Diffstat (limited to 'include/internal/catch_common.cpp')
| -rw-r--r-- | include/internal/catch_common.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/internal/catch_common.cpp b/include/internal/catch_common.cpp index 6cd1b46d..a35ef93a 100644 --- a/include/internal/catch_common.cpp +++ b/include/internal/catch_common.cpp @@ -75,18 +75,18 @@ namespace Catch { return os; } - SourceLineInfo::SourceLineInfo() : file(""), line( 0 ){} - SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) + SourceLineInfo::SourceLineInfo() noexcept : file(""), line( 0 ){} + SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) noexcept : file( _file ), line( _line ) {} - bool SourceLineInfo::empty() const { + bool SourceLineInfo::empty() const noexcept { return file[0] == '\0'; } - bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { + bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept { return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0); } - bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { + bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const noexcept { return line < other.line || ( line == other.line && (std::strcmp(file, other.file) < 0)); } |