From 727b26ab354bcb43ed59ee76bbe9f56c2935f6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Mon, 9 Mar 2020 21:07:15 +0100 Subject: [PATCH] Remove IStreamingReporter::isMulti query This was previously used to avoid `dynamic_cast` inside our code, when we were creating more than one reporter, or a reporter together with listeners. However, since then the offending code was refactored to be smarter instead, and this query member function is no longer needed nor used. --- src/catch2/catch_interfaces_reporter.cpp | 1 - src/catch2/catch_interfaces_reporter.h | 2 -- src/catch2/reporters/catch_reporter_listening.cpp | 4 ---- src/catch2/reporters/catch_reporter_listening.h | 1 - 4 files changed, 8 deletions(-) diff --git a/src/catch2/catch_interfaces_reporter.cpp b/src/catch2/catch_interfaces_reporter.cpp index 1986b806..4fa753c0 100644 --- a/src/catch2/catch_interfaces_reporter.cpp +++ b/src/catch2/catch_interfaces_reporter.cpp @@ -112,7 +112,6 @@ namespace Catch { TestRunStats::~TestRunStats() = default; void IStreamingReporter::fatalErrorEncountered( StringRef ) {} - bool IStreamingReporter::isMulti() const { return false; } void IStreamingReporter::listReporters(std::vector const& descriptions, Config const& config) { Catch::cout() << "Available reporters:\n"; diff --git a/src/catch2/catch_interfaces_reporter.h b/src/catch2/catch_interfaces_reporter.h index 97ad6cae..a4cd9d8b 100644 --- a/src/catch2/catch_interfaces_reporter.h +++ b/src/catch2/catch_interfaces_reporter.h @@ -241,8 +241,6 @@ namespace Catch { // Default empty implementation provided virtual void fatalErrorEncountered( StringRef name ); - virtual bool isMulti() const; - // Listing support virtual void listReporters(std::vector const& descriptions, Config const& config); virtual void listTests(std::vector const& tests, Config const& config); diff --git a/src/catch2/reporters/catch_reporter_listening.cpp b/src/catch2/reporters/catch_reporter_listening.cpp index 01335a49..08f30659 100644 --- a/src/catch2/reporters/catch_reporter_listening.cpp +++ b/src/catch2/reporters/catch_reporter_listening.cpp @@ -150,10 +150,6 @@ namespace Catch { m_reporter->skipTest( testInfo ); } - bool ListeningReporter::isMulti() const { - return true; - } - void ListeningReporter::listReporters(std::vector const& descriptions, Config const& config) { for (auto const& listener : m_listeners) { listener->listReporters(descriptions, config); diff --git a/src/catch2/reporters/catch_reporter_listening.h b/src/catch2/reporters/catch_reporter_listening.h index e33aa283..032d8a18 100644 --- a/src/catch2/reporters/catch_reporter_listening.h +++ b/src/catch2/reporters/catch_reporter_listening.h @@ -50,7 +50,6 @@ namespace Catch { void testRunEnded( TestRunStats const& testRunStats ) override; void skipTest( TestCaseInfo const& testInfo ) override; - bool isMulti() const override; void listReporters(std::vector const& descriptions, Config const& config) override; void listTests(std::vector const& tests, Config const& config) override;