Devirtualize handling of ReporterPreferences

The new scheme is that there is one protected member instance of
`ReporterPreferences` in the `IStreamingReporter` base class,
and derived classes can modify it to express their own preferences.

Retrieving the preferences is now a non-virtual operation, which
makes it much cheaper to read them frequently. Previously, we
avoided doing so by caching the preferences in another variable,
but we still read them at least once per test case run.
This commit is contained in:
Martin Hořeňovský
2020-07-28 09:24:57 +02:00
parent d218d6f9e2
commit d090074da7
9 changed files with 32 additions and 41 deletions

View File

@@ -23,8 +23,8 @@ namespace Catch {
: StreamingReporterBase( _config ),
m_xml(_config.stream())
{
m_reporterPrefs.shouldRedirectStdOut = true;
m_reporterPrefs.shouldReportAllAssertions = true;
m_preferences.shouldRedirectStdOut = true;
m_preferences.shouldReportAllAssertions = true;
}
XmlReporter::~XmlReporter() = default;