Turn ShowDurations into an enum class

This commit is contained in:
Martin Hořeňovský 2020-08-11 15:03:37 +02:00
parent 6dc8345261
commit 60cc4c293d
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 6 additions and 6 deletions

View File

@ -70,7 +70,7 @@ namespace Catch {
bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
ShowDurations Config::showDurations() const { return m_data.showDurations; }
double Config::minDuration() const { return m_data.minDuration; }
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
unsigned int Config::rngSeed() const { return m_data.rngSeed; }

View File

@ -43,7 +43,7 @@ namespace Catch {
Verbosity verbosity = Verbosity::Normal;
WarnAbout::What warnings = WarnAbout::Nothing;
ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
ShowDurations showDurations = ShowDurations::DefaultForReporter;
double minDuration = -1;
RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
UseColour::YesOrNo useColour = UseColour::Auto;
@ -94,7 +94,7 @@ namespace Catch {
bool includeSuccessfulResults() const override;
bool warnAboutMissingAssertions() const override;
bool warnAboutNoTests() const override;
ShowDurations::OrNot showDurations() const override;
ShowDurations showDurations() const override;
double minDuration() const override;
RunTests::InWhatOrder runOrder() const override;
unsigned int rngSeed() const override;

View File

@ -29,11 +29,11 @@ namespace Catch {
NoTests = 0x02
}; };
struct ShowDurations { enum OrNot {
enum class ShowDurations {
DefaultForReporter,
Always,
Never
}; };
};
struct RunTests { enum InWhatOrder {
InDeclarationOrder,
InLexicographicalOrder,
@ -66,7 +66,7 @@ namespace Catch {
virtual bool warnAboutNoTests() const = 0;
virtual int abortAfter() const = 0;
virtual bool showInvisibles() const = 0;
virtual ShowDurations::OrNot showDurations() const = 0;
virtual ShowDurations showDurations() const = 0;
virtual double minDuration() const = 0;
virtual TestSpec const& testSpec() const = 0;
virtual bool hasTestFilters() const = 0;