Fixed up to 33
This commit is contained in:
@@ -271,6 +271,9 @@ bool translation_unit_visitor::VisitClassTemplateDecl(
|
|||||||
|
|
||||||
auto c_ptr = process_class_declaration(cls->getTemplatedDecl());
|
auto c_ptr = process_class_declaration(cls->getTemplatedDecl());
|
||||||
|
|
||||||
|
if (!c_ptr)
|
||||||
|
return true;
|
||||||
|
|
||||||
// Override the id with the template id, for now we don't care about the
|
// Override the id with the template id, for now we don't care about the
|
||||||
// underlying templated class id
|
// underlying templated class id
|
||||||
c_ptr->set_id(cls->getID());
|
c_ptr->set_id(cls->getID());
|
||||||
@@ -715,6 +718,11 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type,
|
|||||||
find_relationships(type->getAsArrayTypeUnsafe()->getElementType(),
|
find_relationships(type->getAsArrayTypeUnsafe()->getElementType(),
|
||||||
relationships, relationship_t::kAggregation);
|
relationships, relationship_t::kAggregation);
|
||||||
}
|
}
|
||||||
|
else if (type->isEnumeralType()) {
|
||||||
|
relationships.emplace_back(
|
||||||
|
type->getAs<clang::EnumType>()->getDecl()->getID(),
|
||||||
|
relationship_hint);
|
||||||
|
}
|
||||||
else if (type->isRecordType()) {
|
else if (type->isRecordType()) {
|
||||||
if (type_name.find("std::shared_ptr") == 0)
|
if (type_name.find("std::shared_ptr") == 0)
|
||||||
relationship_hint = relationship_t::kAssociation;
|
relationship_hint = relationship_t::kAssociation;
|
||||||
@@ -842,15 +850,24 @@ void translation_unit_visitor::
|
|||||||
}
|
}
|
||||||
|
|
||||||
void translation_unit_visitor::add_relationships(class_ &c,
|
void translation_unit_visitor::add_relationships(class_ &c,
|
||||||
const found_relationships_t &relationships, access_t access,
|
const class_member &field, const found_relationships_t &relationships)
|
||||||
std::optional<std::string> label)
|
|
||||||
{
|
{
|
||||||
|
auto [decorator_rtype, decorator_rmult] = field.get_relationship();
|
||||||
|
|
||||||
for (const auto &[target, relationship_type] : relationships) {
|
for (const auto &[target, relationship_type] : relationships) {
|
||||||
if (relationship_type != relationship_t::kNone) {
|
if (relationship_type != relationship_t::kNone) {
|
||||||
relationship r{relationship_type, target};
|
relationship r{relationship_type, target};
|
||||||
if (label)
|
r.set_label(field.name());
|
||||||
r.set_label(label.value());
|
r.set_access(field.access());
|
||||||
r.set_access(access);
|
if (decorator_rtype != relationship_t::kNone) {
|
||||||
|
r.set_type(decorator_rtype);
|
||||||
|
auto mult = util::split(decorator_rmult, ":", false);
|
||||||
|
if (mult.size() == 2) {
|
||||||
|
r.set_multiplicity_source(mult[0]);
|
||||||
|
r.set_multiplicity_destination(mult[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r.set_style(field.style_spec());
|
||||||
|
|
||||||
LOG_DBG("Adding field relationship {} {} {} : {}", r.destination(),
|
LOG_DBG("Adding field relationship {} {} {} : {}", r.destination(),
|
||||||
clanguml::common::model::to_string(r.type()), c.full_name(),
|
clanguml::common::model::to_string(r.type()), c.full_name(),
|
||||||
@@ -887,9 +904,7 @@ void translation_unit_visitor::process_static_field(
|
|||||||
find_relationships(field_declaration.getType(), relationships,
|
find_relationships(field_declaration.getType(), relationships,
|
||||||
relationship_t::kAssociation);
|
relationship_t::kAssociation);
|
||||||
|
|
||||||
add_relationships(c, relationships,
|
add_relationships(c, field, relationships);
|
||||||
detail::access_specifier_to_access_t(field_declaration.getAccess()),
|
|
||||||
field_declaration.getNameAsString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.add_member(std::move(field));
|
c.add_member(std::move(field));
|
||||||
@@ -1017,7 +1032,17 @@ std::unique_ptr<class_> translation_unit_visitor::build_template_instantiation(
|
|||||||
|
|
||||||
for (const auto &arg : template_type) {
|
for (const auto &arg : template_type) {
|
||||||
const auto argument_kind = arg.getKind();
|
const auto argument_kind = arg.getKind();
|
||||||
if (argument_kind == clang::TemplateArgument::ArgKind::Type) {
|
|
||||||
|
if (argument_kind == clang::TemplateArgument::ArgKind::Template) {
|
||||||
|
template_parameter argument;
|
||||||
|
argument.is_template_parameter(true);
|
||||||
|
auto arg_name = arg.getAsTemplate()
|
||||||
|
.getAsTemplateDecl()
|
||||||
|
->getQualifiedNameAsString();
|
||||||
|
argument.set_type(arg_name);
|
||||||
|
template_instantiation.add_template(std::move(argument));
|
||||||
|
}
|
||||||
|
else if (argument_kind == clang::TemplateArgument::ArgKind::Type) {
|
||||||
template_parameter argument;
|
template_parameter argument;
|
||||||
argument.is_template_parameter(false);
|
argument.is_template_parameter(false);
|
||||||
|
|
||||||
@@ -1124,9 +1149,6 @@ void translation_unit_visitor::process_field(
|
|||||||
if (field.skip())
|
if (field.skip())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (field_name == "divider")
|
|
||||||
LOG_ERROR("EEEEEEEEEEEEEEEEEEEEEEE");
|
|
||||||
|
|
||||||
if (field_type->isPointerType()) {
|
if (field_type->isPointerType()) {
|
||||||
relationship_hint = relationship_t::kAssociation;
|
relationship_hint = relationship_t::kAssociation;
|
||||||
field_type = field_type->getPointeeType();
|
field_type = field_type->getPointeeType();
|
||||||
@@ -1139,9 +1161,12 @@ void translation_unit_visitor::process_field(
|
|||||||
field_type = field_type.getNonReferenceType();
|
field_type = field_type.getNonReferenceType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process field decorators
|
||||||
const auto *template_field_type =
|
const auto *template_field_type =
|
||||||
field_type->getAs<clang::TemplateSpecializationType>();
|
field_type->getAs<clang::TemplateSpecializationType>();
|
||||||
|
|
||||||
|
found_relationships_t relationships;
|
||||||
|
|
||||||
if (template_field_type != nullptr) {
|
if (template_field_type != nullptr) {
|
||||||
const auto template_field_decl_name =
|
const auto template_field_decl_name =
|
||||||
template_field_type->getTemplateName()
|
template_field_type->getTemplateName()
|
||||||
@@ -1151,48 +1176,25 @@ void translation_unit_visitor::process_field(
|
|||||||
auto template_specialization_ptr = build_template_instantiation(
|
auto template_specialization_ptr = build_template_instantiation(
|
||||||
*field_type->getAs<clang::TemplateSpecializationType>());
|
*field_type->getAs<clang::TemplateSpecializationType>());
|
||||||
|
|
||||||
if (diagram().should_include(template_field_decl_name)) {
|
if (template_specialization_ptr &&
|
||||||
relationship r{
|
diagram().should_include(template_field_decl_name)) {
|
||||||
relationship_hint, template_specialization_ptr->id()};
|
found_relationships_t::value_type r{
|
||||||
r.set_label(field_declaration.getNameAsString());
|
template_specialization_ptr->id(), relationship_hint};
|
||||||
r.set_access(detail::access_specifier_to_access_t(
|
|
||||||
field_declaration.getAccess()));
|
|
||||||
|
|
||||||
bool added =
|
bool added =
|
||||||
diagram().add_class(std::move(template_specialization_ptr));
|
diagram().add_class(std::move(template_specialization_ptr));
|
||||||
|
|
||||||
if (added)
|
if (added) {
|
||||||
LOG_DBG("ADDED TEMPLATE SPECIALIZATION TO DIAGRAM");
|
relationships.emplace_back(std::move(r));
|
||||||
else
|
|
||||||
LOG_ERROR("NOT ADDED ");
|
|
||||||
|
|
||||||
c.add_relationship(std::move(r));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!field.skip_relationship()) {
|
|
||||||
found_relationships_t relationships;
|
|
||||||
// find relationship for the type
|
|
||||||
find_relationships(
|
|
||||||
field_type, relationships, relationship_hint);
|
|
||||||
|
|
||||||
add_relationships(c, relationships,
|
|
||||||
detail::access_specifier_to_access_t(
|
|
||||||
field_declaration.getAccess()),
|
|
||||||
field_declaration.getNameAsString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (!field.skip_relationship()) {
|
|
||||||
found_relationships_t relationships;
|
|
||||||
// find relationship for the type
|
|
||||||
find_relationships(field_type, relationships, relationship_hint);
|
|
||||||
|
|
||||||
add_relationships(c, relationships,
|
if (!field.skip_relationship()) {
|
||||||
detail::access_specifier_to_access_t(
|
// find relationship for the type
|
||||||
field_declaration.getAccess()),
|
find_relationships(field_type, relationships, relationship_hint);
|
||||||
field_declaration.getNameAsString());
|
|
||||||
}
|
add_relationships(c, field, relationships);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.add_member(std::move(field));
|
c.add_member(std::move(field));
|
||||||
|
|||||||
@@ -113,9 +113,8 @@ private:
|
|||||||
clanguml::common::model::relationship_t relationship_hint);
|
clanguml::common::model::relationship_t relationship_hint);
|
||||||
|
|
||||||
void add_relationships(clanguml::class_diagram::model::class_ &c,
|
void add_relationships(clanguml::class_diagram::model::class_ &c,
|
||||||
const found_relationships_t &relationships,
|
const clanguml::class_diagram::model::class_member &field,
|
||||||
clanguml::common::model::access_t access,
|
const found_relationships_t &relationships);
|
||||||
std::optional<std::string> label);
|
|
||||||
|
|
||||||
void set_source_location(const clang::Decl &decl,
|
void set_source_location(const clang::Decl &decl,
|
||||||
clanguml::common::model::source_location &element);
|
clanguml::common::model::source_location &element);
|
||||||
@@ -138,13 +137,8 @@ private:
|
|||||||
decl.getASTContext().getRawCommentForDeclNoCache(&decl);
|
decl.getASTContext().getRawCommentForDeclNoCache(&decl);
|
||||||
|
|
||||||
if (comment != nullptr) {
|
if (comment != nullptr) {
|
||||||
e.set_comment(comment->getBriefText(decl.getASTContext()));
|
e.set_comment(comment->getFormattedText(
|
||||||
|
source_manager_, decl.getASTContext().getDiagnostics()));
|
||||||
// if (mf.location().has_value()) {
|
|
||||||
// e.set_file(mf.location().value().file);
|
|
||||||
// e.set_line(mf.location().value().line);
|
|
||||||
// }
|
|
||||||
|
|
||||||
e.add_decorators(decorators::parse(e.comment().value()));
|
e.add_decorators(decorators::parse(e.comment().value()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,193 +154,4 @@ private:
|
|||||||
// Reference to class diagram config
|
// Reference to class diagram config
|
||||||
const clanguml::config::class_diagram &config_;
|
const clanguml::config::class_diagram &config_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
class translation_unit_visitor {
|
|
||||||
public:
|
|
||||||
translation_unit_visitor(cppast::cpp_entity_index &idx,
|
|
||||||
clanguml::class_diagram::model::diagram &diagram,
|
|
||||||
const clanguml::config::class_diagram &config);
|
|
||||||
|
|
||||||
void operator()(const cppast::cpp_entity &file);
|
|
||||||
|
|
||||||
void process_class_declaration(const cppast::cpp_class &cls,
|
|
||||||
type_safe::optional_ref<const cppast::cpp_template_specialization>
|
|
||||||
tspec = nullptr);
|
|
||||||
|
|
||||||
void process_enum_declaration(const cppast::cpp_enum &enm);
|
|
||||||
|
|
||||||
void process_anonymous_enum(const cppast::cpp_enum &en,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_field(const cppast::cpp_member_variable &mv,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
bool process_field_with_template_instantiation(
|
|
||||||
const cppast::cpp_member_variable &mv, const cppast::cpp_type &type,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
clanguml::class_diagram::model::class_member &member,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_static_field(const cppast::cpp_variable &mv,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_method(const cppast::cpp_member_function &mf,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_template_method(const cppast::cpp_function_template &mf,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_static_method(const cppast::cpp_function &mf,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_constructor(const cppast::cpp_constructor &mf,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_destructor(const cppast::cpp_destructor &mf,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_function_parameter(const cppast::cpp_function_parameter
|
|
||||||
¶m, clanguml::class_diagram::model::class_method &m,
|
|
||||||
clanguml::class_diagram::model::class_ &c,
|
|
||||||
const std::set<std::string> &template_parameter_names = {});
|
|
||||||
|
|
||||||
bool find_relationships(const cppast::cpp_type &t,
|
|
||||||
found_relationships_t &relationships,
|
|
||||||
clanguml::common::model::relationship_t relationship_hint =
|
|
||||||
clanguml::common::model::relationship_t::kNone) const;
|
|
||||||
|
|
||||||
void process_template_type_parameter(
|
|
||||||
const cppast::cpp_template_type_parameter &t,
|
|
||||||
clanguml::class_diagram::model::class_ &parent);
|
|
||||||
|
|
||||||
void process_template_nontype_parameter(
|
|
||||||
const cppast::cpp_non_type_template_parameter &t,
|
|
||||||
clanguml::class_diagram::model::class_ &parent);
|
|
||||||
|
|
||||||
void process_template_template_parameter(
|
|
||||||
const cppast::cpp_template_template_parameter &t,
|
|
||||||
clanguml::class_diagram::model::class_ &parent);
|
|
||||||
|
|
||||||
void process_friend(const cppast::cpp_friend &t,
|
|
||||||
clanguml::class_diagram::model::class_ &parent,
|
|
||||||
cppast::cpp_access_specifier_kind as);
|
|
||||||
|
|
||||||
void process_namespace(const cppast::cpp_entity &e,
|
|
||||||
const cppast::cpp_namespace &ns_declaration);
|
|
||||||
|
|
||||||
void process_type_alias(const cppast::cpp_type_alias &ta);
|
|
||||||
|
|
||||||
void process_type_alias_template(const cppast::cpp_alias_template &at);
|
|
||||||
|
|
||||||
void process_class_children(const cppast::cpp_class &cls, model::class_
|
|
||||||
&c);
|
|
||||||
|
|
||||||
void process_class_bases(
|
|
||||||
const cppast::cpp_class &cls, model::class_ &c) const;
|
|
||||||
|
|
||||||
void process_unexposed_template_specialization_parameters(
|
|
||||||
const type_safe::optional_ref<const
|
|
||||||
cppast::cpp_template_specialization> &tspec, model::class_ &c) const;
|
|
||||||
|
|
||||||
void process_exposed_template_specialization_parameters(
|
|
||||||
const type_safe::optional_ref<const
|
|
||||||
cppast::cpp_template_specialization> &tspec, model::class_ &c);
|
|
||||||
|
|
||||||
void process_scope_template_parameters(
|
|
||||||
model::class_ &c, const cppast::cpp_scope_name &scope);
|
|
||||||
|
|
||||||
bool process_template_parameters(const cppast::cpp_class &cls,
|
|
||||||
model::class_ &c,
|
|
||||||
const type_safe::optional_ref<const
|
|
||||||
cppast::cpp_template_specialization> &tspec);
|
|
||||||
|
|
||||||
void process_class_containment(
|
|
||||||
const cppast::cpp_class &cls, model::class_ &c) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unique_ptr<clanguml::class_diagram::model::class_>
|
|
||||||
build_template_instantiation(
|
|
||||||
const cppast::cpp_template_instantiation_type &t,
|
|
||||||
std::optional<clanguml::class_diagram::model::class_ *> parent =
|
|
||||||
{});
|
|
||||||
|
|
||||||
const cppast::cpp_type &resolve_alias(const cppast::cpp_type &t);
|
|
||||||
|
|
||||||
const cppast::cpp_type &resolve_alias_template(
|
|
||||||
const cppast::cpp_type &type);
|
|
||||||
|
|
||||||
bool find_relationships_in_array(
|
|
||||||
found_relationships_t &relationships, const cppast::cpp_type &t)
|
|
||||||
const;
|
|
||||||
|
|
||||||
bool find_relationships_in_pointer(const cppast::cpp_type &t_,
|
|
||||||
found_relationships_t &relationships,
|
|
||||||
const common::model::relationship_t &relationship_hint) const;
|
|
||||||
|
|
||||||
bool find_relationships_in_reference(const cppast::cpp_type &t_,
|
|
||||||
found_relationships_t &relationships,
|
|
||||||
const common::model::relationship_t &relationship_hint) const;
|
|
||||||
|
|
||||||
bool find_relationships_in_user_defined_type(const cppast::cpp_type &t_,
|
|
||||||
found_relationships_t &relationships, const std::string &fn,
|
|
||||||
common::model::relationship_t &relationship_type,
|
|
||||||
const cppast::cpp_type &t) const;
|
|
||||||
|
|
||||||
bool find_relationships_in_template_instantiation(const cppast::cpp_type
|
|
||||||
&t, const std::string &fn, found_relationships_t &relationships,
|
|
||||||
common::model::relationship_t relationship_type) const;
|
|
||||||
|
|
||||||
bool find_relationships_in_unexposed_template_params(
|
|
||||||
const model::template_parameter &ct,
|
|
||||||
found_relationships_t &relationships) const;
|
|
||||||
|
|
||||||
void build_template_instantiation_primary_template(
|
|
||||||
const cppast::cpp_template_instantiation_type &t,
|
|
||||||
clanguml::class_diagram::model::class_ &tinst,
|
|
||||||
std::deque<std::tuple<std::string, int, bool>>
|
|
||||||
&template_base_params, std::optional<clanguml::class_diagram::model::class_
|
|
||||||
*> &parent, std::string &full_template_name) const;
|
|
||||||
|
|
||||||
void build_template_instantiation_process_type_argument(
|
|
||||||
const std::optional<clanguml::class_diagram::model::class_ *>
|
|
||||||
&parent, model::class_ &tinst, const cppast::cpp_type &targ_type,
|
|
||||||
class_diagram::model::template_parameter &ct);
|
|
||||||
|
|
||||||
void build_template_instantiation_process_expression_argument(
|
|
||||||
const cppast::cpp_template_argument &targ,
|
|
||||||
model::template_parameter &ct) const;
|
|
||||||
|
|
||||||
bool build_template_instantiation_add_base_classes(model::class_ &tinst,
|
|
||||||
std::deque<std::tuple<std::string, int, bool>>
|
|
||||||
&template_base_params, int arg_index, bool variadic_params, const
|
|
||||||
model::template_parameter &ct) const;
|
|
||||||
|
|
||||||
void process_function_parameter_find_relationships_in_template(
|
|
||||||
model::class_ &c, const std::set<std::string>
|
|
||||||
&template_parameter_names, const cppast::cpp_type &t);
|
|
||||||
|
|
||||||
// ctx allows to track current visitor context, e.g. current namespace
|
|
||||||
translation_unit_context ctx;
|
|
||||||
bool simplify_system_template(
|
|
||||||
model::template_parameter ¶meter, const std::string
|
|
||||||
&basicString);
|
|
||||||
|
|
||||||
bool add_nested_template_relationships(
|
|
||||||
const cppast::cpp_member_variable &mv, model::class_ &c,
|
|
||||||
model::class_member &m, cppast::cpp_access_specifier_kind &as,
|
|
||||||
const model::class_ &tinst,
|
|
||||||
common::model::relationship_t &relationship_type,
|
|
||||||
common::model::relationship_t &decorator_rtype,
|
|
||||||
std::string &decorator_rmult);
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ decorated_element::get_relationship() const
|
|||||||
return {relationship_t::kNone, ""};
|
return {relationship_t::kNone, ""};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string decorated_element::style_spec()
|
std::string decorated_element::style_spec() const
|
||||||
{
|
{
|
||||||
for (auto d : decorators_)
|
for (auto d : decorators_)
|
||||||
if (std::dynamic_pointer_cast<decorators::style>(d))
|
if (std::dynamic_pointer_cast<decorators::style>(d))
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
std::pair<relationship_t, std::string> get_relationship() const;
|
std::pair<relationship_t, std::string> get_relationship() const;
|
||||||
|
|
||||||
std::string style_spec();
|
std::string style_spec() const;
|
||||||
|
|
||||||
const std::vector<std::shared_ptr<decorators::decorator>> &
|
const std::vector<std::shared_ptr<decorators::decorator>> &
|
||||||
decorators() const;
|
decorators() const;
|
||||||
|
|||||||
@@ -4,17 +4,15 @@
|
|||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace t00030 {
|
namespace t00030 {
|
||||||
|
|
||||||
class A {
|
class A { };
|
||||||
};
|
|
||||||
|
|
||||||
class B {
|
class B { };
|
||||||
};
|
|
||||||
|
|
||||||
class C {
|
class C { };
|
||||||
};
|
|
||||||
|
|
||||||
class D {
|
class D { };
|
||||||
};
|
|
||||||
|
class E { };
|
||||||
|
|
||||||
struct R {
|
struct R {
|
||||||
/// @uml{association[]}
|
/// @uml{association[]}
|
||||||
@@ -28,6 +26,9 @@ struct R {
|
|||||||
|
|
||||||
/// @uml{association[:1]}
|
/// @uml{association[:1]}
|
||||||
D ddd;
|
D ddd;
|
||||||
|
|
||||||
|
/// @uml{aggregation[:1]}
|
||||||
|
E *eee;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace t00030
|
} // namespace t00030
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ TEST_CASE("t00030", "[test-case][class]")
|
|||||||
REQUIRE_THAT(puml, IsComposition(_A("R"), _A("B"), "+bbb", "0..1", "1..*"));
|
REQUIRE_THAT(puml, IsComposition(_A("R"), _A("B"), "+bbb", "0..1", "1..*"));
|
||||||
REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5"));
|
REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5"));
|
||||||
REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1"));
|
REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1"));
|
||||||
|
REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("E"), "+eee", "", "1"));
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00031", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00031_class");
|
REQUIRE(diagram->name == "t00031_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00031_class");
|
REQUIRE(model->name() == "t00031_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00031::A"));
|
REQUIRE(model->should_include("clanguml::t00031::A"));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00032", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00032_class");
|
REQUIRE(diagram->name == "t00032_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00032_class");
|
REQUIRE(model->name() == "t00032_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00032::A"));
|
REQUIRE(model->should_include("clanguml::t00032::A"));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00033", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00033_class");
|
REQUIRE(diagram->name == "t00033_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00033_class");
|
REQUIRE(model->name() == "t00033_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00033::A"));
|
REQUIRE(model->should_include("clanguml::t00033::A"));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00034", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00034_class");
|
REQUIRE(diagram->name == "t00034_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00034_class");
|
REQUIRE(model->name() == "t00034_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00034::A"));
|
REQUIRE(model->should_include("clanguml::t00034::A"));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00035", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00035_class");
|
REQUIRE(diagram->name == "t00035_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00035_class");
|
REQUIRE(model->name() == "t00035_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00035::A"));
|
REQUIRE(model->should_include("clanguml::t00035::A"));
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00036", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00036_class");
|
REQUIRE(diagram->name == "t00036_class");
|
||||||
REQUIRE(diagram->generate_packages() == true);
|
REQUIRE(diagram->generate_packages() == true);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00036_class");
|
REQUIRE(model->name() == "t00036_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00037", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00037_class");
|
REQUIRE(diagram->name == "t00037_class");
|
||||||
REQUIRE(diagram->generate_packages() == true);
|
REQUIRE(diagram->generate_packages() == true);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00037_class");
|
REQUIRE(model->name() == "t00037_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00038", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00038_class");
|
REQUIRE(diagram->name == "t00038_class");
|
||||||
REQUIRE(diagram->generate_packages() == false);
|
REQUIRE(diagram->generate_packages() == false);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00038_class");
|
REQUIRE(model->name() == "t00038_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00039", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00039_class");
|
REQUIRE(diagram->name == "t00039_class");
|
||||||
REQUIRE(diagram->generate_packages() == false);
|
REQUIRE(diagram->generate_packages() == false);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00039_class");
|
REQUIRE(model->name() == "t00039_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00040", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00040_class");
|
REQUIRE(diagram->name == "t00040_class");
|
||||||
REQUIRE(diagram->generate_packages() == false);
|
REQUIRE(diagram->generate_packages() == false);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00040_class");
|
REQUIRE(model->name() == "t00040_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00041", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00041_class");
|
REQUIRE(diagram->name == "t00041_class");
|
||||||
REQUIRE(diagram->generate_packages() == false);
|
REQUIRE(diagram->generate_packages() == false);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00041_class");
|
REQUIRE(model->name() == "t00041_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00042", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00042_class");
|
REQUIRE(diagram->name == "t00042_class");
|
||||||
REQUIRE(diagram->generate_packages() == false);
|
REQUIRE(diagram->generate_packages() == false);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00042_class");
|
REQUIRE(model->name() == "t00042_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00043", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00043_class");
|
REQUIRE(diagram->name == "t00043_class");
|
||||||
REQUIRE(diagram->generate_packages() == true);
|
REQUIRE(diagram->generate_packages() == true);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00043_class");
|
REQUIRE(model->name() == "t00043_class");
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ TEST_CASE("t00044", "[test-case][class]")
|
|||||||
REQUIRE(diagram->name == "t00044_class");
|
REQUIRE(diagram->name == "t00044_class");
|
||||||
REQUIRE(diagram->generate_packages() == true);
|
REQUIRE(diagram->generate_packages() == true);
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00044_class");
|
REQUIRE(model->name() == "t00044_class");
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00045", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00045_class");
|
REQUIRE(diagram->name == "t00045_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00045_class");
|
REQUIRE(model->name() == "t00045_class");
|
||||||
REQUIRE(model->should_include("clanguml::t00045::ns1::ns2::A"));
|
REQUIRE(model->should_include("clanguml::t00045::ns1::ns2::A"));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ TEST_CASE("t00046", "[test-case][class]")
|
|||||||
|
|
||||||
REQUIRE(diagram->name == "t00046_class");
|
REQUIRE(diagram->name == "t00046_class");
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(*db, diagram);
|
||||||
|
|
||||||
REQUIRE(model->name() == "t00046_class");
|
REQUIRE(model->name() == "t00046_class");
|
||||||
REQUIRE(model->should_include("ns1::ns2::A"));
|
REQUIRE(model->should_include("ns1::ns2::A"));
|
||||||
|
|||||||
@@ -219,23 +219,23 @@ using namespace clanguml::test::matchers;
|
|||||||
#include "t00028/test_case.h"
|
#include "t00028/test_case.h"
|
||||||
#include "t00029/test_case.h"
|
#include "t00029/test_case.h"
|
||||||
#include "t00030/test_case.h"
|
#include "t00030/test_case.h"
|
||||||
//#include "t00031/test_case.h"
|
#include "t00031/test_case.h"
|
||||||
//#include "t00032/test_case.h"
|
#include "t00032/test_case.h"
|
||||||
//#include "t00033/test_case.h"
|
#include "t00033/test_case.h"
|
||||||
//#include "t00034/test_case.h"
|
#include "t00034/test_case.h"
|
||||||
//#include "t00035/test_case.h"
|
#include "t00035/test_case.h"
|
||||||
//#include "t00036/test_case.h"
|
#include "t00036/test_case.h"
|
||||||
//#include "t00037/test_case.h"
|
#include "t00037/test_case.h"
|
||||||
//#include "t00038/test_case.h"
|
#include "t00038/test_case.h"
|
||||||
//#include "t00039/test_case.h"
|
#include "t00039/test_case.h"
|
||||||
//#include "t00040/test_case.h"
|
#include "t00040/test_case.h"
|
||||||
//#include "t00041/test_case.h"
|
#include "t00041/test_case.h"
|
||||||
//#include "t00042/test_case.h"
|
#include "t00042/test_case.h"
|
||||||
//#include "t00043/test_case.h"
|
#include "t00043/test_case.h"
|
||||||
//#include "t00044/test_case.h"
|
#include "t00044/test_case.h"
|
||||||
//#include "t00045/test_case.h"
|
#include "t00045/test_case.h"
|
||||||
//#include "t00046/test_case.h"
|
#include "t00046/test_case.h"
|
||||||
//
|
|
||||||
////
|
////
|
||||||
//// Sequence diagram tests
|
//// Sequence diagram tests
|
||||||
////
|
////
|
||||||
|
|||||||
Reference in New Issue
Block a user