diff options
| author | Martin Hořeňovský | 2020-05-10 16:44:27 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-05-10 20:20:52 +0200 |
| commit | ed967fd7fcb0f1d995d11ebf1d7d4106d582d43c (patch) | |
| tree | 158f20386c33958c08290e8e37a79875b03307a6 /src/catch2/internal/catch_message_info.cpp | |
| parent | 7030d7740d4d576149d5afb31b2f7668d02f8bdc (diff) | |
| download | catch3-ed967fd7fcb0f1d995d11ebf1d7d4106d582d43c.tar.gz | |
Split MessageInfo into its own header
This is first step towards splitting apart reporter implementation
and `catch_string.hpp`.
Diffstat (limited to 'src/catch2/internal/catch_message_info.cpp')
| -rw-r--r-- | src/catch2/internal/catch_message_info.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/catch2/internal/catch_message_info.cpp b/src/catch2/internal/catch_message_info.cpp new file mode 100644 index 00000000..65d990ad --- /dev/null +++ b/src/catch2/internal/catch_message_info.cpp @@ -0,0 +1,26 @@ + +#include <catch2/internal/catch_message_info.hpp> + +namespace Catch { + + MessageInfo::MessageInfo( StringRef const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + bool MessageInfo::operator==( MessageInfo const& other ) const { + return sequence == other.sequence; + } + + bool MessageInfo::operator<( MessageInfo const& other ) const { + return sequence < other.sequence; + } + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + +} // end namespace Catch |