mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-02 18:07:59 +00:00
Stop recounting constant string's length on each passed assertion
This commit is contained in:
parent
e484236825
commit
d09fe4459d
1 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,8 @@
|
|||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
static auto const& defaultExpression = "{Unknown expression after the reported line}";
|
||||
|
||||
namespace Catch {
|
||||
|
||||
StreamRedirect::StreamRedirect(std::ostream& stream, std::string& targetString)
|
||||
|
@ -253,8 +255,8 @@ namespace Catch {
|
|||
|
||||
void RunContext::assertionPassed() {
|
||||
++m_totals.assertions.passed;
|
||||
m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}";
|
||||
m_lastAssertionInfo.macroName = "";
|
||||
m_lastAssertionInfo.capturedExpression = StringRef(defaultExpression, sizeof(defaultExpression) - 1);
|
||||
m_lastAssertionInfo.macroName = StringRef("", 0);
|
||||
}
|
||||
|
||||
void RunContext::assertionRun() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue