Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Replaced use of dynamic_cast with static_cast.

It wasn't necessary anyway.
This addresses #821
Commit
9a3486a7056e2dab1d8b3ae50343eedda97c0462
Author
Phil Nash ·
Parents
d89079180084

Files · Download .tar.gz

Changes

 include/internal/catch_run_context.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp
index bf2bdb7d..ff63ee2a 100644
--- a/include/internal/catch_run_context.hpp
+++ b/include/internal/catch_run_context.hpp
@@ -98,7 +98,8 @@ namespace Catch {
 
             do {
                 ITracker& rootTracker = m_trackerContext.startRun();
-                dynamic_cast<SectionTracker&>( rootTracker ).addInitialFilters( m_config->getSectionsToRun() );
+                assert( rootTracker.isSectionTracker() );
+                static_cast<SectionTracker&>( rootTracker ).addInitialFilters( m_config->getSectionsToRun() );
                 do {
                     m_trackerContext.startCycle();
                     m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( testInfo.name, testInfo.lineInfo ) );