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

Cleanup clang-tidy warning about enum sizes

Commit
119a7bbe53ae8959f51c021c63bbd5a1734c5261
Author
Martin Hořeňovský ·
Parents
9c5a4cf44e49

Files · Download .tar.gz

Changes

 .clang-tidy                                     | 3 ++-
 src/catch2/catch_tostring.cpp                   | 5 ++++-
 src/catch2/reporters/catch_reporter_console.cpp | 7 +++++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.clang-tidy b/.clang-tidy
index 539010d9..3488457a 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -34,7 +34,7 @@ Checks: >-
   -modernize-pass-by-value,
 
   performance-*,
-  -performance-enum-size,
+  performance-enum-size,
 
   portability-*,
 
@@ -49,6 +49,7 @@ Checks: >-
   -readability-implicit-bool-conversion,
   -readability-isolate-declaration,
   -readability-magic-numbers,
+  -readability-math-missing-parentheses, #no, 'a + B * C' obeying math rules is not confusing,
   -readability-named-parameter,
   -readability-qualified-auto,
   -readability-redundant-access-specifiers,
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 3f034d1a..83327cfb 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -22,7 +22,10 @@ namespace Detail {
         const int hexThreshold = 255;
 
         struct Endianness {
-            enum Arch { Big, Little };
+            enum Arch : uint8_t {
+                Big,
+                Little
+            };
 
             static Arch which() {
                 int one = 1;
diff --git a/src/catch2/reporters/catch_reporter_console.cpp b/src/catch2/reporters/catch_reporter_console.cpp
index c5678548..9529f39a 100644
--- a/src/catch2/reporters/catch_reporter_console.cpp
+++ b/src/catch2/reporters/catch_reporter_console.cpp
@@ -214,7 +214,7 @@ struct RowBreak {};
 struct OutputFlush {};
 
 class Duration {
-    enum class Unit {
+    enum class Unit : uint8_t {
         Auto,
         Nanoseconds,
         Microseconds,
@@ -286,7 +286,10 @@ public:
 };
 } // end anon namespace
 
-enum class Justification { Left, Right };
+enum class Justification : uint8_t {
+    Left,
+    Right
+};
 
 struct ColumnInfo {
     std::string name;