diff options
| author | Martin Hořeňovský | 2020-11-11 21:25:16 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-11-14 16:17:27 +0100 |
| commit | 79c1bf93019ef3d8dc9d2bd905836f470e75a20c (patch) | |
| tree | f29d7971e747b0583b6a8683d061e1e534461973 /src/catch2 | |
| parent | 4f14922aa38f88ad5135c169cdf1b723cdfd26ea (diff) | |
| download | catch3-79c1bf93019ef3d8dc9d2bd905836f470e75a20c.tar.gz | |
Use plain pointer to point to deepest section in CumulativeReporterBase
Part of #2089
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_cumulative_base.cpp | 5 | ||||
| -rw-r--r-- | 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<Detail::unique_ptr<TestRunNode>> m_testRuns; std::shared_ptr<SectionNode> m_rootSection; - std::shared_ptr<SectionNode> m_deepestSection; + SectionNode* m_deepestSection = nullptr; std::vector<std::shared_ptr<SectionNode>> m_sectionStack; }; |