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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-11-11 20:59:28 +0100
committerMartin Hořeňovský2020-11-14 16:16:28 +0100
commit4f14922aa38f88ad5135c169cdf1b723cdfd26ea (patch)
tree51afcdc8156b893a24d3061bc0f90e7df63acfcb /src/catch2
parent0fa133a0c5e065065ef96ac2b6c0284cf5da265d (diff)
downloadcatch3-4f14922aa38f88ad5135c169cdf1b723cdfd26ea.tar.gz
Don't use shared_ptr to store test run info in CumulativeReporterBase
Part of #2089
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.cpp4
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.hpp3
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 dabf1a4e..dcb57fc2 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp
@@ -105,9 +105,9 @@ namespace Catch {
}
void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) {
- auto node = std::make_shared<TestRunNode>( testRunStats );
+ auto node = Detail::make_unique<TestRunNode>( testRunStats );
node->children.swap( m_testGroups );
- m_testRuns.push_back( node );
+ m_testRuns.push_back( std::move(node) );
testRunEndedCumulative();
}
diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
index 2f5fa5fb..8897523e 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
@@ -9,6 +9,7 @@
#define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
+#include <catch2/internal/catch_unique_ptr.hpp>
#include <iosfwd>
#include <memory>
@@ -77,7 +78,7 @@ namespace Catch {
std::vector<std::shared_ptr<TestCaseNode>> m_testCases;
std::vector<std::shared_ptr<TestGroupNode>> m_testGroups;
- std::vector<std::shared_ptr<TestRunNode>> m_testRuns;
+ std::vector<Detail::unique_ptr<TestRunNode>> m_testRuns;
std::shared_ptr<SectionNode> m_rootSection;
std::shared_ptr<SectionNode> m_deepestSection;