From 1cf271fedf14a207d0d14dcbe4b7797505693f4d Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 24 Jul 2022 13:28:19 +0200 Subject: [PATCH] Fixed up to 33 --- .../visitor/translation_unit_visitor.cc | 94 ++++---- .../visitor/translation_unit_visitor.h | 203 +----------------- src/common/model/decorated_element.cc | 2 +- src/common/model/decorated_element.h | 2 +- tests/t00030/t00030.cc | 17 +- tests/t00030/test_case.h | 1 + tests/t00031/test_case.h | 2 +- tests/t00032/test_case.h | 2 +- tests/t00033/test_case.h | 2 +- tests/t00034/test_case.h | 2 +- tests/t00035/test_case.h | 2 +- tests/t00036/test_case.h | 2 +- tests/t00037/test_case.h | 2 +- tests/t00038/test_case.h | 2 +- tests/t00039/test_case.h | 2 +- tests/t00040/test_case.h | 2 +- tests/t00041/test_case.h | 2 +- tests/t00042/test_case.h | 2 +- tests/t00043/test_case.h | 2 +- tests/t00044/test_case.h | 2 +- tests/t00045/test_case.h | 2 +- tests/t00046/test_case.h | 2 +- tests/test_cases.cc | 34 +-- 23 files changed, 97 insertions(+), 288 deletions(-) diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index ba65bc34..640f5842 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -271,6 +271,9 @@ bool translation_unit_visitor::VisitClassTemplateDecl( 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 // underlying templated class id 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(), relationships, relationship_t::kAggregation); } + else if (type->isEnumeralType()) { + relationships.emplace_back( + type->getAs()->getDecl()->getID(), + relationship_hint); + } else if (type->isRecordType()) { if (type_name.find("std::shared_ptr") == 0) relationship_hint = relationship_t::kAssociation; @@ -842,15 +850,24 @@ void translation_unit_visitor:: } void translation_unit_visitor::add_relationships(class_ &c, - const found_relationships_t &relationships, access_t access, - std::optional label) + const class_member &field, const found_relationships_t &relationships) { + auto [decorator_rtype, decorator_rmult] = field.get_relationship(); + for (const auto &[target, relationship_type] : relationships) { if (relationship_type != relationship_t::kNone) { relationship r{relationship_type, target}; - if (label) - r.set_label(label.value()); - r.set_access(access); + r.set_label(field.name()); + r.set_access(field.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(), 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, relationship_t::kAssociation); - add_relationships(c, relationships, - detail::access_specifier_to_access_t(field_declaration.getAccess()), - field_declaration.getNameAsString()); + add_relationships(c, field, relationships); } c.add_member(std::move(field)); @@ -1017,7 +1032,17 @@ std::unique_ptr translation_unit_visitor::build_template_instantiation( for (const auto &arg : template_type) { 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; argument.is_template_parameter(false); @@ -1124,9 +1149,6 @@ void translation_unit_visitor::process_field( if (field.skip()) return; - if (field_name == "divider") - LOG_ERROR("EEEEEEEEEEEEEEEEEEEEEEE"); - if (field_type->isPointerType()) { relationship_hint = relationship_t::kAssociation; field_type = field_type->getPointeeType(); @@ -1139,9 +1161,12 @@ void translation_unit_visitor::process_field( field_type = field_type.getNonReferenceType(); } + // Process field decorators const auto *template_field_type = field_type->getAs(); + found_relationships_t relationships; + if (template_field_type != nullptr) { const auto template_field_decl_name = template_field_type->getTemplateName() @@ -1151,48 +1176,25 @@ void translation_unit_visitor::process_field( auto template_specialization_ptr = build_template_instantiation( *field_type->getAs()); - if (diagram().should_include(template_field_decl_name)) { - relationship r{ - relationship_hint, template_specialization_ptr->id()}; - r.set_label(field_declaration.getNameAsString()); - r.set_access(detail::access_specifier_to_access_t( - field_declaration.getAccess())); + if (template_specialization_ptr && + diagram().should_include(template_field_decl_name)) { + found_relationships_t::value_type r{ + template_specialization_ptr->id(), relationship_hint}; bool added = diagram().add_class(std::move(template_specialization_ptr)); - if (added) - LOG_DBG("ADDED TEMPLATE SPECIALIZATION TO DIAGRAM"); - 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()); + if (added) { + relationships.emplace_back(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()); - } + if (!field.skip_relationship()) { + // find relationship for the type + find_relationships(field_type, relationships, relationship_hint); + + add_relationships(c, field, relationships); } c.add_member(std::move(field)); diff --git a/src/class_diagram/visitor/translation_unit_visitor.h b/src/class_diagram/visitor/translation_unit_visitor.h index 54cbbdda..bd447f4b 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.h +++ b/src/class_diagram/visitor/translation_unit_visitor.h @@ -113,9 +113,8 @@ private: clanguml::common::model::relationship_t relationship_hint); void add_relationships(clanguml::class_diagram::model::class_ &c, - const found_relationships_t &relationships, - clanguml::common::model::access_t access, - std::optional label); + const clanguml::class_diagram::model::class_member &field, + const found_relationships_t &relationships); void set_source_location(const clang::Decl &decl, clanguml::common::model::source_location &element); @@ -138,13 +137,8 @@ private: decl.getASTContext().getRawCommentForDeclNoCache(&decl); if (comment != nullptr) { - e.set_comment(comment->getBriefText(decl.getASTContext())); - - // if (mf.location().has_value()) { - // e.set_file(mf.location().value().file); - // e.set_line(mf.location().value().line); - // } - + e.set_comment(comment->getFormattedText( + source_manager_, decl.getASTContext().getDiagnostics())); e.add_decorators(decorators::parse(e.comment().value())); } } @@ -160,193 +154,4 @@ private: // Reference to 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 - 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 &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 &tspec, model::class_ &c) const; - - void process_exposed_template_specialization_parameters( - const type_safe::optional_ref &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 &tspec); - - void process_class_containment( - const cppast::cpp_class &cls, model::class_ &c) const; - -private: - std::unique_ptr - build_template_instantiation( - const cppast::cpp_template_instantiation_type &t, - std::optional 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> -&template_base_params, std::optional &parent, std::string &full_template_name) const; - - void build_template_instantiation_process_type_argument( - const std::optional -&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> -&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 -&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); -}; - */ } diff --git a/src/common/model/decorated_element.cc b/src/common/model/decorated_element.cc index 31888721..f33d7226 100644 --- a/src/common/model/decorated_element.cc +++ b/src/common/model/decorated_element.cc @@ -58,7 +58,7 @@ decorated_element::get_relationship() const return {relationship_t::kNone, ""}; } -std::string decorated_element::style_spec() +std::string decorated_element::style_spec() const { for (auto d : decorators_) if (std::dynamic_pointer_cast(d)) diff --git a/src/common/model/decorated_element.h b/src/common/model/decorated_element.h index 1865b05e..05fdd92c 100644 --- a/src/common/model/decorated_element.h +++ b/src/common/model/decorated_element.h @@ -36,7 +36,7 @@ public: std::pair get_relationship() const; - std::string style_spec(); + std::string style_spec() const; const std::vector> & decorators() const; diff --git a/tests/t00030/t00030.cc b/tests/t00030/t00030.cc index cd873e4a..0193421e 100644 --- a/tests/t00030/t00030.cc +++ b/tests/t00030/t00030.cc @@ -4,17 +4,15 @@ namespace clanguml { namespace t00030 { -class A { -}; +class A { }; -class B { -}; +class B { }; -class C { -}; +class C { }; -class D { -}; +class D { }; + +class E { }; struct R { /// @uml{association[]} @@ -28,6 +26,9 @@ struct R { /// @uml{association[:1]} D ddd; + + /// @uml{aggregation[:1]} + E *eee; }; } // namespace t00030 diff --git a/tests/t00030/test_case.h b/tests/t00030/test_case.h index df899524..df353c21 100644 --- a/tests/t00030/test_case.h +++ b/tests/t00030/test_case.h @@ -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, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5")); REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1")); + REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("E"), "+eee", "", "1")); save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); diff --git a/tests/t00031/test_case.h b/tests/t00031/test_case.h index 338c1b90..d53ae8e6 100644 --- a/tests/t00031/test_case.h +++ b/tests/t00031/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00031", "[test-case][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->should_include("clanguml::t00031::A")); diff --git a/tests/t00032/test_case.h b/tests/t00032/test_case.h index 28baa3de..af2b1295 100644 --- a/tests/t00032/test_case.h +++ b/tests/t00032/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00032", "[test-case][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->should_include("clanguml::t00032::A")); diff --git a/tests/t00033/test_case.h b/tests/t00033/test_case.h index f65c1c8d..c195981d 100644 --- a/tests/t00033/test_case.h +++ b/tests/t00033/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00033", "[test-case][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->should_include("clanguml::t00033::A")); diff --git a/tests/t00034/test_case.h b/tests/t00034/test_case.h index 44a64a88..395668e3 100644 --- a/tests/t00034/test_case.h +++ b/tests/t00034/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00034", "[test-case][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->should_include("clanguml::t00034::A")); diff --git a/tests/t00035/test_case.h b/tests/t00035/test_case.h index 8a0c3694..faf01d48 100644 --- a/tests/t00035/test_case.h +++ b/tests/t00035/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00035", "[test-case][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->should_include("clanguml::t00035::A")); diff --git a/tests/t00036/test_case.h b/tests/t00036/test_case.h index 30393389..ccd1ec14 100644 --- a/tests/t00036/test_case.h +++ b/tests/t00036/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00036", "[test-case][class]") REQUIRE(diagram->name == "t00036_class"); REQUIRE(diagram->generate_packages() == true); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00036_class"); diff --git a/tests/t00037/test_case.h b/tests/t00037/test_case.h index 46b74998..f722aac2 100644 --- a/tests/t00037/test_case.h +++ b/tests/t00037/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00037", "[test-case][class]") REQUIRE(diagram->name == "t00037_class"); REQUIRE(diagram->generate_packages() == true); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00037_class"); diff --git a/tests/t00038/test_case.h b/tests/t00038/test_case.h index 992d94b4..59211c89 100644 --- a/tests/t00038/test_case.h +++ b/tests/t00038/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00038", "[test-case][class]") REQUIRE(diagram->name == "t00038_class"); REQUIRE(diagram->generate_packages() == false); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00038_class"); diff --git a/tests/t00039/test_case.h b/tests/t00039/test_case.h index a134fae7..7d7e8cbf 100644 --- a/tests/t00039/test_case.h +++ b/tests/t00039/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00039", "[test-case][class]") REQUIRE(diagram->name == "t00039_class"); REQUIRE(diagram->generate_packages() == false); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00039_class"); diff --git a/tests/t00040/test_case.h b/tests/t00040/test_case.h index 1019a385..bcc75cba 100644 --- a/tests/t00040/test_case.h +++ b/tests/t00040/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00040", "[test-case][class]") REQUIRE(diagram->name == "t00040_class"); REQUIRE(diagram->generate_packages() == false); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00040_class"); diff --git a/tests/t00041/test_case.h b/tests/t00041/test_case.h index a4fbb4b1..04e77038 100644 --- a/tests/t00041/test_case.h +++ b/tests/t00041/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00041", "[test-case][class]") REQUIRE(diagram->name == "t00041_class"); REQUIRE(diagram->generate_packages() == false); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00041_class"); diff --git a/tests/t00042/test_case.h b/tests/t00042/test_case.h index 51c8e7a7..1422b761 100644 --- a/tests/t00042/test_case.h +++ b/tests/t00042/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00042", "[test-case][class]") REQUIRE(diagram->name == "t00042_class"); REQUIRE(diagram->generate_packages() == false); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00042_class"); diff --git a/tests/t00043/test_case.h b/tests/t00043/test_case.h index 8ccca644..c90d6bc6 100644 --- a/tests/t00043/test_case.h +++ b/tests/t00043/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00043", "[test-case][class]") REQUIRE(diagram->name == "t00043_class"); REQUIRE(diagram->generate_packages() == true); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00043_class"); diff --git a/tests/t00044/test_case.h b/tests/t00044/test_case.h index 26b4fa16..a53c25b5 100644 --- a/tests/t00044/test_case.h +++ b/tests/t00044/test_case.h @@ -25,7 +25,7 @@ TEST_CASE("t00044", "[test-case][class]") REQUIRE(diagram->name == "t00044_class"); REQUIRE(diagram->generate_packages() == true); - auto model = generate_class_diagram(db, diagram); + auto model = generate_class_diagram(*db, diagram); REQUIRE(model->name() == "t00044_class"); diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h index 30a7351c..c43d53cd 100644 --- a/tests/t00045/test_case.h +++ b/tests/t00045/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00045", "[test-case][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->should_include("clanguml::t00045::ns1::ns2::A")); diff --git a/tests/t00046/test_case.h b/tests/t00046/test_case.h index 73079f35..6806fec9 100644 --- a/tests/t00046/test_case.h +++ b/tests/t00046/test_case.h @@ -24,7 +24,7 @@ TEST_CASE("t00046", "[test-case][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->should_include("ns1::ns2::A")); diff --git a/tests/test_cases.cc b/tests/test_cases.cc index eec1f642..1e2da059 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -219,23 +219,23 @@ using namespace clanguml::test::matchers; #include "t00028/test_case.h" #include "t00029/test_case.h" #include "t00030/test_case.h" -//#include "t00031/test_case.h" -//#include "t00032/test_case.h" -//#include "t00033/test_case.h" -//#include "t00034/test_case.h" -//#include "t00035/test_case.h" -//#include "t00036/test_case.h" -//#include "t00037/test_case.h" -//#include "t00038/test_case.h" -//#include "t00039/test_case.h" -//#include "t00040/test_case.h" -//#include "t00041/test_case.h" -//#include "t00042/test_case.h" -//#include "t00043/test_case.h" -//#include "t00044/test_case.h" -//#include "t00045/test_case.h" -//#include "t00046/test_case.h" -// +#include "t00031/test_case.h" +#include "t00032/test_case.h" +#include "t00033/test_case.h" +#include "t00034/test_case.h" +#include "t00035/test_case.h" +#include "t00036/test_case.h" +#include "t00037/test_case.h" +#include "t00038/test_case.h" +#include "t00039/test_case.h" +#include "t00040/test_case.h" +#include "t00041/test_case.h" +#include "t00042/test_case.h" +#include "t00043/test_case.h" +#include "t00044/test_case.h" +#include "t00045/test_case.h" +#include "t00046/test_case.h" + //// //// Sequence diagram tests ////