1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-01-16 07:08:01 +00:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Martin Hořeňovský
166c520598
Remove another unused member variable from CumulativeReporterBase 2020-11-14 16:17:48 +01:00
Martin Hořeňovský
a29deeb129
Remove unused member in StreamingReporterBase
Part of #2089
2020-11-14 16:17:39 +01:00
Martin Hořeňovský
1cef51b69b
Default StreamingReporterBase::Node destructor 2020-11-14 16:17:35 +01:00
Martin Hořeňovský
79c1bf9301
Use plain pointer to point to deepest section in CumulativeReporterBase
Part of #2089
2020-11-14 16:17:27 +01:00
Martin Hořeňovský
4f14922aa3
Don't use shared_ptr to store test run info in CumulativeReporterBase
Part of #2089
2020-11-14 16:16:28 +01:00
2 changed files with 9 additions and 9 deletions

View File

@ -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(
@ -105,9 +106,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();
}

View File

@ -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>
@ -21,7 +22,7 @@ namespace Catch {
template<typename T, typename ChildNodeT>
struct Node {
explicit Node( T const& _value ) : value( _value ) {}
virtual ~Node() {}
virtual ~Node() = default;
using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>;
T value;
@ -72,15 +73,13 @@ namespace Catch {
IConfig const* m_config;
std::ostream& stream;
std::vector<AssertionStats> m_assertions;
std::vector<std::vector<std::shared_ptr<SectionNode>>> m_sections;
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;
SectionNode* m_deepestSection = nullptr;
std::vector<std::shared_ptr<SectionNode>> m_sectionStack;
};