From 79c1bf93019ef3d8dc9d2bd905836f470e75a20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 11 Nov 2020 21:25:16 +0100 Subject: [PATCH] Use plain pointer to point to deepest section in CumulativeReporterBase Part of #2089 --- src/catch2/reporters/catch_reporter_cumulative_base.cpp | 5 +++-- src/catch2/reporters/catch_reporter_cumulative_base.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp index dcb57fc2..b4824148 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -58,8 +58,9 @@ namespace Catch { node = *it; } } - m_sectionStack.push_back( node ); - m_deepestSection = std::move( node ); + + m_deepestSection = node.get(); + m_sectionStack.push_back( std::move(node) ); } bool CumulativeReporterBase::assertionEnded( diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp index 8897523e..dc50a98a 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -81,7 +81,7 @@ namespace Catch { std::vector> m_testRuns; std::shared_ptr m_rootSection; - std::shared_ptr m_deepestSection; + SectionNode* m_deepestSection = nullptr; std::vector> m_sectionStack; };