diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 14709b29..3aff1883 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -171,10 +171,9 @@ bool translation_unit_visitor::VisitEnumDecl(clang::EnumDecl *enm) } } - if(!id_opt) { + if (!id_opt) { LOG_WARN("Unknown parent for enum {}", qualified_name); return true; - } auto parent_class = diagram_.get_class(*id_opt); diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index a936dae2..cd75d268 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -177,7 +177,7 @@ void call_expression_context::enter_lambda_expression(std::int64_t id) void call_expression_context::leave_lambda_expression() { - if(current_lambda_caller_id_.empty()) + if (current_lambda_caller_id_.empty()) return; LOG_DBG("Leaving current lambda expression id to {}", diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 3bb75fdc..61d3627a 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -64,8 +64,6 @@ public: bool VisitFunctionTemplateDecl( clang::FunctionTemplateDecl *function_declaration); - - clanguml::sequence_diagram::model::diagram &diagram(); const clanguml::sequence_diagram::model::diagram &diagram() const; @@ -206,8 +204,7 @@ private: bool is_smart_pointer(const clang::TemplateDecl *primary_template) const; bool is_callee_valid_template_specialization( - const clang::CXXDependentScopeMemberExpr *dependent_member_expr) - const; + const clang::CXXDependentScopeMemberExpr *dependent_member_expr) const; bool process_operator_call_expression(model::message &m, const clang::CXXOperatorCallExpr *operator_call_expr); diff --git a/tests/t20001/test_case.h b/tests/t20001/test_case.h index c50075e6..87f3d4a3 100644 --- a/tests/t20001/test_case.h +++ b/tests/t20001/test_case.h @@ -40,7 +40,8 @@ TEST_CASE("t20001", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("A"), "log_result(int)")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "log_result(int)")); - REQUIRE_THAT(puml, HasCallWithResponse(_A("B"), _A("A"), "add3(int,int,int)")); + REQUIRE_THAT( + puml, HasCallWithResponse(_A("B"), _A("A"), "add3(int,int,int)")); REQUIRE_THAT(puml, HasCall(_A("A"), "add(int,int)")); REQUIRE_THAT(puml, !HasCall(_A("A"), _A("detail::C"), "add(int,int)")); diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index cb68ff3e..e639dd23 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -68,7 +68,6 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("D"), "add5(int)")); - save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); } \ No newline at end of file diff --git a/tests/t20014/include/t20014_c.h b/tests/t20014/include/t20014_c.h index 83f13875..463cfa8b 100644 --- a/tests/t20014/include/t20014_c.h +++ b/tests/t20014/include/t20014_c.h @@ -4,13 +4,9 @@ namespace clanguml { namespace t20014 { template struct C { - F c1(F i, F j) { - return c_.b1(i, j); - } + F c1(F i, F j) { return c_.b1(i, j); } - F c2(F i, F j){ - return c_.b2(i, j); - } + F c2(F i, F j) { return c_.b2(i, j); } T c_; }; diff --git a/tests/t20014/test_case.h b/tests/t20014/test_case.h index eec0fe57..f92ed6bb 100644 --- a/tests/t20014/test_case.h +++ b/tests/t20014/test_case.h @@ -33,7 +33,7 @@ TEST_CASE("t20014", "[test-case][sequence]") REQUIRE_THAT(puml, StartsWith("@startuml")); REQUIRE_THAT(puml, EndsWith("@enduml\n")); - + // Check if all calls exist REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1(int,int)")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int,int)")); diff --git a/tests/t20016/t20016.cc b/tests/t20016/t20016.cc index 228aad6b..77bf22cb 100644 --- a/tests/t20016/t20016.cc +++ b/tests/t20016/t20016.cc @@ -2,7 +2,7 @@ namespace clanguml { namespace t20016 { struct A { void a1(int a) { } - template T a2(const T &a) { return a;} + template T a2(const T &a) { return a; } }; template struct B { @@ -13,7 +13,8 @@ template struct B { A a_; }; -void tmain() { +void tmain() +{ B b; b.b1(1); diff --git a/tests/t20017/test_case.h b/tests/t20017/test_case.h index d16bcc96..ee5ede2f 100644 --- a/tests/t20017/test_case.h +++ b/tests/t20017/test_case.h @@ -45,8 +45,7 @@ TEST_CASE("t20017", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("t20017.cc"), _A("include/t20017_b.h"), "b1(int,int)")); REQUIRE_THAT(puml, - HasCall( - _A("t20017.cc"), _A("include/t20017_b.h"), "b2(int,int)")); + HasCall(_A("t20017.cc"), _A("include/t20017_b.h"), "b2(int,int)")); REQUIRE_THAT(puml, HasExitpoint(_A("t20017.cc"))); save_puml( diff --git a/tests/test_cases.h b/tests/test_cases.h index f4e9fd87..ff4da381 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -79,19 +79,26 @@ template constexpr bool has_type() noexcept return (std::is_same_v || ... || false); } -struct Public { }; +struct Public { +}; -struct Protected { }; +struct Protected { +}; -struct Private { }; +struct Private { +}; -struct Abstract { }; +struct Abstract { +}; -struct Static { }; +struct Static { +}; -struct Const { }; +struct Const { +}; -struct Default { }; +struct Default { +}; struct HasCallWithResultMatcher : ContainsMatcher { HasCallWithResultMatcher(