Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

AssertionResult::getMessage returns StringRef to internal string

Commit
cf5ccaa9dfe98534955bedb0c98ee51c6ea763f8
Author
Martin Hořeňovský ·
Parents
b3a84c798380

Files · Download .tar.gz

Changes

 src/catch2/catch_assertion_result.cpp | 2 +-
 src/catch2/catch_assertion_result.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/catch2/catch_assertion_result.cpp b/src/catch2/catch_assertion_result.cpp
index 4e160915..04e00d26 100644
--- a/src/catch2/catch_assertion_result.cpp
+++ b/src/catch2/catch_assertion_result.cpp
@@ -91,7 +91,7 @@ namespace Catch {
                 : expr;
     }
 
-    std::string AssertionResult::getMessage() const {
+    StringRef AssertionResult::getMessage() const {
         return m_resultData.message;
     }
     SourceLineInfo AssertionResult::getSourceInfo() const {
diff --git a/src/catch2/catch_assertion_result.hpp b/src/catch2/catch_assertion_result.hpp
index 0afb0e02..3008664c 100644
--- a/src/catch2/catch_assertion_result.hpp
+++ b/src/catch2/catch_assertion_result.hpp
@@ -46,7 +46,7 @@ namespace Catch {
         std::string getExpressionInMacro() const;
         bool hasExpandedExpression() const;
         std::string getExpandedExpression() const;
-        std::string getMessage() const;
+        StringRef getMessage() const;
         SourceLineInfo getSourceInfo() const;
         StringRef getTestMacroName() const;