Fixed formatting

This commit is contained in:
Bartek Kryza
2022-12-09 22:12:49 +01:00
parent 69ca8c2d8e
commit 290e1ab0fe
10 changed files with 26 additions and 27 deletions

View File

@@ -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);

View File

@@ -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 {}",

View File

@@ -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);

View File

@@ -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)"));

View File

@@ -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);
}

View File

@@ -4,13 +4,9 @@ namespace clanguml {
namespace t20014 {
template <typename T, typename F> 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_;
};

View File

@@ -2,7 +2,7 @@ namespace clanguml {
namespace t20016 {
struct A {
void a1(int a) { }
template <typename T> T a2(const T &a) { return a;}
template <typename T> T a2(const T &a) { return a; }
};
template <typename T> struct B {
@@ -13,7 +13,8 @@ template <typename T> struct B {
A a_;
};
void tmain() {
void tmain()
{
B<long> b;
b.b1(1);

View File

@@ -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,int)"));
HasCall(_A("t20017.cc"), _A("include/t20017_b.h"), "b2<int>(int,int)"));
REQUIRE_THAT(puml, HasExitpoint(_A("t20017.cc")));
save_puml(

View File

@@ -79,19 +79,26 @@ template <typename T, typename... Ts> constexpr bool has_type() noexcept
return (std::is_same_v<T, Ts> || ... || 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(