diff --git a/src/uml/class_diagram_visitor.cc b/src/uml/class_diagram_visitor.cc index 873c9253..f8d59d4c 100644 --- a/src/uml/class_diagram_visitor.cc +++ b/src/uml/class_diagram_visitor.cc @@ -1032,14 +1032,11 @@ void tu_visitor::find_relationships(const cppast::cpp_type &t_, cppast::cpp_type_kind::user_defined_t) { LOG_DBG("User defined type: {} | {}", cppast::to_string(t_), cppast::to_string(t_.canonical())); - if (ctx.config.should_include(cppast::to_string(t_.canonical()))) { - if (relationship_type != relationship_t::kNone) - relationships.emplace_back( - cppast::to_string(t), relationship_type); - else - relationships.emplace_back( - cppast::to_string(t), relationship_t::kAggregation); - } + if (relationship_type != relationship_t::kNone) + relationships.emplace_back(cppast::to_string(t), relationship_type); + else + relationships.emplace_back( + cppast::to_string(t), relationship_t::kAggregation); // Check if t_ has an alias in the alias index const auto fn = diff --git a/tests/t00018/test_case.h b/tests/t00018/test_case.h index 323913d2..d82a409d 100644 --- a/tests/t00018/test_case.h +++ b/tests/t00018/test_case.h @@ -42,39 +42,12 @@ TEST_CASE("t00018", "[test-case][class]") REQUIRE_THAT(puml, StartsWith("@startuml")); REQUIRE_THAT(puml, EndsWith("@enduml\n")); REQUIRE_THAT(puml, IsClass(_A("widget"))); - /* - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsClass(_A("H"))); - REQUIRE_THAT(puml, IsClass(_A("I"))); - REQUIRE_THAT(puml, IsClass(_A("J"))); - REQUIRE_THAT(puml, IsClass(_A("K"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(puml, IsClass(_A("impl::widget"))); - REQUIRE_THAT(puml, (IsField("some_int", "int"))); - REQUIRE_THAT(puml, (IsField("some_int_pointer", "int*"))); - REQUIRE_THAT(puml, (IsField("some_int_pointer_pointer", "int**"))); + REQUIRE_THAT( + puml, IsAggregation(_A("widget"), _A("impl::widget"), "-pImpl")); + REQUIRE_THAT(puml, IsDependency(_A("impl::widget"), _A("widget"))); - // Relationship members should not be rendered as part of this testcase - REQUIRE_THAT(puml, !(IsField("a", _A("A")))); - REQUIRE_THAT(puml, !(IsField("b", _A("B")))); - - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("A"), "-a")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("B"), "-b")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("C"), "-c")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "-d")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("E"), "-e")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("F"), "-f")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("G"), "-g")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("H"), "-h")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("I"), "-i")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("J"), "-j")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("K"), "-k")); - */ save_puml( "./" + config.output_directory + "/" + diagram->name + ".puml", puml); }