| 7626 | IReporterRegistry::~IReporterRegistry() = default; |
| 7627 | |
| 7628 | void addReporter( IStreamingReporterPtr& existingReporter, IStreamingReporterPtr&& additionalReporter ) { |
| 7629 | |
| 7630 | if( !existingReporter ) { |
| 7631 | existingReporter = std::move( additionalReporter ); |
| 7632 | return; |
| 7633 | } |
| 7634 | |
| 7635 | MultipleReporters* multi = nullptr; |
| 7636 | |
| 7637 | if( existingReporter->isMulti() ) { |
| 7638 | multi = static_cast<MultipleReporters*>( existingReporter.get() ); |
| 7639 | } |
| 7640 | else { |
| 7641 | auto newMulti = std::unique_ptr<MultipleReporters>( new MultipleReporters ); |
| 7642 | newMulti->add( std::move( existingReporter ) ); |
| 7643 | multi = newMulti.get(); |
| 7644 | existingReporter = std::move( newMulti ); |
| 7645 | } |
| 7646 | multi->add( std::move( additionalReporter ) ); |
| 7647 | } |
| 7648 | |
| 7649 | } // end namespace Catch |
| 7650 | // end catch_interfaces_reporter.cpp |
no test coverage detected