mirror of
https://github.com/catchorg/Catch2.git
synced 2025-07-21 08:05:31 +02:00
Store only lineinfo if m_lastAssertionInfo is going to be reset
`RunContext::resetAssertionInfo` overwrites everything in `m_lastAssertionInfo` except for the lineInfo, so if the reset is called at the end of a copying function, we can save work by copying only the lineInfo.
This commit is contained in:
parent
895b8af6bd
commit
efcb76874e
@ -331,7 +331,7 @@ namespace Catch {
|
|||||||
m_activeSections.push_back(§ionTracker);
|
m_activeSections.push_back(§ionTracker);
|
||||||
|
|
||||||
SectionInfo sectionInfo( sectionLineInfo, static_cast<std::string>(sectionName) );
|
SectionInfo sectionInfo( sectionLineInfo, static_cast<std::string>(sectionName) );
|
||||||
m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
|
m_lastAssertionInfo.lineInfo = sectionLineInfo;
|
||||||
|
|
||||||
{
|
{
|
||||||
auto _ = scopedDeactivate( *m_outputRedirect );
|
auto _ = scopedDeactivate( *m_outputRedirect );
|
||||||
@ -638,11 +638,11 @@ namespace Catch {
|
|||||||
std::string&& message,
|
std::string&& message,
|
||||||
AssertionReaction& reaction
|
AssertionReaction& reaction
|
||||||
) {
|
) {
|
||||||
m_lastAssertionInfo = info;
|
m_lastAssertionInfo.lineInfo = info.lineInfo;
|
||||||
|
|
||||||
AssertionResultData data( resultType, LazyExpression( false ) );
|
AssertionResultData data( resultType, LazyExpression( false ) );
|
||||||
data.message = CATCH_MOVE( message );
|
data.message = CATCH_MOVE( message );
|
||||||
AssertionResult assertionResult{ m_lastAssertionInfo,
|
AssertionResult assertionResult{ info,
|
||||||
CATCH_MOVE( data ) };
|
CATCH_MOVE( data ) };
|
||||||
|
|
||||||
const auto isOk = assertionResult.isOk();
|
const auto isOk = assertionResult.isOk();
|
||||||
@ -669,7 +669,7 @@ namespace Catch {
|
|||||||
std::string&& message,
|
std::string&& message,
|
||||||
AssertionReaction& reaction
|
AssertionReaction& reaction
|
||||||
) {
|
) {
|
||||||
m_lastAssertionInfo = info;
|
m_lastAssertionInfo.lineInfo = info.lineInfo;
|
||||||
|
|
||||||
AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
|
AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
|
||||||
data.message = CATCH_MOVE(message);
|
data.message = CATCH_MOVE(message);
|
||||||
@ -690,7 +690,7 @@ namespace Catch {
|
|||||||
AssertionInfo const& info
|
AssertionInfo const& info
|
||||||
) {
|
) {
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
m_lastAssertionInfo = info;
|
m_lastAssertionInfo.lineInfo = info.lineInfo;
|
||||||
|
|
||||||
AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
|
AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
|
||||||
data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"s;
|
data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"s;
|
||||||
@ -703,7 +703,7 @@ namespace Catch {
|
|||||||
ResultWas::OfType resultType,
|
ResultWas::OfType resultType,
|
||||||
AssertionReaction &reaction
|
AssertionReaction &reaction
|
||||||
) {
|
) {
|
||||||
m_lastAssertionInfo = info;
|
m_lastAssertionInfo.lineInfo = info.lineInfo;
|
||||||
|
|
||||||
AssertionResultData data( resultType, LazyExpression( false ) );
|
AssertionResultData data( resultType, LazyExpression( false ) );
|
||||||
AssertionResult assertionResult{ info, CATCH_MOVE( data ) };
|
AssertionResult assertionResult{ info, CATCH_MOVE( data ) };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user