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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-03-11 16:14:06 +0100
committerMartin Hořeňovský2023-03-11 16:14:06 +0100
commit13fae1e2ff9939d03bb8a5a6f3341538d4127dc5 (patch)
tree776477bf31e1a1b5266c5c5f05fd9e77e0c62b6a /src
parent3220ae6d4aff68edb27fa6b34d2e4f909a770e19 (diff)
downloadcatch3-13fae1e2ff9939d03bb8a5a6f3341538d4127dc5.tar.gz
Move exception's translation into AssertionResultData message
Diffstat (limited to 'src')
-rw-r--r--src/catch2/interfaces/catch_interfaces_capture.hpp2
-rw-r--r--src/catch2/internal/catch_run_context.cpp4
-rw-r--r--src/catch2/internal/catch_run_context.hpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_capture.hpp b/src/catch2/interfaces/catch_interfaces_capture.hpp
index 2a469c12..c3c80d75 100644
--- a/src/catch2/interfaces/catch_interfaces_capture.hpp
+++ b/src/catch2/interfaces/catch_interfaces_capture.hpp
@@ -84,7 +84,7 @@ namespace Catch {
AssertionReaction& reaction ) = 0;
virtual void handleUnexpectedInflightException
( AssertionInfo const& info,
- std::string const& message,
+ std::string&& message,
AssertionReaction& reaction ) = 0;
virtual void handleIncomplete
( AssertionInfo const& info ) = 0;
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index 08086b28..e9cb025e 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -619,13 +619,13 @@ namespace Catch {
void RunContext::handleUnexpectedInflightException(
AssertionInfo const& info,
- std::string const& message,
+ std::string&& message,
AssertionReaction& reaction
) {
m_lastAssertionInfo = info;
AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = message;
+ data.message = CATCH_MOVE(message);
AssertionResult assertionResult{ info, CATCH_MOVE(data) };
assertionEnded( assertionResult );
populateReaction( reaction );
diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp
index 3928180e..cf166f63 100644
--- a/src/catch2/internal/catch_run_context.hpp
+++ b/src/catch2/internal/catch_run_context.hpp
@@ -59,7 +59,7 @@ namespace Catch {
AssertionReaction& reaction ) override;
void handleUnexpectedInflightException
( AssertionInfo const& info,
- std::string const& message,
+ std::string&& message,
AssertionReaction& reaction ) override;
void handleIncomplete
( AssertionInfo const& info ) override;