Reduce the use of shared_ptrs for various Config objects

Ideally they would not be used at all, but the main config lifetime
is a weird mess right now and will require further refactoring.
This commit is contained in:
Martin Hořeňovský
2020-01-25 15:32:56 +01:00
parent 7134ad9913
commit df2379218b
7 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -33,14 +33,14 @@ namespace Catch {
namespace {
const int MaxExitCode = 255;
IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) {
IStreamingReporterPtr createReporter(std::string const& reporterName, IConfig const* config) {
auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'");
return reporter;
}
IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
IStreamingReporterPtr makeReporter(Config const* config) {
if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
return createReporter(config->getReporterName(), config);
}
@@ -273,7 +273,7 @@ namespace Catch {
}
// Create reporter(s) so we can route listings through them
auto reporter = makeReporter(m_config);
auto reporter = makeReporter(m_config.get());
// Handle list request
if (list(*reporter, m_config)) {