Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Turn ShowDurations into an enum class

Commit
60cc4c293d4d7d984a0f01397270ce592a397de5
Author
Martin Hořeňovský ·
Parents
6dc834526103

Files · Download .tar.gz

Changes

 src/catch2/catch_config.cpp                       | 2 +-
 src/catch2/catch_config.hpp                       | 4 ++--
 src/catch2/interfaces/catch_interfaces_config.hpp | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index bd311974..93acc690 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -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; }
diff --git a/src/catch2/catch_config.hpp b/src/catch2/catch_config.hpp
index 3aa8b210..778d6cdd 100644
--- a/src/catch2/catch_config.hpp
+++ b/src/catch2/catch_config.hpp
@@ -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;
diff --git a/src/catch2/interfaces/catch_interfaces_config.hpp b/src/catch2/interfaces/catch_interfaces_config.hpp
index 8f3926f5..39cc2bf7 100644
--- a/src/catch2/interfaces/catch_interfaces_config.hpp
+++ b/src/catch2/interfaces/catch_interfaces_config.hpp
@@ -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;