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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_run_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-12-04 22:57:34 +0100
committerMartin Hořeňovský2020-12-05 15:19:23 +0100
commit4b51d0dd3be90f4faf3c10f60d1923ad47a792d7 (patch)
treeade421b973b1d137102c37f5f2f0d8f9f904eaee /src/catch2/internal/catch_run_context.cpp
parent6350851f9af96a1c35da92b18ca7cb3d90fa67c9 (diff)
downloadcatch3-4b51d0dd3be90f4faf3c10f60d1923ad47a792d7.tar.gz
Remove rest of std::shared_ptr usage in Trackers
Closes #2088
Diffstat (limited to 'src/catch2/internal/catch_run_context.cpp')
-rw-r--r--src/catch2/internal/catch_run_context.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index 79022dd4..8379a7aa 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -60,8 +60,9 @@ namespace Catch {
assert( childTracker->isGeneratorTracker() );
tracker = static_cast<GeneratorTracker*>( childTracker );
} else {
- auto newTracker = std::make_shared<GeneratorTracker>(
- nameAndLocation, ctx, &currentTracker );
+ auto newTracker =
+ Catch::Detail::make_unique<GeneratorTracker>(
+ nameAndLocation, ctx, &currentTracker );
tracker = newTracker.get();
currentTracker.addChild( std::move(newTracker) );
}
@@ -96,7 +97,7 @@ namespace Catch {
if ( std::find_if(
m_children.begin(),
m_children.end(),
- []( TestCaseTracking::ITrackerPtr tracker ) {
+ []( TestCaseTracking::ITrackerPtr const& tracker ) {
return tracker->hasStarted();
} ) != m_children.end() ) {
return false;
@@ -105,7 +106,7 @@ namespace Catch {
// No children have started. We need to check if they _can_
// start, and thus we should wait for them, or they cannot
// start (due to filters), and we shouldn't wait for them
- auto* parent = m_parent;
+ ITracker* parent = m_parent;
// This is safe: there is always at least one section
// tracker in a test case tracking tree
while ( !parent->isSectionTracker() ) {
@@ -115,7 +116,7 @@ namespace Catch {
"Missing root (test case) level section" );
auto const& parentSection =
- static_cast<SectionTracker&>( *parent );
+ static_cast<SectionTracker const&>( *parent );
auto const& filters = parentSection.getFilters();
// No filters -> no restrictions on running sections
if ( filters.empty() ) {
@@ -124,11 +125,11 @@ namespace Catch {
for ( auto const& child : m_children ) {
if ( child->isSectionTracker() &&
- std::find( filters.begin(),
- filters.end(),
- static_cast<SectionTracker&>( *child )
- .trimmedName() ) !=
- filters.end() ) {
+ std::find(
+ filters.begin(),
+ filters.end(),
+ static_cast<SectionTracker const&>( *child )
+ .trimmedName() ) != filters.end() ) {
return true;
}
}