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

Fixed temporary encapsulation violation

Commit
e3bcf68f7ae3f17bd14f5e4a2be84ad9f6eb4fed
Author
Phil Nash ·
Parents
16a6dd57467d

Files · Download .tar.gz

Changes

 internal/catch_list.hpp              | 4 ++--
 internal/catch_reporter_registry.hpp | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/internal/catch_list.hpp b/internal/catch_list.hpp
index 82cc162f..338c73a9 100644
--- a/internal/catch_list.hpp
+++ b/internal/catch_list.hpp
@@ -22,8 +22,8 @@ namespace Catch
         if( config.listWhat() & RunnerConfig::listReports )
         {
             std::cout << "Available reports:\n";
-            ReporterRegistry::FactoryMap::const_iterator it = ReporterRegistry::instance().m_factories.begin();
-            ReporterRegistry::FactoryMap::const_iterator itEnd = ReporterRegistry::instance().m_factories.end();
+            ReporterRegistry::FactoryMap::const_iterator it = ReporterRegistry::instance().getFactories().begin();
+            ReporterRegistry::FactoryMap::const_iterator itEnd = ReporterRegistry::instance().getFactories().end();
             for(; it != itEnd; ++it )
             {
                 // !TBD: consider listAs()
diff --git a/internal/catch_reporter_registry.hpp b/internal/catch_reporter_registry.hpp
index 806dbdb1..0837d14c 100644
--- a/internal/catch_reporter_registry.hpp
+++ b/internal/catch_reporter_registry.hpp
@@ -146,8 +146,14 @@ namespace Catch
             m_factories.insert( std::make_pair( name, new ReporterFactory<T>() ) );
         }
         
-//    private: // !TBD
         typedef std::map<std::string, IReporterFactory*> FactoryMap;
+
+        const FactoryMap& getFactories() const
+        {
+            return m_factories;
+        }
+
+    private:
         FactoryMap m_factories;
     };