diff --git a/components/core/src/clp/regex_utils/RegexErrorCode.cpp b/components/core/src/clp/regex_utils/RegexErrorCode.cpp index 06ced6bcc..bd1704590 100644 --- a/components/core/src/clp/regex_utils/RegexErrorCode.cpp +++ b/components/core/src/clp/regex_utils/RegexErrorCode.cpp @@ -3,17 +3,15 @@ #include #include -//#include "GenericErrorCode.hpp" -namespace clp::error_handling { template <> auto clp::regex_utils::RegexErrorCategory::name() const noexcept -> char const* { return "regex utility"; } template <> -auto clp::regex_utils::RegexErrorCategory::message(int ev) const -> std::string { - switch (static_cast(ev)) { +auto clp::regex_utils::RegexErrorCategory::message(clp::regex_utils::RegexErrorEnum ev) const -> std::string { + switch (ev) { case clp::regex_utils::RegexErrorEnum::Success: return "Success."; @@ -34,7 +32,3 @@ auto clp::regex_utils::RegexErrorCategory::message(int ev) const -> std::string return "(unrecognized error)"; } } -} - -template class clp::error_handling::ErrorCategory; -template class clp::error_handling::ErrorCode; diff --git a/components/core/src/clp/regex_utils/RegexErrorCode.hpp b/components/core/src/clp/regex_utils/RegexErrorCode.hpp index 93ba914c5..058b75e17 100644 --- a/components/core/src/clp/regex_utils/RegexErrorCode.hpp +++ b/components/core/src/clp/regex_utils/RegexErrorCode.hpp @@ -6,7 +6,6 @@ #include #include -//#include "GenericErrorCode.hpp" namespace clp::regex_utils { enum class RegexErrorEnum : uint8_t { @@ -26,8 +25,6 @@ enum class RegexErrorEnum : uint8_t { TokenUnquantifiable, }; -//using RegexErrorCategory = clp::error_handling::ErrorCategory; -//using RegexErrorCode = clp::error_handling::ErrorCode; using RegexErrorCategory = clp::error_handling::ErrorCategory; using RegexErrorCode = clp::error_handling::ErrorCode; } // namespace clp::regex_utils diff --git a/components/core/tests/test-regex_utils.cpp b/components/core/tests/test-regex_utils.cpp index bd6d65882..0340b1ed3 100644 --- a/components/core/tests/test-regex_utils.cpp +++ b/components/core/tests/test-regex_utils.cpp @@ -20,7 +20,7 @@ TEST_CASE("regex_to_wildcard_simple_translations", "[regex_utils][re2wc][simple_ TEST_CASE("regex_to_wildcard_unescaped_metachar", "[regex_utils][re2wc][unescaped_metachar]") { REQUIRE((regex_to_wildcard(".? xyz .* zyx .").error() == ErrorCode::UnsupportedQuestionMark)); - //REQUIRE((regex_to_wildcard(". xyz .** zyx .").error() == RegexErrorCode{RegexErrorEnum::Star})); + REQUIRE((regex_to_wildcard(". xyz .** zyx .").error() == RegexErrorCode{RegexErrorEnum::Star})); REQUIRE((regex_to_wildcard(". xyz .*+ zyx .").error() == ErrorCode::UntranslatablePlus)); REQUIRE((regex_to_wildcard(". xyz |.* zyx .").error() == ErrorCode::UnsupportedPipe)); REQUIRE((regex_to_wildcard(". xyz ^.* zyx .").error() == ErrorCode::IllegalCaret));