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

Properly guard CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER definition

Commit
1c1b447ede1abbccdf308831644f54387920db7d
Author
Martin Hořeňovský ·
Parents
e1d81174dba1

Files · Download .tar.gz

Changes

 include/catch.hpp                   | 4 +++-
 include/internal/catch_tostring.cpp | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/catch.hpp b/include/catch.hpp
index 517dbd3d..b4a05845 100644
--- a/include/catch.hpp
+++ b/include/catch.hpp
@@ -33,7 +33,9 @@
 #  if defined(CATCH_CONFIG_DISABLE_MATCHERS)
 #    undef CATCH_CONFIG_DISABLE_MATCHERS
 #  endif
-#  define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
+#  if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
+#    define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
+#  endif
 #endif
 
 #if !defined(CATCH_CONFIG_IMPL_ONLY)
diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
index ee6a815f..61b29771 100644
--- a/include/internal/catch_tostring.cpp
+++ b/include/internal/catch_tostring.cpp
@@ -231,8 +231,8 @@ std::string StringMaker<double>::convert(double value) {
 
 std::string ratio_string<std::atto>::symbol() { return "a"; }
 std::string ratio_string<std::femto>::symbol() { return "f"; }
-std::string  ratio_string<std::pico>::symbol() { return "p"; }
-std::string  ratio_string<std::nano>::symbol() { return "n"; }
+std::string ratio_string<std::pico>::symbol() { return "p"; }
+std::string ratio_string<std::nano>::symbol() { return "n"; }
 std::string ratio_string<std::micro>::symbol() { return "u"; }
 std::string ratio_string<std::milli>::symbol() { return "m"; }