Fixed relationship parsing to forward declared classes
This commit is contained in:
@@ -1032,14 +1032,11 @@ void tu_visitor::find_relationships(const cppast::cpp_type &t_,
|
|||||||
cppast::cpp_type_kind::user_defined_t) {
|
cppast::cpp_type_kind::user_defined_t) {
|
||||||
LOG_DBG("User defined type: {} | {}", cppast::to_string(t_),
|
LOG_DBG("User defined type: {} | {}", cppast::to_string(t_),
|
||||||
cppast::to_string(t_.canonical()));
|
cppast::to_string(t_.canonical()));
|
||||||
if (ctx.config.should_include(cppast::to_string(t_.canonical()))) {
|
|
||||||
if (relationship_type != relationship_t::kNone)
|
if (relationship_type != relationship_t::kNone)
|
||||||
relationships.emplace_back(
|
relationships.emplace_back(cppast::to_string(t), relationship_type);
|
||||||
cppast::to_string(t), relationship_type);
|
|
||||||
else
|
else
|
||||||
relationships.emplace_back(
|
relationships.emplace_back(
|
||||||
cppast::to_string(t), relationship_t::kAggregation);
|
cppast::to_string(t), relationship_t::kAggregation);
|
||||||
}
|
|
||||||
|
|
||||||
// Check if t_ has an alias in the alias index
|
// Check if t_ has an alias in the alias index
|
||||||
const auto fn =
|
const auto fn =
|
||||||
|
|||||||
@@ -42,39 +42,12 @@ TEST_CASE("t00018", "[test-case][class]")
|
|||||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||||
REQUIRE_THAT(puml, IsClass(_A("widget")));
|
REQUIRE_THAT(puml, IsClass(_A("widget")));
|
||||||
/*
|
REQUIRE_THAT(puml, IsClass(_A("impl::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, (IsField<Private>("some_int", "int")));
|
REQUIRE_THAT(
|
||||||
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer", "int*")));
|
puml, IsAggregation(_A("widget"), _A("impl::widget"), "-pImpl"));
|
||||||
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer_pointer", "int**")));
|
REQUIRE_THAT(puml, IsDependency(_A("impl::widget"), _A("widget")));
|
||||||
|
|
||||||
// Relationship members should not be rendered as part of this testcase
|
|
||||||
REQUIRE_THAT(puml, !(IsField<Private>("a", _A("A"))));
|
|
||||||
REQUIRE_THAT(puml, !(IsField<Private>("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(
|
save_puml(
|
||||||
"./" + config.output_directory + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory + "/" + diagram->name + ".puml", puml);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user