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

Do not blindly access empty StringRefs

Commit
e2b3443fe7211f265c95f878d06d8fd4abf38f27
Author
Martin Hořeňovský ·
Parents
7b865daccc7b

Files · Download .tar.gz

Changes

 include/internal/catch_assertionresult.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/internal/catch_assertionresult.cpp b/include/internal/catch_assertionresult.cpp
index 5da1cfdf..a116bffa 100644
--- a/include/internal/catch_assertionresult.cpp
+++ b/include/internal/catch_assertionresult.cpp
@@ -61,7 +61,7 @@ namespace Catch {
 
     std::string AssertionResult::getExpressionInMacro() const {
         std::string expr;
-        if( m_info.macroName[0] == 0 )
+        if( m_info.macroName.empty() )
             expr = static_cast<std::string>(m_info.capturedExpression);
         else {
             expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );