From e3bcf68f7ae3f17bd14f5e4a2be84ad9f6eb4fed Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 10 Nov 2010 08:43:48 +0000 Subject: [PATCH] Fixed temporary encapsulation violation --- 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() ) ); } -// private: // !TBD typedef std::map FactoryMap; + + const FactoryMap& getFactories() const + { + return m_factories; + } + + private: FactoryMap m_factories; };