Fixed t00014 on macos (Fixes #176)
This commit is contained in:
@@ -62,6 +62,7 @@ bool template_builder::simplify_system_template(
|
|||||||
|
|
||||||
if (simplified != full_name) {
|
if (simplified != full_name) {
|
||||||
ct.set_type(simplified);
|
ct.set_type(simplified);
|
||||||
|
ct.set_id(common::to_id(simplified));
|
||||||
ct.clear_params();
|
ct.clear_params();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -435,6 +436,10 @@ void template_builder::process_template_arguments(
|
|||||||
|
|
||||||
arg_index++;
|
arg_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update id
|
||||||
|
template_instantiation.set_id(
|
||||||
|
common::to_id(template_instantiation.full_name(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void template_builder::argument_process_dispatch(
|
void template_builder::argument_process_dispatch(
|
||||||
@@ -1029,6 +1034,9 @@ template_builder::try_as_template_specialization_type(
|
|||||||
simplify_system_template(
|
simplify_system_template(
|
||||||
argument, argument.to_string(using_namespace(), false));
|
argument, argument.to_string(using_namespace(), false));
|
||||||
|
|
||||||
|
argument.set_id(
|
||||||
|
common::to_id(argument.to_string(using_namespace(), false)));
|
||||||
|
|
||||||
const auto nested_template_instantiation_full_name =
|
const auto nested_template_instantiation_full_name =
|
||||||
nested_template_instantiation->full_name(false);
|
nested_template_instantiation->full_name(false);
|
||||||
|
|
||||||
@@ -1140,10 +1148,12 @@ std::optional<template_parameter> template_builder::try_as_record_type(
|
|||||||
auto argument = template_parameter::make_argument({});
|
auto argument = template_parameter::make_argument({});
|
||||||
type = consume_context(type, argument);
|
type = consume_context(type, argument);
|
||||||
|
|
||||||
auto type_name = common::to_string(type, template_decl->getASTContext());
|
const auto type_name = config().simplify_template_type(
|
||||||
|
common::to_string(type, template_decl->getASTContext()));
|
||||||
|
|
||||||
argument.set_type(type_name);
|
argument.set_type(type_name);
|
||||||
const auto type_id = common::to_id(type_name);
|
const auto type_id = common::to_id(type_name);
|
||||||
|
|
||||||
argument.set_id(type_id);
|
argument.set_id(type_id);
|
||||||
|
|
||||||
const auto *class_template_specialization =
|
const auto *class_template_specialization =
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
* @param multiplicity_source Multiplicity at the source
|
* @param multiplicity_source Multiplicity at the source
|
||||||
* @param multiplicity_destination Multiplicity at the destination
|
* @param multiplicity_destination Multiplicity at the destination
|
||||||
*/
|
*/
|
||||||
relationship(relationship_t type, int64_t destination,
|
relationship(relationship_t type, clanguml::common::id_t destination,
|
||||||
access_t access = access_t::kPublic, std::string label = "",
|
access_t access = access_t::kPublic, std::string label = "",
|
||||||
std::string multiplicity_source = "",
|
std::string multiplicity_source = "",
|
||||||
std::string multiplicity_destination = "");
|
std::string multiplicity_destination = "");
|
||||||
@@ -144,7 +144,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
relationship_t type_;
|
relationship_t type_;
|
||||||
int64_t destination_;
|
clanguml::common::id_t destination_;
|
||||||
std::string multiplicity_source_;
|
std::string multiplicity_source_;
|
||||||
std::string multiplicity_destination_;
|
std::string multiplicity_destination_;
|
||||||
std::string label_;
|
std::string label_;
|
||||||
|
|||||||
@@ -517,6 +517,9 @@ bool template_parameter::find_nested_relationships(
|
|||||||
// just add it and skip recursion (e.g. this is a user defined type)
|
// just add it and skip recursion (e.g. this is a user defined type)
|
||||||
const auto maybe_type = type();
|
const auto maybe_type = type();
|
||||||
|
|
||||||
|
if (is_function_template())
|
||||||
|
hint = common::model::relationship_t::kDependency;
|
||||||
|
|
||||||
if (maybe_type && should_include(maybe_type.value())) {
|
if (maybe_type && should_include(maybe_type.value())) {
|
||||||
if (is_association())
|
if (is_association())
|
||||||
hint = common::model::relationship_t::kAssociation;
|
hint = common::model::relationship_t::kAssociation;
|
||||||
@@ -538,7 +541,8 @@ bool template_parameter::find_nested_relationships(
|
|||||||
|
|
||||||
if (maybe_id && maybe_arg_type && should_include(*maybe_arg_type)) {
|
if (maybe_id && maybe_arg_type && should_include(*maybe_arg_type)) {
|
||||||
|
|
||||||
if (template_argument.is_association())
|
if (template_argument.is_association() &&
|
||||||
|
hint == common::model::relationship_t::kAggregation)
|
||||||
hint = common::model::relationship_t::kAssociation;
|
hint = common::model::relationship_t::kAssociation;
|
||||||
|
|
||||||
nested_relationships.emplace_back(maybe_id.value(), hint);
|
nested_relationships.emplace_back(maybe_id.value(), hint);
|
||||||
@@ -547,6 +551,9 @@ bool template_parameter::find_nested_relationships(
|
|||||||
(hint == common::model::relationship_t::kAggregation);
|
(hint == common::model::relationship_t::kAggregation);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (template_argument.is_function_template())
|
||||||
|
hint = common::model::relationship_t::kDependency;
|
||||||
|
|
||||||
added_aggregation_relationship =
|
added_aggregation_relationship =
|
||||||
template_argument.find_nested_relationships(
|
template_argument.find_nested_relationships(
|
||||||
nested_relationships, hint, should_include);
|
nested_relationships, hint, should_include);
|
||||||
|
|||||||
@@ -136,12 +136,9 @@ TEST_CASE("t00014", "[test-case][class]")
|
|||||||
REQUIRE_THAT(src,
|
REQUIRE_THAT(src,
|
||||||
IsAggregation(_A("R<T>"),
|
IsAggregation(_A("R<T>"),
|
||||||
_A("A<float,std::unique_ptr<std::string>>"), "-floatstring"));
|
_A("A<float,std::unique_ptr<std::string>>"), "-floatstring"));
|
||||||
#if !defined(__APPLE__)
|
|
||||||
// TODO(#176)
|
|
||||||
REQUIRE_THAT(src, IsDependency(_A("R<T>"), _A("A<char,std::string>")));
|
REQUIRE_THAT(src, IsDependency(_A("R<T>"), _A("A<char,std::string>")));
|
||||||
REQUIRE_THAT(
|
REQUIRE_THAT(
|
||||||
src, IsDependency(_A("R<T>"), _A("A<wchar_t,std::string>")));
|
src, IsDependency(_A("R<T>"), _A("A<wchar_t,std::string>")));
|
||||||
#endif
|
|
||||||
|
|
||||||
save_puml(config.output_directory(), diagram->name + ".puml", src);
|
save_puml(config.output_directory(), diagram->name + ".puml", src);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user