From 7f1db14e29e278ce776f06c76e75fefa9e7c8c78 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 22 Jan 2022 23:36:15 +0100 Subject: [PATCH] Fixed formatting --- .../plantuml/package_diagram_generator.cc | 3 +- src/util/util.h | 4 +- tests/catch.h | 59 ++++++++++--------- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/package_diagram/generators/plantuml/package_diagram_generator.cc b/src/package_diagram/generators/plantuml/package_diagram_generator.cc index 7545466e..8f55f2f6 100644 --- a/src/package_diagram/generators/plantuml/package_diagram_generator.cc +++ b/src/package_diagram/generators/plantuml/package_diagram_generator.cc @@ -79,8 +79,7 @@ std::string generator::name(relationship_t r) const } } -void generator::generate( - const package &p, std::ostream &ostr) const +void generator::generate(const package &p, std::ostream &ostr) const { const auto uns = m_config.using_namespace; diff --git a/src/util/util.h b/src/util/util.h index da9f2544..f76cedfd 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -149,9 +149,9 @@ bool starts_with(const std::vector &col, const std::vector &prefix) template void remove_prefix(std::vector &col, const std::vector &prefix) { - if(!starts_with(col, prefix)) + if (!starts_with(col, prefix)) return; - col = std::vector(col.begin()+prefix.size(), col.end()); + col = std::vector(col.begin() + prefix.size(), col.end()); } } diff --git a/tests/catch.h b/tests/catch.h index a9dd6896..90d8fe9a 100644 --- a/tests/catch.h +++ b/tests/catch.h @@ -165,9 +165,10 @@ unsigned int rngSeed(); // // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. #if !defined(__ibmxl__) && !defined(__CUDACC__) -#define CATCH_INTERNAL_IGNORE_BUT_WARN(...) \ - (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, \ - hicpp-vararg) */ +#define CATCH_INTERNAL_IGNORE_BUT_WARN(...) \ + (void)__builtin_constant_p( \ + __VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, \ + hicpp-vararg) */ #endif #define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ @@ -4648,31 +4649,33 @@ auto makeMatchExpr(ArgT const &arg, MatcherT const &matcher, } while (false) /////////////////////////////////////////////////////////////////////////////// -#define INTERNAL_CATCH_THROWS_MATCHES( \ - macroName, exceptionType, resultDisposition, matcher, ...) \ - do { \ - Catch::AssertionHandler catchAssertionHandler(macroName##_catch_sr, \ - CATCH_INTERNAL_LINEINFO, \ - CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) "," \ - " " CATCH_INTERNAL_STRINGIFY( \ - exceptionType) "," \ - " " CATCH_INTERNAL_STRINGIFY(matcher), \ - resultDisposition); \ - if (catchAssertionHandler.allowThrows()) \ - try { \ - static_cast(__VA_ARGS__); \ - catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ - } \ - catch (exceptionType const &ex) { \ - catchAssertionHandler.handleExpr( \ - Catch::makeMatchExpr(ex, matcher, #matcher##_catch_sr)); \ - } \ - catch (...) { \ - catchAssertionHandler.handleUnexpectedInflightException(); \ - } \ - else \ - catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT(catchAssertionHandler) \ +#define INTERNAL_CATCH_THROWS_MATCHES( \ + macroName, exceptionType, resultDisposition, matcher, ...) \ + do { \ + Catch::AssertionHandler catchAssertionHandler(macroName##_catch_sr, \ + CATCH_INTERNAL_LINEINFO, \ + CATCH_INTERNAL_STRINGIFY( \ + __VA_ARGS__) "," \ + " " CATCH_INTERNAL_STRINGIFY( \ + exceptionType) "," \ + " " CATCH_INTERNAL_STRINGIFY( \ + matcher), \ + resultDisposition); \ + if (catchAssertionHandler.allowThrows()) \ + try { \ + static_cast(__VA_ARGS__); \ + catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \ + } \ + catch (exceptionType const &ex) { \ + catchAssertionHandler.handleExpr( \ + Catch::makeMatchExpr(ex, matcher, #matcher##_catch_sr)); \ + } \ + catch (...) { \ + catchAssertionHandler.handleUnexpectedInflightException(); \ + } \ + else \ + catchAssertionHandler.handleThrowingCallSkipped(); \ + INTERNAL_CATCH_REACT(catchAssertionHandler) \ } while (false) // end catch_capture_matchers.h