diff --git a/include/internal/catch_test_case_tracker.hpp b/include/internal/catch_test_case_tracker.hpp index 505c3ab8..44529206 100644 --- a/include/internal/catch_test_case_tracker.hpp +++ b/include/internal/catch_test_case_tracker.hpp @@ -234,10 +234,8 @@ namespace TestCaseTracking { SectionTracker* section = CATCH_NULL; ITracker& currentTracker = ctx.currentTracker(); - if( ITracker* childTracker = currentTracker.findChild( name ) ) { - section = dynamic_cast( childTracker ); - assert( section ); - } + if( ITracker* childTracker = currentTracker.findChild( name ) ) + section = static_cast( childTracker ); else { section = new SectionTracker( name, ctx, ¤tTracker ); currentTracker.addChild( section ); @@ -265,10 +263,8 @@ namespace TestCaseTracking { IndexTracker* tracker = CATCH_NULL; ITracker& currentTracker = ctx.currentTracker(); - if( ITracker* childTracker = currentTracker.findChild( name ) ) { - tracker = dynamic_cast( childTracker ); - assert( tracker ); - } + if( ITracker* childTracker = currentTracker.findChild( name ) ) + tracker = static_cast( childTracker ); else { tracker = new IndexTracker( name, ctx, ¤tTracker, size ); currentTracker.addChild( tracker );