Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-11-11 21:25:16 +0100
committerMartin Hořeňovský2020-11-14 16:17:27 +0100
commit79c1bf93019ef3d8dc9d2bd905836f470e75a20c (patch)
treef29d7971e747b0583b6a8683d061e1e534461973 /src
parent4f14922aa38f88ad5135c169cdf1b723cdfd26ea (diff)
downloadcatch3-79c1bf93019ef3d8dc9d2bd905836f470e75a20c.tar.gz
Use plain pointer to point to deepest section in CumulativeReporterBase
Part of #2089
Diffstat (limited to 'src')
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.cpp5
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.hpp2
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;
};