From c82002e8ee17ec003c0e97992174e56047994e0d Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 17:48:57 +0200 Subject: [PATCH 01/16] Fixed root namespace handling --- .../plantuml/class_diagram_generator.cc | 14 ++++++++++++-- .../visitor/translation_unit_visitor.cc | 18 ++++++++++-------- src/common/model/path.h | 18 +++++++++++++++--- src/common/model/source_file.h | 2 +- src/config/config.cc | 8 ++++---- src/cx/util.cc | 2 ++ .../plantuml/package_diagram_generator.cc | 4 ++-- src/util/util.cc | 9 ++++++--- src/util/util.h | 4 +++- 9 files changed, 55 insertions(+), 24 deletions(-) diff --git a/src/class_diagram/generators/plantuml/class_diagram_generator.cc b/src/class_diagram/generators/plantuml/class_diagram_generator.cc index ff458769..b0922237 100644 --- a/src/class_diagram/generators/plantuml/class_diagram_generator.cc +++ b/src/class_diagram/generators/plantuml/class_diagram_generator.cc @@ -184,6 +184,11 @@ void generator::generate(const class_ &c, std::ostream &ostr) const try { destination = r.destination(); + // TODO: Refactor destination to a namespace qualified entity + // name + if (util::starts_with(destination, std::string{"::"})) + destination = destination.substr(2, destination.size()); + LOG_DBG("=== Destination is: {}", destination); std::string puml_relation; @@ -263,6 +268,11 @@ void generator::generate_relationships( try { destination = r.destination(); + // TODO: Refactor destination to a namespace qualified entity + // name + if (util::starts_with(destination, std::string{"::"})) + destination = destination.substr(2, destination.size()); + LOG_DBG("=== Destination is: {}", destination); std::string puml_relation; @@ -402,7 +412,7 @@ void generator::generate(const package &p, std::ostream &ostr) const // Don't generate packages from namespaces filtered out by // using_namespace - if (!uns.starts_with(p.full_name(false))) { + if (!uns.starts_with({p.full_name(false)})) { ostr << "package [" << p.name() << "] "; ostr << "as " << p.alias(); @@ -440,7 +450,7 @@ void generator::generate(const package &p, std::ostream &ostr) const if (m_config.generate_packages()) { // Don't generate packages from namespaces filtered out by // using_namespace - if (!uns.starts_with(p.full_name(false))) { + if (!uns.starts_with({p.full_name(false)})) { ostr << "}" << '\n'; } } diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 1573a2f8..f52f3544 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -594,12 +594,12 @@ void translation_unit_visitor::process_class_bases( { for (auto &base : cls.bases()) { class_parent cp; - auto base_ns = common::model::namespace_{ - cx::util::ns(base.type(), ctx.entity_index())}; + auto ns = cx::util::ns(base.type(), ctx.entity_index()); + common::model::namespace_ base_ns; + if(!ns.empty()) + base_ns = common::model::namespace_{ns}; base_ns = base_ns | common::model::namespace_{base.name()}.name(); - cp.set_name( - // base_ns.relative_to(ctx.config().using_namespace()).to_string()); - base_ns.to_string()); + cp.set_name(base_ns.to_string()); cp.is_virtual(base.is_virtual()); switch (base.access_specifier()) { @@ -758,7 +758,7 @@ bool translation_unit_visitor::process_field_with_template_instantiation( auto [decorator_rtype, decorator_rmult] = member.get_relationship(); if (decorator_rtype != relationship_t::kNone) { rr.set_type(decorator_rtype); - auto mult = util::split(decorator_rmult, ":"); + auto mult = util::split(decorator_rmult, ":", false); if (mult.size() == 2) { rr.set_multiplicity_source(mult[0]); rr.set_multiplicity_destination(mult[1]); @@ -811,6 +811,8 @@ bool translation_unit_visitor::add_nested_template_relationships( template_argument.find_nested_relationships(nested_relationships, relationship_type, [&d = ctx.diagram()](const std::string &full_name) { + if(full_name.empty()) + return false; auto [ns, name] = cx::util::split_ns(full_name); return d.should_include(ns, name); }); @@ -823,7 +825,7 @@ bool translation_unit_visitor::add_nested_template_relationships( nested_relationship.set_style(m.style_spec()); if (decorator_rtype != relationship_t::kNone) { nested_relationship.set_type(decorator_rtype); - auto mult = util::split(decorator_rmult, ":"); + auto mult = util::split(decorator_rmult, ":", false); if (mult.size() == 2) { nested_relationship.set_multiplicity_source(mult[0]); nested_relationship.set_multiplicity_destination(mult[1]); @@ -914,7 +916,7 @@ void translation_unit_visitor::process_field( auto [decorator_rtype, decorator_rmult] = m.get_relationship(); if (decorator_rtype != relationship_t::kNone) { r.set_type(decorator_rtype); - auto mult = util::split(decorator_rmult, ":"); + auto mult = util::split(decorator_rmult, ":", false); if (mult.size() == 2) { r.set_multiplicity_source(mult[0]); r.set_multiplicity_destination(mult[1]); diff --git a/src/common/model/path.h b/src/common/model/path.h index c447f384..912d66f5 100644 --- a/src/common/model/path.h +++ b/src/common/model/path.h @@ -31,7 +31,13 @@ public: path() = default; - path(const std::string &ns) { path_ = util::split(ns, Sep::value); } + explicit path(const std::string &ns) + { + if (ns.empty()) + return; + + path_ = util::split(ns, Sep::value); + } path(container_type::const_iterator begin, container_type::const_iterator end) @@ -49,16 +55,22 @@ public: path(std::initializer_list ns) { - if ((ns.size() == 1) && util::contains(*ns.begin(), Sep::value)) + if ((ns.size() == 1) && util::contains(*ns.begin(), Sep::value)) { path_ = util::split(*ns.begin(), Sep::value); + } + else if ((ns.size() == 1) && ns.begin()->empty()) { + } else path_ = ns; } explicit path(const std::vector &ns) { - if ((ns.size() == 1) && util::contains(*ns.begin(), Sep::value)) + if ((ns.size() == 1) && util::contains(*ns.begin(), Sep::value)) { path_ = util::split(*ns.begin(), Sep::value); + } + else if ((ns.size() == 1) && ns.begin()->empty()) { + } else path_ = ns; } diff --git a/src/common/model/source_file.h b/src/common/model/source_file.h index af34ff55..be99de07 100644 --- a/src/common/model/source_file.h +++ b/src/common/model/source_file.h @@ -52,7 +52,7 @@ public: source_file(const std::filesystem::path &p) { - set_path(p.parent_path().string()); + set_path({p.parent_path().string()}); set_name(p.filename()); is_absolute_ = p.is_absolute(); } diff --git a/src/config/config.cc b/src/config/config.cc index bbdeacb7..3b0a8457 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -215,10 +215,10 @@ void get_option(const Node &node, { if (node[option.name]) { if (node[option.name].Type() == NodeType::Scalar) - option.set(node[option.name].template as()); + option.set({node[option.name].template as()}); else if (node[option.name].Type() == NodeType::Sequence) - option.set( - node[option.name].template as>()[0]); + option.set({ + node[option.name].template as>()[0]}); else throw std::runtime_error("Invalid using_namespace value"); } @@ -406,7 +406,7 @@ template <> struct convert { auto namespace_list = node["namespaces"].as>(); for (const auto &ns : namespace_list) - rhs.namespaces.push_back(ns); + rhs.namespaces.push_back({ns}); } if (node["relationships"]) diff --git a/src/cx/util.cc b/src/cx/util.cc index 8cb0f785..1b069205 100644 --- a/src/cx/util.cc +++ b/src/cx/util.cc @@ -129,6 +129,8 @@ bool is_inside_class(const cppast::cpp_entity &e) std::pair split_ns( const std::string &full_name) { + assert(!full_name.empty()); + auto name_before_template = ::clanguml::util::split(full_name, "<")[0]; auto ns = common::model::namespace_{ ::clanguml::util::split(name_before_template, "::")}; diff --git a/src/package_diagram/generators/plantuml/package_diagram_generator.cc b/src/package_diagram/generators/plantuml/package_diagram_generator.cc index b99640c1..38c2bd55 100644 --- a/src/package_diagram/generators/plantuml/package_diagram_generator.cc +++ b/src/package_diagram/generators/plantuml/package_diagram_generator.cc @@ -67,7 +67,7 @@ void generator::generate(const package &p, std::ostream &ostr) const // Don't generate packages from namespaces filtered out by // using_namespace - if (!uns.starts_with(p.full_name(false))) { + if (!uns.starts_with({p.full_name(false)})) { ostr << "package [" << p.name() << "] "; ostr << "as " << p.alias(); @@ -89,7 +89,7 @@ void generator::generate(const package &p, std::ostream &ostr) const generate(dynamic_cast(*subpackage), ostr); } - if (!uns.starts_with(p.full_name(false))) { + if (!uns.starts_with({p.full_name(false)})) { ostr << "}" << '\n'; } diff --git a/src/util/util.cc b/src/util/util.cc index cefa989f..6e40d347 100644 --- a/src/util/util.cc +++ b/src/util/util.cc @@ -136,7 +136,8 @@ std::string rtrim(const std::string &s) std::string trim(const std::string &s) { return rtrim(ltrim(s)); } -std::vector split(std::string str, std::string_view delimiter) +std::vector split( + std::string str, std::string_view delimiter, bool skip_empty) { std::vector result; @@ -146,11 +147,13 @@ std::vector split(std::string str, std::string_view delimiter) while (str.size()) { auto index = str.find(delimiter); if (index != std::string::npos) { - result.push_back(str.substr(0, index)); + auto tok = str.substr(0, index); + if (!tok.empty() || !skip_empty) + result.push_back(std::move(tok)); str = str.substr(index + delimiter.size()); } else { - if (!str.empty()) + if (!str.empty() || !skip_empty) result.push_back(str); str = ""; } diff --git a/src/util/util.h b/src/util/util.h index b01e17f8..0c6cbe2d 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -83,10 +83,12 @@ std::string get_git_toplevel_dir(); * * @param str String to split * @param delimiter Delimiter string + * @param skip_empty Skip empty toks between delimiters if true * * @return Vector of string tokens. */ -std::vector split(std::string str, std::string_view delimiter); +std::vector split( + std::string str, std::string_view delimiter, bool skip_empty = true); std::string join( const std::vector &toks, std::string_view delimiter); From 87d381f52a67d8ef2de119e3f5a211d44c7f52ff Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 17:53:42 +0200 Subject: [PATCH 02/16] Added root namespace test case --- tests/t00045/.clang-uml | 10 +++++++ tests/t00045/t00045.cc | 31 ++++++++++++++++++++ tests/t00045/test_case.h | 63 ++++++++++++++++++++++++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ tests/test_util.cc | 5 ++++ 6 files changed, 113 insertions(+) create mode 100644 tests/t00045/.clang-uml create mode 100644 tests/t00045/t00045.cc create mode 100644 tests/t00045/test_case.h diff --git a/tests/t00045/.clang-uml b/tests/t00045/.clang-uml new file mode 100644 index 00000000..84b35cfc --- /dev/null +++ b/tests/t00045/.clang-uml @@ -0,0 +1,10 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t00045_class: + type: class + glob: + - ../../tests/t00045/t00045.cc + exclude: + namespaces: + - std \ No newline at end of file diff --git a/tests/t00045/t00045.cc b/tests/t00045/t00045.cc new file mode 100644 index 00000000..aa3ed0ac --- /dev/null +++ b/tests/t00045/t00045.cc @@ -0,0 +1,31 @@ +class A { }; + +class AA { }; + +namespace ns1 { + +class A { }; + +namespace ns2 { + +class A { }; + +class B : public A { }; + +class C : public ns1::A { }; + +class D : public ns1::ns2::A { }; + +class E : public ::A { }; + +class R { +public: + A *a; + ns1::A *ns1_a; + ns1::ns2::A *ns1_ns2_a; + ::A *root_a; + + void foo(::AA &aa) { (void)aa; } +}; +} +} diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h new file mode 100644 index 00000000..e7087fb9 --- /dev/null +++ b/tests/t00045/test_case.h @@ -0,0 +1,63 @@ +/** + * tests/t00045/test_case.cc + * + * Copyright (c) 2021-2022 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +TEST_CASE("t00045", "[test-case][class]") +{ + auto [config, db] = load_config("t00045"); + + auto diagram = config.diagrams["t00045_class"]; + + REQUIRE(diagram->name == "t00045_class"); + + auto model = generate_class_diagram(db, diagram); + + REQUIRE(model->name() == "t00045_class"); + REQUIRE(model->should_include("clanguml::t00045::ns1::ns2::A")); + + auto puml = generate_class_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(puml, IsClass(_A("A"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::A"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::A"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::B"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::C"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::D"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::E"))); + REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::R"))); + + REQUIRE_THAT(puml, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::B"))); + REQUIRE_THAT(puml, IsBaseClass(_A("ns1::A"), _A("ns1::ns2::C"))); + REQUIRE_THAT(puml, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::D"))); + REQUIRE_THAT(puml, IsBaseClass(_A("A"), _A("ns1::ns2::E"))); + + REQUIRE_THAT( + puml, IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+a")); + REQUIRE_THAT( + puml, IsAssociation(_A("ns1::ns2::R"), _A("ns1::A"), "+ns1_a")); + REQUIRE_THAT(puml, + IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+ns1_ns2_a")); + REQUIRE_THAT(puml, IsAssociation(_A("ns1::ns2::R"), _A("A"), "+root_a")); + + REQUIRE_THAT(puml, IsDependency(_A("ns1::ns2::R"), _A("AA"))); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 6abba504..29905b03 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -226,6 +226,7 @@ using namespace clanguml::test::matchers; #include "t00042/test_case.h" #include "t00043/test_case.h" #include "t00044/test_case.h" +#include "t00045/test_case.h" // // Sequence diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 883cc402..23a7d068 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -129,6 +129,9 @@ test_cases: - name: t00044 title: Test case for inner type aliases with parent class template args description: + - name: t00045 + title: Test case for root namespace handling + description: Sequence diagrams: - name: t20001 title: Basic sequence diagram test case diff --git a/tests/test_util.cc b/tests/test_util.cc index 01bede11..b5862d9e 100644 --- a/tests/test_util.cc +++ b/tests/test_util.cc @@ -33,6 +33,11 @@ TEST_CASE("Test split", "[unit-test]") CHECK(split("", " ") == C{""}); CHECK(split("ABCD", " ") == C{"ABCD"}); + CHECK(split("::A", "::") == C{"A"}); + CHECK(split("::", "::") == C{}); + CHECK(split("A::", "::") == C{"A"}); + CHECK(split(":1", ":") == C{"1"}); + CHECK(split(":1", ":", false) == C{"", "1"}); CHECK(split("std::vector::detail", "::") == C{"std", "vector", "detail"}); From 01a93211bbdc66f2440d455a709c80e3b8e0531f Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 17:56:26 +0200 Subject: [PATCH 03/16] Fixed formatting --- .../visitor/translation_unit_visitor.cc | 4 ++-- src/config/config.cc | 4 ++-- tests/t00045/t00045.cc | 24 ++++++++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index f52f3544..0bdb8499 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -596,7 +596,7 @@ void translation_unit_visitor::process_class_bases( class_parent cp; auto ns = cx::util::ns(base.type(), ctx.entity_index()); common::model::namespace_ base_ns; - if(!ns.empty()) + if (!ns.empty()) base_ns = common::model::namespace_{ns}; base_ns = base_ns | common::model::namespace_{base.name()}.name(); cp.set_name(base_ns.to_string()); @@ -811,7 +811,7 @@ bool translation_unit_visitor::add_nested_template_relationships( template_argument.find_nested_relationships(nested_relationships, relationship_type, [&d = ctx.diagram()](const std::string &full_name) { - if(full_name.empty()) + if (full_name.empty()) return false; auto [ns, name] = cx::util::split_ns(full_name); return d.should_include(ns, name); diff --git a/src/config/config.cc b/src/config/config.cc index 3b0a8457..85041d43 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -217,8 +217,8 @@ void get_option(const Node &node, if (node[option.name].Type() == NodeType::Scalar) option.set({node[option.name].template as()}); else if (node[option.name].Type() == NodeType::Sequence) - option.set({ - node[option.name].template as>()[0]}); + option.set( + {node[option.name].template as>()[0]}); else throw std::runtime_error("Invalid using_namespace value"); } diff --git a/tests/t00045/t00045.cc b/tests/t00045/t00045.cc index aa3ed0ac..3d8da7c2 100644 --- a/tests/t00045/t00045.cc +++ b/tests/t00045/t00045.cc @@ -1,22 +1,30 @@ -class A { }; +class A { +}; -class AA { }; +class AA { +}; namespace ns1 { -class A { }; +class A { +}; namespace ns2 { -class A { }; +class A { +}; -class B : public A { }; +class B : public A { +}; -class C : public ns1::A { }; +class C : public ns1::A { +}; -class D : public ns1::ns2::A { }; +class D : public ns1::ns2::A { +}; -class E : public ::A { }; +class E : public ::A { +}; class R { public: From 4035cbbb2f22c9783d5626d07f194fe91dc36cd9 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 18:14:58 +0200 Subject: [PATCH 04/16] Updated test cases documentation --- docs/test_cases.md | 1 + docs/test_cases/t00002_class.svg | 74 ++++++------ docs/test_cases/t00003_class.svg | 110 ++++++++--------- docs/test_cases/t00004_class.svg | 32 ++--- docs/test_cases/t00005_class.svg | 132 ++++++++++----------- docs/test_cases/t00006_class.svg | 168 +++++++++++++------------- docs/test_cases/t00007_class.svg | 36 +++--- docs/test_cases/t00008_class.svg | 68 +++++------ docs/test_cases/t00009_class.svg | 44 +++---- docs/test_cases/t00010_class.svg | 42 +++---- docs/test_cases/t00011_class.svg | 34 +++--- docs/test_cases/t00012.md | 2 +- docs/test_cases/t00012_class.svg | 112 +++++++++--------- docs/test_cases/t00013_class.svg | 160 ++++++++++++------------- docs/test_cases/t00014_class.svg | 182 ++++++++++++++--------------- docs/test_cases/t00015_class.svg | 28 ++--- docs/test_cases/t00016_class.svg | 30 ++--- docs/test_cases/t00017_class.svg | 100 ++++++++-------- docs/test_cases/t00018_class.svg | 72 ++++++------ docs/test_cases/t00019_class.svg | 106 ++++++++--------- docs/test_cases/t00020_class.svg | 114 +++++++++--------- docs/test_cases/t00021_class.svg | 114 +++++++++--------- docs/test_cases/t00022_class.svg | 46 ++++---- docs/test_cases/t00023_class.svg | 64 +++++----- docs/test_cases/t00024_class.svg | 72 ++++++------ docs/test_cases/t00025_class.svg | 74 ++++++------ docs/test_cases/t00026_class.svg | 92 +++++++-------- docs/test_cases/t00027_class.svg | 106 ++++++++--------- docs/test_cases/t00028_class.svg | 116 +++++++++--------- docs/test_cases/t00029_class.svg | 54 ++++----- docs/test_cases/t00030_class.svg | 46 ++++---- docs/test_cases/t00031_class.svg | 60 +++++----- docs/test_cases/t00032_class.svg | 74 ++++++------ docs/test_cases/t00033_class.svg | 62 +++++----- docs/test_cases/t00034_class.svg | 54 ++++----- docs/test_cases/t00035_class.svg | 22 ++-- docs/test_cases/t00036_class.svg | 42 +++---- docs/test_cases/t00037_class.svg | 46 ++++---- docs/test_cases/t00038_class.svg | 80 ++++++------- docs/test_cases/t00039_class.svg | 104 ++++++++--------- docs/test_cases/t00040_class.svg | 42 +++---- docs/test_cases/t00041_class.svg | 64 +++++----- docs/test_cases/t00042_class.svg | 22 ++-- docs/test_cases/t00043_class.svg | 110 ++++++++--------- docs/test_cases/t00044_class.svg | 28 ++--- docs/test_cases/t00045.md | 60 ++++++++++ docs/test_cases/t00045_class.svg | 145 +++++++++++++++++++++++ docs/test_cases/t30001_package.svg | 54 ++++----- docs/test_cases/t30002_package.svg | 112 +++++++++--------- docs/test_cases/t30003_package.svg | 28 ++--- docs/test_cases/t30004_package.svg | 38 +++--- docs/test_cases/t30005_package.svg | 42 +++---- docs/test_cases/t30006_package.svg | 22 ++-- docs/test_cases/t30007_package.svg | 26 ++--- docs/test_cases/t30008_package.svg | 42 +++---- docs/test_cases/t40001_include.svg | 46 ++++---- docs/test_cases/t40002_include.svg | 44 +++---- docs/test_cases/t40003_include.svg | 66 +++++------ 58 files changed, 2086 insertions(+), 1880 deletions(-) create mode 100644 docs/test_cases/t00045.md create mode 100644 docs/test_cases/t00045_class.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index 79077068..a28e7d89 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -43,6 +43,7 @@ * [t00042](./test_cases/t00042.md) - Specialization class template diagram filter test * [t00043](./test_cases/t00043.md) - Dependants and dependencies class diagram filter test * [t00044](./test_cases/t00044.md) - Test case for inner type aliases with parent class template args + * [t00045](./test_cases/t00045.md) - Test case for root namespace handling ## Sequence diagrams * [t20001](./test_cases/t20001.md) - Basic sequence diagram test case * [t20002](./test_cases/t20002.md) - Free function sequence diagram test case diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index c54ad046..0dc8893e 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,123 +9,123 @@ - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - - + + E - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - + This is class A - + This is class B - + This is class D which is a little like B @@ -142,13 +142,13 @@ - + as - + - + diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index 38952b2f..3d6f1a8f 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,194 +9,194 @@ - - + + A - + - + public_member : int - + - + static_int : int - + - + static_const_int : int const - + - + auto_member : unsigned long const - + - + protected_member : int - + - + private_member : int - + - + a : int - + - + b : int - + - + c : int - + - + A() : void - + - + A(int i) : void - + - + A(A&& ) : void - + - + A(A const& ) : void - + - + ~A() : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + double_int(int const i) : int - + - + sum(double const a, double const b) : double - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool(int const)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 58f80627..d843df8a 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,38 +9,38 @@ - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + AA - - + + Lights @@ -50,23 +50,23 @@ Red - - + + AAA - + - + - + diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 05bb9403..7e18e27a 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,238 +9,238 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - + a : A - + - + b : B* - + - + c : C& - + - + d : D const* - + - + e : E const& - + - + f : F&& - + - + g : G** - + - + h : H*** - + - + i : I*& - + - + j : J volatile* - + - + k : K* - + +a - + +b - + +c - + +d - + +e - + +f - + +g - + +h - + +i - + +j - + +k diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 8ec8e160..a92b2f34 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,159 +162,159 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B*> - + - + c : std::map<int,C> - + - + d : std::map<int,D*> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G*>> - + - + h : std::array<H,10> - + - + i : std::array<I*,5> - + - + j : J[10] - + - + k : K*[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> - + - + - + +a - + +b - + +c - + +d - + +e - + +f - + +g - + +h - + +i - + +j - + +k - + lm - + lm - + ns - + ns - + ns diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 69079756..46d12204 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> - + +a - + +b - + +c diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 51a12e2b..dc6af6e7 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T* - + - + reference : T& - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,38 +103,38 @@ int,Vector - - + + D - + - + ints : B<int,Vector> - + - + D(std::tuple<Items...>* ) : void - + - + add(int i) : void - + - + ints diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 9f878af6..533159c1 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,50 +50,50 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string>* - + - + avector : A<std::vector<std::string>>& - + - + - + - + aint - + astring - + avector diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 2592595e..f4b09d62 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,30 +66,30 @@ int - - + + C - + - + aintstring : B<int> - + - + astring - + - + aintstring diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 992a49f0..9b71bd6d 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,56 +18,56 @@ T - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + m_a : A* - + - + foo() : void - + «friend» - + m_a diff --git a/docs/test_cases/t00012.md b/docs/test_cases/t00012.md index 7bd60b59..cada73f8 100644 --- a/docs/test_cases/t00012.md +++ b/docs/test_cases/t00012.md @@ -22,8 +22,8 @@ diagrams: File t00012.cc ```cpp #include +#include #include -#include #include #include #include diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 44d06d16..8c142246 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - - - - A - - T,Ts... - + + + + + A + + T,Ts... + - - - + + + - - value : T + + value : T - - - + + + - - values : int + + values : std::variant<Ts...> - - - + + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,79 +107,79 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation - + - + - + - + - + - + a1 - + a2 - + b1 - + b2 - + c1 diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index c43142f8..8b18ec2d 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,83 +18,83 @@ T - + - + f : T - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int - + - + print(R* r) : void - - + + E @@ -102,16 +102,16 @@ T - + - + e : T - - + + G @@ -119,22 +119,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -142,7 +142,7 @@ int - + F @@ -150,7 +150,7 @@ int - + G @@ -158,7 +158,7 @@ int,float,std::string - + E @@ -166,136 +166,136 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> - + - + get_a(A* a) : int - + - + get_b(B& b) : int - + - + get_const_b(B const& b) : int - + - + get_c(C c) : int - + - + get_d(D&& d) : int - + - + get_d2(D&& d) : int - + - + get_e(E<T> e) : T - + - + get_int_e(E<int> const& e) : int - + - + get_int_e2(E<int>& e) : int - + - + get_f(F<T> const& f) : T - + - + get_int_f(F<int> const& f) : int - + - + - + - + - + - + - + - + - + - + - + - + - + - + gintstring - + estring diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 01a1455b..7f19cd46 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,bool - + A @@ -96,7 +96,7 @@ double,bool - + A @@ -104,7 +104,7 @@ long,float - + A @@ -112,7 +112,7 @@ double,float - + A @@ -120,7 +120,7 @@ bool,std::string - + A @@ -128,7 +128,7 @@ float,std::unique_ptr<std::string> - + A @@ -136,7 +136,7 @@ int,std::string - + A @@ -144,7 +144,7 @@ std::string,std::string - + A @@ -152,7 +152,7 @@ char,std::string - + A @@ -160,214 +160,214 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + bapair - + bapair - + bs - + bs2 - + vps - + - + abool - + aboolfloat - + - + aboolfloat - + - + afloat - + boolstring - + floatstring - + intstring - + stringstring - + bstringstring - + - + diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 56c26b81..d106a355 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B - + - + - + diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index f435489c..da3a555d 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -31,8 +31,8 @@ value : enum - - + + is_numeric @@ -43,8 +43,8 @@ value : enum - - + + is_numeric @@ -55,8 +55,8 @@ value : enum - - + + is_numeric @@ -67,13 +67,13 @@ value : enum - + - + - + - + diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 0cfafcc4..5ae0fe23 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,176 +9,176 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - + R(int& some_int, C& cc, E const& ee, F&& ff, I*& ii) : void - + - + -c - + - + -e - + - + -f - + - + -i - + -a - + -b - + -d - + -g - + -h - + -j - + -k diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index cb05a835..91d43c79 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,125 +9,125 @@ - - + + impl::widget - + - + n : int - + - + draw(widget const& w) const : void - + - + draw(widget const& w) : void - + - + widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - + widget(int ) : void - + - + ~widget() : void - + - + widget(widget&& ) : void - + - + widget(widget const& ) : void - + - + operator=(widget&& ) : widget& - + - + operator=(widget const& ) : widget& - + - + - + pImpl diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 4ed88a23..3c13e3a5 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Layer2 @@ -19,51 +19,51 @@ - + - + all_calls_count() const : int - - + + Base - + - + Base() : void - + - + ~Base() : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -72,22 +72,22 @@ - + - + m1() : int - + - + m2() : std::string - - + + Layer3 @@ -95,50 +95,50 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int - + - + m1() : int - + - + m2() : std::string - + - + m1_calls() const : int - + - + m2_calls() const : int - + Layer3 @@ -146,7 +146,7 @@ Base - + Layer2 @@ -154,7 +154,7 @@ Layer3<Base> - + Layer1 @@ -162,42 +162,42 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> - + - + - + - + - + - + - + - + - + - + - + layers diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index c5ae84c1..e1b1f7fe 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,195 +9,195 @@ - - + + ProductA - + - + ~ProductA() : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - + ~ProductB() : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 260391b4..488b253a 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,184 +9,184 @@ - - + + Visitor - + - + ~Visitor() : void - + - + visit_A(A const& item) const = 0 : void - + - + visit_B(B const& item) const = 0 : void - - + + Visitor1 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor2 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor3 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Item - + - + ~Item() : void - + - + accept(Visitor const& visitor) const = 0 : void - - + + A - + - + accept(Visitor const& visitor) const : void - - + + B - + - + accept(Visitor const& visitor) const : void - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 227a7e72..826f13fe 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,82 +9,82 @@ - - + + A - + - + template_method() : void - + - + method1() = 0 : void - + - + method2() = 0 : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void - + - + diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 2f4845e4..4b4cf48f 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,111 +9,111 @@ - - + + Strategy - + - + ~Strategy() : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> - + - + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void - + - + - + - + - + m_strategy diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 09b87f8a..125b1132 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,126 +9,126 @@ - - + + Target - + - + ~Target() : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> - + - + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void - + - + - + - + m_target - + diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index cf70e09b..4c6cfec5 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,36 +62,36 @@ T - + - + m_target : std::shared_ptr<T> - + - + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + Proxy @@ -99,7 +99,7 @@ Target1 - + Proxy @@ -107,41 +107,41 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> - + - + - + - + - + proxy1 - + proxy2 diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 3e7869b9..a04faa43 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,30 +18,30 @@ T - + - + m_value : T - + - + Memento(T&& v) : void - + - + value() const : T - - + + Originator @@ -49,51 +49,51 @@ T - + - + m_value : T - + - + Originator(T&& v) : void - + - + memoize_value() const : Memento<T> - + - + load(Memento<T> const& m) : void - + - + print() const : void - + - + set(T&& v) : void - - + + Caretaker @@ -101,29 +101,29 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - + - + state(std::string const& n) : Memento<T>& - + - + set_state(std::string const& s, Memento<T>&& m) : void - + Caretaker @@ -131,7 +131,7 @@ std::string - + Originator @@ -139,45 +139,45 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> - + - + - + m_mementos - + - + - + caretaker - + originator diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index c4550bef..69bd3b0f 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Shape - + - + display() = 0 : void - + - + ~Shape() : void - - + + Line @@ -41,15 +41,15 @@ - + - + display() : void - - + + Text @@ -58,30 +58,30 @@ - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -90,15 +90,15 @@ - + - + display() : void - - + + Weight @@ -107,14 +107,14 @@ - + - + display() : void - + Line @@ -122,7 +122,7 @@ Color,Weight - + Line @@ -130,7 +130,7 @@ Color - + Text @@ -138,7 +138,7 @@ Color,Weight - + Text @@ -146,71 +146,71 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> - + - + - + - + - + - + - + - + - + border - + divider - + title - + description diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 9cdb708b..5842e120 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,68 +9,68 @@ - - + + A - + A class note. - + A class note. - - + + B - + B class note. - + B class note. - - + + C - + C class note. - + C class note. - - + + D - + D class note. - + D class note. - - + + E @@ -78,27 +78,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -108,13 +108,13 @@ three - + F enum note. - + F enum note. - + E @@ -122,97 +122,97 @@ int - - + + R - + - + aaa : A - + - + bbb : B* - + - + ccc : C& - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G** - + - + R(C& c) : void - + R class note. - + R class note. - - - - + + + + - + - + ccc - + aaa - + bbb - + ddd - + eee - + ggg diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 5ffa5aec..41ca8178 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,72 +45,72 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3& - + - + g4 : std::shared_ptr<G4> - + g1 - + g4 diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index aed7d8bc..2579f63c 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,91 +9,91 @@ - - + + A - - + + B - - + + C - - + + D - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + aaa - + bbb 0..1 1..* - + ccc 0..1 1..5 - + ddd diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index d864bf96..f53fc698 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,57 +71,57 @@ int - - + + R - + - + aaa : A* - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D* - + - + aaa - + bbb - + ccc - + ddd diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 171a0502..43b21ad3 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -79,15 +79,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -95,42 +95,42 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> - + - + - + - + - + - + - + - + - + - + - + overload diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 158e08ca..38bccc8c 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,34 +99,34 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> - + - + - + - + - + - + - + abc diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index c1534850..3cfdcfc1 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator==(Void const& ) const : bool - + - + operator!=(Void const& ) const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,43 +71,43 @@ - - + + A - - + + R - + - + la : lift_void_t<A>* - + - + lv : lift_void_t<void>* - + - + - + - + la diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 4950dcd5..62f1388c 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index bbf2a2d4..890ff27b 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,32 +59,32 @@ int - - + + B - + - + a_int : A<int> - - + + C - + - + a_int diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 0c81b416..be84b6dc 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,84 +9,84 @@ - - + + ST - + - + dimensions : «anonymous» - - + + <<anonymous>> - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + A - + - + st : ST - + - + A() : void - + - + st diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index c8ba966e..f46ef8ca 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map @@ -128,31 +128,31 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index e1cd1d2d..32ccadf8 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B* - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T* - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M* - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M* - - + + ns3::FFF @@ -156,39 +156,39 @@ T,M,N - + - + n : N* - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 9e0301e3..28d89287 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,76 +9,76 @@ - - + + A - + - + ii_ : int - + - + get_a() : int - - + + AA - - + + AAA - + - + b : B* - + - + get_aaa() : int - - + + R - + - + foo(A* a) : void - + - + diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 445efc90..63da0feb 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,116 +9,116 @@ - - + + R - - + + D - + - + rr : RR* - - + + E - - + + F - - + + RR - + - + e : E* - + - + f : F* - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM - + rr - + +e - + +f - + - + - + - + diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index b07c2c3d..ec26e479 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + B @@ -35,18 +35,18 @@ T,K - + - + b : T - + - + bb : K diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index b873af71..13404b83 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,189 +9,189 @@ - + dependants - + dependencies - - + + A - - + + B - + - + b(dependants::A* a) : void - - + + BB - + - + bb(dependants::A* a) : void - - + + C - + - + c(dependants::B* b) : void - - + + D - + - + d(dependants::C* c) : void - + - + dd(dependants::BB* bb) : void - - + + E - + - + e(dependants::D* d) : void - - + + G - - + + GG - - + + H - + - + h(dependencies::G* g) : void - + - + hh(dependencies::GG* gg) : void - - + + I - + - + i(dependencies::H* h) : void - - + + J - + - + i(dependencies::I* i) : void - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 1ec008ba..7f004a88 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + sink @@ -19,8 +19,8 @@ - - + + signal_handler @@ -29,8 +29,8 @@ - - + + sink @@ -38,29 +38,29 @@ Ret,Args...,A - + - + signal : signal_t* - + - + sink(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2>>::signal_t& sh) : void - + signal_handler - - + + signal_handler diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md new file mode 100644 index 00000000..50268500 --- /dev/null +++ b/docs/test_cases/t00045.md @@ -0,0 +1,60 @@ +# t00045 - Test case for root namespace handling +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t00045_class: + type: class + glob: + - ../../tests/t00045/t00045.cc + exclude: + namespaces: + - std +``` +## Source code +File t00045.cc +```cpp +class A { +}; + +class AA { +}; + +namespace ns1 { + +class A { +}; + +namespace ns2 { + +class A { +}; + +class B : public A { +}; + +class C : public ns1::A { +}; + +class D : public ns1::ns2::A { +}; + +class E : public ::A { +}; + +class R { +public: + A *a; + ns1::A *ns1_a; + ns1::ns2::A *ns1_ns2_a; + ::A *root_a; + + void foo(::AA &aa) { (void)aa; } +}; +} +} + +``` +## Generated UML diagrams +![t00045_class](./t00045_class.svg "Test case for root namespace handling") diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg new file mode 100644 index 00000000..7ab2aa40 --- /dev/null +++ b/docs/test_cases/t00045_class.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + A + + + + + + + + AA + + + + + + + + ns1::A + + + + + + + + ns1::ns2::A + + + + + + + + ns1::ns2::B + + + + + + + + ns1::ns2::C + + + + + + + + ns1::ns2::D + + + + + + + + ns1::ns2::E + + + + + + + + ns1::ns2::R + + + + + + + + a : ns1::ns2::A* + + + + + + + ns1_a : ns1::A* + + + + + + + ns1_ns2_a : ns1::ns2::A* + + + + + + + root_a : ::A* + + + + + + + + foo(AA& aa) : void + + + + + + + + + + + + +a + + + + ns1_ns2_a + + + + ns1_a + + + + root_a + + + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 3f4579ac..62254d8b 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,67 +9,67 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B - - - + + + diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index f8f6d6ee..bd67999c 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + BBB - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 4f0838c6..c7f6106d 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 - + diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 7b05c3b5..376c7abf 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE - - - - + + + + diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index ed277a85..9df3027c 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC - + - + diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index 4937ab0c..358bac44 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - - + + B - - + + A - - + + C - + Top A note. - - + + - + diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 0c7946e9..55d52ff2 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,33 +9,33 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. - - + + - + diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 94f5fc61..2c981b56 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - + - + - + - + diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 480eb53a..e31a450e 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + cppast/cpp_preprocessor.hpp - + This is a lib1 include dir - + This is a t40001_include1.h include file - + - + - + - + - + - + - - + + diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index c8e8ede5..6a8ba06d 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h - + - + - + - + - + diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 7e414e44..43a7b168 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,84 +9,84 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc - + - + - + - + - + - + - + - + From fd8f13135252262867013036fec10e8cc75b3b0b Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 18:32:00 +0200 Subject: [PATCH 05/16] Added test case for handling root namespace with package generation --- tests/t00046/.clang-uml | 11 ++++++++++ tests/t00046/t00046.cc | 39 ++++++++++++++++++++++++++++++++++ tests/t00046/test_case.h | 46 ++++++++++++++++++++++++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 +++ 5 files changed, 100 insertions(+) create mode 100644 tests/t00046/.clang-uml create mode 100644 tests/t00046/t00046.cc create mode 100644 tests/t00046/test_case.h diff --git a/tests/t00046/.clang-uml b/tests/t00046/.clang-uml new file mode 100644 index 00000000..cea73ccf --- /dev/null +++ b/tests/t00046/.clang-uml @@ -0,0 +1,11 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t00046_class: + type: class + generate_packages: true + glob: + - ../../tests/t00046/t00046.cc + exclude: + namespaces: + - std \ No newline at end of file diff --git a/tests/t00046/t00046.cc b/tests/t00046/t00046.cc new file mode 100644 index 00000000..3d8da7c2 --- /dev/null +++ b/tests/t00046/t00046.cc @@ -0,0 +1,39 @@ +class A { +}; + +class AA { +}; + +namespace ns1 { + +class A { +}; + +namespace ns2 { + +class A { +}; + +class B : public A { +}; + +class C : public ns1::A { +}; + +class D : public ns1::ns2::A { +}; + +class E : public ::A { +}; + +class R { +public: + A *a; + ns1::A *ns1_a; + ns1::ns2::A *ns1_ns2_a; + ::A *root_a; + + void foo(::AA &aa) { (void)aa; } +}; +} +} diff --git a/tests/t00046/test_case.h b/tests/t00046/test_case.h new file mode 100644 index 00000000..a15aedd4 --- /dev/null +++ b/tests/t00046/test_case.h @@ -0,0 +1,46 @@ +/** + * tests/t00046/test_case.cc + * + * Copyright (c) 2021-2022 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +TEST_CASE("t00046", "[test-case][class]") +{ + auto [config, db] = load_config("t00046"); + + auto diagram = config.diagrams["t00046_class"]; + + REQUIRE(diagram->name == "t00046_class"); + + auto model = generate_class_diagram(db, diagram); + + REQUIRE(model->name() == "t00046_class"); + REQUIRE(model->should_include("ns1::ns2::A")); + + auto puml = generate_class_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(puml, IsClass(_A("A"))); + 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("R"))); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 29905b03..8f8ddbe6 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -227,6 +227,7 @@ using namespace clanguml::test::matchers; #include "t00043/test_case.h" #include "t00044/test_case.h" #include "t00045/test_case.h" +#include "t00046/test_case.h" // // Sequence diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 23a7d068..4aa904f4 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -132,6 +132,9 @@ test_cases: - name: t00045 title: Test case for root namespace handling description: + - name: t00046 + title: Test case for root namespace handling with packages + description: Sequence diagrams: - name: t20001 title: Basic sequence diagram test case From 1fc225d20e7b4aed6f859a2d32441d98aed72ab6 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 18 Jun 2022 18:35:18 +0200 Subject: [PATCH 06/16] Updated test cases documentation --- docs/test_cases.md | 1 + docs/test_cases/t00002_class.svg | 68 ++++++------- docs/test_cases/t00003_class.svg | 110 ++++++++++----------- docs/test_cases/t00004_class.svg | 26 ++--- docs/test_cases/t00005_class.svg | 110 ++++++++++----------- docs/test_cases/t00006_class.svg | 132 ++++++++++++------------- docs/test_cases/t00007_class.svg | 30 +++--- docs/test_cases/t00008_class.svg | 64 ++++++------ docs/test_cases/t00009_class.svg | 32 +++--- docs/test_cases/t00010_class.svg | 34 +++---- docs/test_cases/t00011_class.svg | 30 +++--- docs/test_cases/t00012_class.svg | 66 ++++++------- docs/test_cases/t00013_class.svg | 130 ++++++++++++------------- docs/test_cases/t00014_class.svg | 114 +++++++++++----------- docs/test_cases/t00015_class.svg | 22 ++--- docs/test_cases/t00016_class.svg | 22 ++--- docs/test_cases/t00017_class.svg | 70 ++++++------- docs/test_cases/t00018_class.svg | 66 ++++++------- docs/test_cases/t00019_class.svg | 84 ++++++++-------- docs/test_cases/t00020_class.svg | 94 +++++++++--------- docs/test_cases/t00021_class.svg | 82 ++++++++-------- docs/test_cases/t00022_class.svg | 42 ++++---- docs/test_cases/t00023_class.svg | 54 +++++------ docs/test_cases/t00024_class.svg | 62 ++++++------ docs/test_cases/t00025_class.svg | 62 ++++++------ docs/test_cases/t00026_class.svg | 78 +++++++-------- docs/test_cases/t00027_class.svg | 82 ++++++++-------- docs/test_cases/t00028_class.svg | 94 +++++++++--------- docs/test_cases/t00029_class.svg | 50 +++++----- docs/test_cases/t00030_class.svg | 38 ++++---- docs/test_cases/t00031_class.svg | 50 +++++----- docs/test_cases/t00032_class.svg | 52 +++++----- docs/test_cases/t00033_class.svg | 48 ++++----- docs/test_cases/t00034_class.svg | 46 ++++----- docs/test_cases/t00035_class.svg | 22 ++--- docs/test_cases/t00036_class.svg | 38 ++++---- docs/test_cases/t00037_class.svg | 42 ++++---- docs/test_cases/t00038_class.svg | 54 +++++------ docs/test_cases/t00039_class.svg | 78 +++++++-------- docs/test_cases/t00040_class.svg | 38 ++++---- docs/test_cases/t00041_class.svg | 50 +++++----- docs/test_cases/t00042_class.svg | 22 ++--- docs/test_cases/t00043_class.svg | 90 ++++++++--------- docs/test_cases/t00044_class.svg | 28 +++--- docs/test_cases/t00045_class.svg | 58 +++++------ docs/test_cases/t00046.md | 61 ++++++++++++ docs/test_cases/t00046_class.svg | 151 +++++++++++++++++++++++++++++ docs/test_cases/t30001_package.svg | 54 +++++------ docs/test_cases/t30002_package.svg | 112 ++++++++++----------- docs/test_cases/t30003_package.svg | 28 +++--- docs/test_cases/t30004_package.svg | 38 ++++---- docs/test_cases/t30005_package.svg | 42 ++++---- docs/test_cases/t30006_package.svg | 22 ++--- docs/test_cases/t30007_package.svg | 26 ++--- docs/test_cases/t30008_package.svg | 42 ++++---- docs/test_cases/t40001_include.svg | 46 ++++----- docs/test_cases/t40002_include.svg | 44 ++++----- docs/test_cases/t40003_include.svg | 66 ++++++------- 58 files changed, 1805 insertions(+), 1592 deletions(-) create mode 100644 docs/test_cases/t00046.md create mode 100644 docs/test_cases/t00046_class.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index a28e7d89..f278cd02 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -44,6 +44,7 @@ * [t00043](./test_cases/t00043.md) - Dependants and dependencies class diagram filter test * [t00044](./test_cases/t00044.md) - Test case for inner type aliases with parent class template args * [t00045](./test_cases/t00045.md) - Test case for root namespace handling + * [t00046](./test_cases/t00046.md) - Test case for root namespace handling with packages ## Sequence diagrams * [t20001](./test_cases/t20001.md) - Basic sequence diagram test case * [t20002](./test_cases/t20002.md) - Free function sequence diagram test case diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index 0dc8893e..56ebfcb1 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,123 +9,123 @@ - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - - + + E - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - + This is class A - + This is class B - + This is class D which is a little like B diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index 3d6f1a8f..e1f46e2f 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,194 +9,194 @@ - - + + A - + - + public_member : int - + - + static_int : int - + - + static_const_int : int const - + - + auto_member : unsigned long const - + - + protected_member : int - + - + private_member : int - + - + a : int - + - + b : int - + - + c : int - + - + A() : void - + - + A(int i) : void - + - + A(A&& ) : void - + - + A(A const& ) : void - + - + ~A() : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + double_int(int const i) : int - + - + sum(double const a, double const b) : double - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool(int const)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index d843df8a..290be35b 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,38 +9,38 @@ - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + AA - - + + Lights @@ -50,8 +50,8 @@ Red - - + + AAA diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 7e18e27a..f28a9846 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - + a : A - + - + b : B* - + - + c : C& - + - + d : D const* - + - + e : E const& - + - + f : F&& - + - + g : G** - + - + h : H*** - + - + i : I*& - + - + j : J volatile* - + - + k : K* diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index a92b2f34..5ce99107 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B*> - + - + c : std::map<int,C> - + - + d : std::map<int,D*> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G*>> - + - + h : std::array<H,10> - + - + i : std::array<I*,5> - + - + j : J[10] - + - + k : K*[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 46d12204..0e786bcf 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index dc6af6e7..c24a6939 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T* - + - + reference : T& - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,33 +103,33 @@ int,Vector - - + + D - + - + ints : B<int,Vector> - + - + D(std::tuple<Items...>* ) : void - + - + add(int i) : void diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 533159c1..975cabb1 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string>* - + - + avector : A<std::vector<std::string>>& diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index f4b09d62..2071f128 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 9b71bd6d..62a52fb4 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,49 +18,49 @@ T - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + m_a : A* - + - + foo() : void diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 8c142246..206bde74 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 8b18ec2d..e5e7a891 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,83 +18,83 @@ T - + - + f : T - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int - + - + print(R* r) : void - - + + E @@ -102,16 +102,16 @@ T - + - + e : T - - + + G @@ -119,22 +119,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -142,7 +142,7 @@ int - + F @@ -150,7 +150,7 @@ int - + G @@ -158,7 +158,7 @@ int,float,std::string - + E @@ -166,103 +166,103 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> - + - + get_a(A* a) : int - + - + get_b(B& b) : int - + - + get_const_b(B const& b) : int - + - + get_c(C c) : int - + - + get_d(D&& d) : int - + - + get_d2(D&& d) : int - + - + get_e(E<T> e) : T - + - + get_int_e(E<int> const& e) : int - + - + get_int_e2(E<int>& e) : int - + - + get_f(F<T> const& f) : T - + - + get_int_f(F<int> const& f) : int diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 7f19cd46..4d76fe1f 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,bool - + A @@ -96,7 +96,7 @@ double,bool - + A @@ -104,7 +104,7 @@ long,float - + A @@ -112,7 +112,7 @@ double,float - + A @@ -120,7 +120,7 @@ bool,std::string - + A @@ -128,7 +128,7 @@ float,std::unique_ptr<std::string> - + A @@ -136,7 +136,7 @@ int,std::string - + A @@ -144,7 +144,7 @@ std::string,std::string - + A @@ -152,7 +152,7 @@ char,std::string - + A @@ -160,116 +160,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index d106a355..d6eeb769 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index da3a555d..7f171133 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -31,8 +31,8 @@ value : enum - - + + is_numeric @@ -43,8 +43,8 @@ value : enum - - + + is_numeric @@ -55,8 +55,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 5ae0fe23..5ebcd126 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - + R(int& some_int, C& cc, E const& ee, F&& ff, I*& ii) : void diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 91d43c79..2dfd61c8 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - - + + impl::widget - + - + n : int - + - + draw(widget const& w) const : void - + - + draw(widget const& w) : void - + - + widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - + widget(int ) : void - + - + ~widget() : void - + - + widget(widget&& ) : void - + - + widget(widget const& ) : void - + - + operator=(widget&& ) : widget& - + - + operator=(widget const& ) : widget& diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 3c13e3a5..42387c90 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Layer2 @@ -19,51 +19,51 @@ - + - + all_calls_count() const : int - - + + Base - + - + Base() : void - + - + ~Base() : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -72,22 +72,22 @@ - + - + m1() : int - + - + m2() : std::string - - + + Layer3 @@ -95,50 +95,50 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int - + - + m1() : int - + - + m2() : std::string - + - + m1_calls() const : int - + - + m2_calls() const : int - + Layer3 @@ -146,7 +146,7 @@ Base - + Layer2 @@ -154,7 +154,7 @@ Layer3<Base> - + Layer1 @@ -162,18 +162,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index e1b1f7fe..47002417 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,174 +9,174 @@ - - + + ProductA - + - + ~ProductA() : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - + ~ProductB() : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 488b253a..423c088c 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,151 +9,151 @@ - - + + Visitor - + - + ~Visitor() : void - + - + visit_A(A const& item) const = 0 : void - + - + visit_B(B const& item) const = 0 : void - - + + Visitor1 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor2 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor3 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Item - + - + ~Item() : void - + - + accept(Visitor const& visitor) const = 0 : void - - + + A - + - + accept(Visitor const& visitor) const : void - - + + B - + - + accept(Visitor const& visitor) const : void diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 826f13fe..1362e2ff 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,77 +9,77 @@ - - + + A - + - + template_method() : void - + - + method1() = 0 : void - + - + method2() = 0 : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 4b4cf48f..bbfc2598 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + Strategy - + - + ~Strategy() : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> - + - + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 125b1132..516441e1 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + Target - + - + ~Target() : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> - + - + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 4c6cfec5..becd62c3 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,36 +62,36 @@ T - + - + m_target : std::shared_ptr<T> - + - + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + Proxy @@ -99,7 +99,7 @@ Target1 - + Proxy @@ -107,25 +107,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index a04faa43..ad7de371 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,30 +18,30 @@ T - + - + m_value : T - + - + Memento(T&& v) : void - + - + value() const : T - - + + Originator @@ -49,51 +49,51 @@ T - + - + m_value : T - + - + Originator(T&& v) : void - + - + memoize_value() const : Memento<T> - + - + load(Memento<T> const& m) : void - + - + print() const : void - + - + set(T&& v) : void - - + + Caretaker @@ -101,29 +101,29 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - + - + state(std::string const& n) : Memento<T>& - + - + set_state(std::string const& s, Memento<T>&& m) : void - + Caretaker @@ -131,7 +131,7 @@ std::string - + Originator @@ -139,25 +139,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 69bd3b0f..33f1dc9f 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Shape - + - + display() = 0 : void - + - + ~Shape() : void - - + + Line @@ -41,15 +41,15 @@ - + - + display() : void - - + + Text @@ -58,30 +58,30 @@ - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -90,15 +90,15 @@ - + - + display() : void - - + + Weight @@ -107,14 +107,14 @@ - + - + display() : void - + Line @@ -122,7 +122,7 @@ Color,Weight - + Line @@ -130,7 +130,7 @@ Color - + Text @@ -138,7 +138,7 @@ Color,Weight - + Text @@ -146,39 +146,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 5842e120..7f5a38e4 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,68 +9,68 @@ - - + + A - + A class note. - + A class note. - - + + B - + B class note. - + B class note. - - + + C - + C class note. - + C class note. - - + + D - + D class note. - + D class note. - - + + E @@ -78,27 +78,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -108,13 +108,13 @@ three - + F enum note. - + F enum note. - + E @@ -122,67 +122,67 @@ int - - + + R - + - + aaa : A - + - + bbb : B* - + - + ccc : C& - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G** - + - + R(C& c) : void - + R class note. - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 41ca8178..715e98bb 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3& - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 2579f63c..579b4ce4 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,71 +9,71 @@ - - + + A - - + + B - - + + C - - + + D - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index f53fc698..39a7663b 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A* - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D* diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 43b21ad3..edc023be 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -79,15 +79,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -95,18 +95,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 38bccc8c..dec9c5a5 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 3cfdcfc1..fa290d8f 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator==(Void const& ) const : bool - + - + operator!=(Void const& ) const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,33 +71,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A>* - + - + lv : lift_void_t<void>* diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 62f1388c..0a289ac4 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 890ff27b..ceff5f2d 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index be84b6dc..8ebf2ec2 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,77 +9,77 @@ - - + + ST - + - + dimensions : «anonymous» - - + + <<anonymous>> - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + A - + - + st : ST - + - + A() : void diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index f46ef8ca..63a1f81b 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 32ccadf8..a52c0cab 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B* - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T* - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M* - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M* - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N* diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 28d89287..0e025ced 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,71 +9,71 @@ - - + + A - + - + ii_ : int - + - + get_a() : int - - + + AA - - + + AAA - + - + b : B* - + - + get_aaa() : int - - + + R - + - + foo(A* a) : void diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 63da0feb..3038a842 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,93 +9,93 @@ - - + + R - - + + D - + - + rr : RR* - - + + E - - + + F - - + + RR - + - + e : E* - + - + f : F* - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index ec26e479..55ebf75f 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + B @@ -35,18 +35,18 @@ T,K - + - + b : T - + - + bb : K diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 13404b83..b6cf6cb6 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,168 +9,168 @@ - + dependants - + dependencies - - + + A - - + + B - + - + b(dependants::A* a) : void - - + + BB - + - + bb(dependants::A* a) : void - - + + C - + - + c(dependants::B* b) : void - - + + D - + - + d(dependants::C* c) : void - + - + dd(dependants::BB* bb) : void - - + + E - + - + e(dependants::D* d) : void - - + + G - - + + GG - - + + H - + - + h(dependencies::G* g) : void - + - + hh(dependencies::GG* gg) : void - - + + I - + - + i(dependencies::H* h) : void - - + + J - + - + i(dependencies::I* i) : void diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 7f004a88..33d2236b 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + sink @@ -19,8 +19,8 @@ - - + + signal_handler @@ -29,8 +29,8 @@ - - + + sink @@ -38,29 +38,29 @@ Ret,Args...,A - + - + signal : signal_t* - + - + sink(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2>>::signal_t& sh) : void - + signal_handler - - + + signal_handler diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 7ab2aa40..c66c7c16 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,111 +9,111 @@ - - + + A - - + + AA - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::R - + - + a : ns1::ns2::A* - + - + ns1_a : ns1::A* - + - + ns1_ns2_a : ns1::ns2::A* - + - + root_a : ::A* - + - + foo(AA& aa) : void diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md new file mode 100644 index 00000000..60c76d94 --- /dev/null +++ b/docs/test_cases/t00046.md @@ -0,0 +1,61 @@ +# t00046 - Test case for root namespace handling with packages +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t00046_class: + type: class + generate_packages: true + glob: + - ../../tests/t00046/t00046.cc + exclude: + namespaces: + - std +``` +## Source code +File t00046.cc +```cpp +class A { +}; + +class AA { +}; + +namespace ns1 { + +class A { +}; + +namespace ns2 { + +class A { +}; + +class B : public A { +}; + +class C : public ns1::A { +}; + +class D : public ns1::ns2::A { +}; + +class E : public ::A { +}; + +class R { +public: + A *a; + ns1::A *ns1_a; + ns1::ns2::A *ns1_ns2_a; + ::A *root_a; + + void foo(::AA &aa) { (void)aa; } +}; +} +} + +``` +## Generated UML diagrams +![t00046_class](./t00046_class.svg "Test case for root namespace handling with packages") diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg new file mode 100644 index 00000000..0a7f9082 --- /dev/null +++ b/docs/test_cases/t00046_class.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + ns1 + + + ns2 + + + + + A + + + + + + + + A + + + + + + + + B + + + + + + + + C + + + + + + + + D + + + + + + + + E + + + + + + + + R + + + + + + + + a : ns1::ns2::A* + + + + + + + ns1_a : ns1::A* + + + + + + + ns1_ns2_a : ns1::ns2::A* + + + + + + + root_a : ::A* + + + + + + + + foo(AA& aa) : void + + + + + + A + + + + + + + + AA + + + + + + + + + + + + + + +a + + + + ns1_ns2_a + + + + ns1_a + + + + root_a + + + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 62254d8b..fb7ffafc 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,67 +9,67 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B - - - + + + diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index bd67999c..d6b02816 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + BBB - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index c7f6106d..4586b637 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 - + diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 376c7abf..c9c3d7bd 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE - - - - + + + + diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index 9df3027c..7c5a6e16 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC - + - + diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index 358bac44..b66db0a6 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - - + + B - - + + A - - + + C - + Top A note. - - + + - + diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 55d52ff2..437b40d9 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,33 +9,33 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. - - + + - + diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 2c981b56..33ffb566 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - + - + - + - + diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index e31a450e..b9ac57bd 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + cppast/cpp_preprocessor.hpp - + This is a lib1 include dir - + This is a t40001_include1.h include file - + - + - + - + - + - + - - + + diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 6a8ba06d..16edbe07 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h - + - + - + - + - + diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 43a7b168..867916c1 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,84 +9,84 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc - + - + - + - + - + - + - + - + From c0aafd0e6de911ee623edecd5ae074b40fe3388a Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 21 Jun 2022 01:08:55 +0200 Subject: [PATCH 07/16] Added simple test case template generator --- util/generate_test_case.py | 157 ++++++++++++++++++++++++++ util/templates/test_cases/.clang-uml | 10 ++ util/templates/test_cases/t00000.cc | 5 + util/templates/test_cases/test_case.h | 41 +++++++ 4 files changed, 213 insertions(+) create mode 100755 util/generate_test_case.py create mode 100644 util/templates/test_cases/.clang-uml create mode 100644 util/templates/test_cases/t00000.cc create mode 100644 util/templates/test_cases/test_case.h diff --git a/util/generate_test_case.py b/util/generate_test_case.py new file mode 100755 index 00000000..933ad835 --- /dev/null +++ b/util/generate_test_case.py @@ -0,0 +1,157 @@ +#!/usr/bin/python3 + +## +## util/generate_test_case.py +## +## Copyright (c) 2021-2022 Bartek Kryza +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +import os +import sys +import jinja2 + +TEST_CASE_MULTIPLIER = 10000 + +CLASS_DIAGRAM_TEST_CASE_EXAMPLES = """ + // Check if all classes exist + //REQUIRE_THAT(puml, IsClass(_A("A"))); + + // Check if class templates exist + //REQUIRE_THAT(puml, IsClassTemplate("A", "T,P,CMP,int N")); + + // Check if all enums exist + //REQUIRE_THAT(puml, IsEnum(_A("Lights"))); + + // Check if all inner classes exist + //REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("AA"))); + + // Check if all inheritance relationships exist + //REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("Child"))); + + // Check if all methods exist + //REQUIRE_THAT(puml, (IsMethod("foo"))); + + // Check if all fields exist + //REQUIRE_THAT(puml, (IsField("private_member", "int"))); + + // Check if all relationships exist + //REQUIRE_THAT(puml, IsAssociation(_A("D"), _A("A"), "-as")); + //REQUIRE_THAT(puml, IsDependency(_A("R"), _A("B"))); + //REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("D"))); + //REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D"))); + //REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F"), _A("F"))); +""" + +SEQUENCE_DIAGRAM_TEST_CASE_EXAMPLES = """ + // Check if all calls exist + //REQUIRE_THAT(puml, HasCall("A", "log_result")); + //REQUIRE_THAT(puml, HasCallWithResponse("B", "A", "add3")); +""" + +PACKAGE_DIAGRAM_TEST_CASE_EXAMPLES = """ + // Check if all packages exist + //REQUIRE_THAT(puml, IsPackage("ns1")); +""" + +INCLUDE_DIAGRAM_TEST_CASE_EXAMPLES = """ + // Check all folders exist + //REQUIRE_THAT(puml, IsFolder("lib1")); + + // Check if all files exist + //REQUIRE_THAT(puml, IsFile("lib1.h")); + + // Check if all includes exists + //REQUIRE_THAT(puml, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); + //REQUIRE_THAT(puml, IsDependency(_A("t40001_include1.h"), _A("string"))); +""" + +def test_case_already_exists(name): + return os.path.isdir(os.path.join(os.path.dirname(__file__), '..', name)) + + +def test_case_category(type): + if type == 'class': + return 0 + elif type == 'sequence': + return 2 * TEST_CASE_MULTIPLIER + elif type == 'package': + return 3 * TEST_CASE_MULTIPLIER + elif type == 'include': + return 4 * TEST_CASE_MULTIPLIER + else: + print(f"Invalid test case type '{type}' - aborting...") + sys.exit(1) + + +def examples_for_type(type): + if type == 'class': + return CLASS_DIAGRAM_TEST_CASE_EXAMPLES + elif type == 'sequence': + return SEQUENCE_DIAGRAM_TEST_CASE_EXAMPLES + elif type == 'package': + return PACKAGE_DIAGRAM_TEST_CASE_EXAMPLES + elif type == 'include': + return INCLUDE_DIAGRAM_TEST_CASE_EXAMPLES + else: + print(f"Invalid test case type '{type}' - aborting...") + sys.exit(1) + + +def generate(environment, variables, src, dst, dst_path): + template = environment.get_template(src) + + output = template.render(variables) + + with open(os.path.join(dst_path, dst), 'wb+') as fh: + fh.write(output.encode("UTF-8")) + + +def main(args): + if len(args) != 2: + print("Usage: ./generate_test_cases.py ") + + test_case_type = args[0] + test_case_number = int(args[1]) + test_case_name = f't{test_case_category(test_case_type) + test_case_number:05d}' + + if test_case_already_exists(test_case_name): + print(f"Test case 'test_case_name' already exists - aborting...") + sys.exit(1) + + template_directory = os.path.join(os.path.dirname(__file__), 'templates', 'test_cases') + + loader = jinja2.FileSystemLoader(searchpath=template_directory) + + env_parameters = dict( + loader=loader, + undefined=jinja2.StrictUndefined + ) + environment = jinja2.Environment(**env_parameters) + + test_case_directory = os.path.join(os.path.dirname(__file__), '..', 'tests', test_case_name) + + os.mkdir(test_case_directory) + + examples = examples_for_type(test_case_type) + + variables = dict(type = test_case_type, name = test_case_name, examples = examples) + + generate(environment, variables, '.clang-uml', '.clang-uml', test_case_directory) + generate(environment, variables, 't00000.cc', f'{test_case_name}.cc', test_case_directory) + generate(environment, variables, 'test_case.h', 'test_case.h', test_case_directory) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/util/templates/test_cases/.clang-uml b/util/templates/test_cases/.clang-uml new file mode 100644 index 00000000..4e1e2749 --- /dev/null +++ b/util/templates/test_cases/.clang-uml @@ -0,0 +1,10 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + {{ name }}_{{ type }}: + type: {{ type }} + glob: + - ../../tests/{{ name }}/{{ name }}.cc + include: + namespaces: + - clanguml::{{ name }} \ No newline at end of file diff --git a/util/templates/test_cases/t00000.cc b/util/templates/test_cases/t00000.cc new file mode 100644 index 00000000..94401c8f --- /dev/null +++ b/util/templates/test_cases/t00000.cc @@ -0,0 +1,5 @@ +namespace clanguml { +namespace {{ name }} +{ +} +} diff --git a/util/templates/test_cases/test_case.h b/util/templates/test_cases/test_case.h new file mode 100644 index 00000000..7f10d637 --- /dev/null +++ b/util/templates/test_cases/test_case.h @@ -0,0 +1,41 @@ +/** + * tests/{{ name }}/test_case.h + * + * Copyright (c) 2021-2022 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +TEST_CASE("{{ name }}", "[test-case][{{ type }}]") +{ + auto [config, db] = load_config("{{ name }}"); + + auto diagram = config.diagrams["{{ name }}_{{ type }}"]; + + REQUIRE(diagram->name == "{{ name }}_{{ type }}"); + + auto model = generate_{{ type }}_diagram(db, diagram); + + REQUIRE(model->name() == "{{ name }}_{{ type }}"); + + auto puml = generate_{{ type }}_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + {{ examples }} + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} From 4b8a727cdaee8aa1fac32c037f94f67d1230c4f3 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 21 Jun 2022 21:53:26 +0200 Subject: [PATCH 08/16] Updated cppast ref --- thirdparty/cppast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/cppast b/thirdparty/cppast index fec53b1e..2c3c5d6c 160000 --- a/thirdparty/cppast +++ b/thirdparty/cppast @@ -1 +1 @@ -Subproject commit fec53b1e99e8c4358811d9d0571e488058620386 +Subproject commit 2c3c5d6c4f1351941a0474b75e318e1d0bef412f From 11b558b7c2c3f7b21e31e9d71d563f7bc220b1c4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 21 Jun 2022 21:54:10 +0200 Subject: [PATCH 09/16] Updated test case to check for std::uint8_t type detection --- tests/t00046/t00046.cc | 4 ++++ tests/t00046/test_case.h | 1 + 2 files changed, 5 insertions(+) diff --git a/tests/t00046/t00046.cc b/tests/t00046/t00046.cc index 3d8da7c2..3af06b22 100644 --- a/tests/t00046/t00046.cc +++ b/tests/t00046/t00046.cc @@ -1,3 +1,6 @@ +#include +#include + class A { }; @@ -32,6 +35,7 @@ public: ns1::A *ns1_a; ns1::ns2::A *ns1_ns2_a; ::A *root_a; + std::vector i; void foo(::AA &aa) { (void)aa; } }; diff --git a/tests/t00046/test_case.h b/tests/t00046/test_case.h index a15aedd4..73079f35 100644 --- a/tests/t00046/test_case.h +++ b/tests/t00046/test_case.h @@ -41,6 +41,7 @@ TEST_CASE("t00046", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("E"))); REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(puml, IsField("i", "std::vector")); save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); } From 5119079b69153a55e3d745a356eb0cc258c17d8a Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 21 Jun 2022 22:02:49 +0200 Subject: [PATCH 10/16] Removed constructor and destructor static prefix --- src/class_diagram/visitor/translation_unit_visitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 0bdb8499..cb795653 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -1101,7 +1101,7 @@ void translation_unit_visitor::process_constructor( m.is_virtual(false); m.is_const(false); m.is_defaulted(false); - m.is_static(true); + m.is_static(false); if (mf.comment().has_value()) m.set_comment(mf.comment().value()); @@ -1133,7 +1133,7 @@ void translation_unit_visitor::process_destructor( m.is_virtual(cppast::is_virtual(mf.virtual_info())); m.is_const(false); m.is_defaulted(false); - m.is_static(true); + m.is_static(false); if (mf.comment().has_value()) m.set_comment(mf.comment().value()); From 824c6ff5fe773dadd00e1dfb942a69c16068acbc Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 22 Jun 2022 22:16:36 +0200 Subject: [PATCH 11/16] Disable verbose make --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eb2b75d..9d5de4c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD 17) -set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_VERBOSE_MAKEFILE OFF) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") From 934a8edbbf5b66e8625a5695a7b606b337af6aa3 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 22 Jun 2022 22:16:53 +0200 Subject: [PATCH 12/16] Updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce9a1c15..ff6faae8 100644 --- a/README.md +++ b/README.md @@ -426,7 +426,7 @@ exclude: namespaces: - clanguml::common::detail # and also exclude ClassF - exclude: + elements: - clanguml::common::ClassF ``` From 96534f8e421d8f7b79e0a4c3a1623ddcd0cf62a7 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 22 Jun 2022 23:11:31 +0200 Subject: [PATCH 13/16] Fixed friend class root namespace handling --- .../visitor/translation_unit_visitor.cc | 14 ++++++++++++-- tests/t00045/t00045.cc | 14 ++++++++++++++ tests/t00045/test_case.h | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index cb795653..05ec6880 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -1384,7 +1384,7 @@ void translation_unit_visitor::process_friend(const cppast::cpp_friend &f, r.set_destination(name); } else if (f.entity()) { - std::string name; + std::string name = f.entity().value().name(); if (f.entity().value().kind() == cppast::cpp_entity_kind::class_template_t) { @@ -1411,7 +1411,17 @@ void translation_unit_visitor::process_friend(const cppast::cpp_friend &f, cppast::is_templated(f.entity().value()), cppast::to_string(f.entity().value().kind())); - name = cx::util::full_name(ctx.get_namespace(), f.entity().value()); + const auto &maybe_definition = + cppast::get_definition(ctx.entity_index(), f.entity().value()); + + if (maybe_definition.has_value()) { + const auto &friend_class = maybe_definition.value(); + + auto entity_ns = + common::model::namespace_{cx::util::ns(friend_class)}; + + name = cx::util::full_name(entity_ns, f.entity().value()); + } } if (!ctx.diagram().should_include(ctx.get_namespace(), name)) diff --git a/tests/t00045/t00045.cc b/tests/t00045/t00045.cc index 3d8da7c2..6ef0cbda 100644 --- a/tests/t00045/t00045.cc +++ b/tests/t00045/t00045.cc @@ -4,6 +4,13 @@ class A { class AA { }; +class AAA { +}; + +template class AAAA { + T t; +}; + namespace ns1 { class A { @@ -26,6 +33,9 @@ class D : public ns1::ns2::A { class E : public ::A { }; +class AAA { +}; + class R { public: A *a; @@ -33,6 +43,10 @@ public: ns1::ns2::A *ns1_ns2_a; ::A *root_a; + friend ::AAA; + // TODO: + // template friend class ::AAAA; + void foo(::AA &aa) { (void)aa; } }; } diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h index e7087fb9..30a7351c 100644 --- a/tests/t00045/test_case.h +++ b/tests/t00045/test_case.h @@ -58,6 +58,12 @@ TEST_CASE("t00045", "[test-case][class]") REQUIRE_THAT(puml, IsDependency(_A("ns1::ns2::R"), _A("AA"))); + REQUIRE_THAT(puml, IsFriend(_A("ns1::ns2::R"), _A("AAA"))); + REQUIRE_THAT( + puml, !IsFriend(_A("ns1::ns2::R"), _A("ns1::ns2::AAA"))); + // TODO: + // REQUIRE_THAT(puml, IsFriend(_A("ns1::ns2::R"), _A("AAAA"))); + save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); } From 345619123b262df0dc04aaffdf754f32843cbfc3 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 24 Jun 2022 15:51:26 +0200 Subject: [PATCH 14/16] Updated README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ff6faae8..a15cae97 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Nowadays, this file can be generated rather easily using multiple methods: as `cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ...` * For Make projects checkout [compiledb](https://github.com/nickdiego/compiledb) or [Bear](https://github.com/rizsotto/Bear) * For Boost-based projects try [commands_to_compilation_database](https://github.com/tee3/commands_to_compilation_database) + * For SCons, invoke `compilation_db` tool (requires SCons > 4.0.0) ### Invocation By default, `config-uml` will assume that the configuration file `.clang-uml` From be22fde24ac619219ca4f99f1204441fe947c178 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 24 Jun 2022 15:53:29 +0200 Subject: [PATCH 15/16] Updated CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e563e6ef..198533aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # CHANGELOG +### + * Fixed root namespace handling (#45) + * Removed `static` prefix from constructors + ### 0.1.0 * Initial release \ No newline at end of file From c42a49e95b2d4dc2561238d46dd94c933310261a Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 24 Jun 2022 15:54:15 +0200 Subject: [PATCH 16/16] Updated test cases documentation --- docs/test_cases/t00002_class.svg | 68 ++++----- docs/test_cases/t00003_class.svg | 120 +++++++-------- docs/test_cases/t00004_class.svg | 26 ++-- docs/test_cases/t00005_class.svg | 110 +++++++------- docs/test_cases/t00006_class.svg | 132 ++++++++-------- docs/test_cases/t00007_class.svg | 30 ++-- docs/test_cases/t00008_class.svg | 64 ++++---- docs/test_cases/t00009_class.svg | 32 ++-- docs/test_cases/t00010_class.svg | 34 ++--- docs/test_cases/t00011_class.svg | 30 ++-- docs/test_cases/t00012_class.svg | 66 ++++---- docs/test_cases/t00013_class.svg | 130 ++++++++-------- docs/test_cases/t00014_class.svg | 114 +++++++------- docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 22 +-- docs/test_cases/t00017_class.svg | 72 ++++----- docs/test_cases/t00018_class.svg | 76 +++++----- docs/test_cases/t00019_class.svg | 88 +++++------ docs/test_cases/t00020_class.svg | 98 ++++++------ docs/test_cases/t00021_class.svg | 86 +++++------ docs/test_cases/t00022_class.svg | 42 +++--- docs/test_cases/t00023_class.svg | 58 +++---- docs/test_cases/t00024_class.svg | 66 ++++---- docs/test_cases/t00025_class.svg | 64 ++++---- docs/test_cases/t00026_class.svg | 82 +++++----- docs/test_cases/t00027_class.svg | 84 +++++------ docs/test_cases/t00028_class.svg | 96 ++++++------ docs/test_cases/t00029_class.svg | 50 +++--- docs/test_cases/t00030_class.svg | 38 ++--- docs/test_cases/t00031_class.svg | 50 +++--- docs/test_cases/t00032_class.svg | 52 +++---- docs/test_cases/t00033_class.svg | 48 +++--- docs/test_cases/t00034_class.svg | 46 +++--- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 ++--- docs/test_cases/t00037_class.svg | 44 +++--- docs/test_cases/t00038_class.svg | 54 +++---- docs/test_cases/t00039_class.svg | 78 +++++----- docs/test_cases/t00040_class.svg | 38 ++--- docs/test_cases/t00041_class.svg | 50 +++--- docs/test_cases/t00042_class.svg | 22 +-- docs/test_cases/t00043_class.svg | 90 +++++------ docs/test_cases/t00044_class.svg | 30 ++-- docs/test_cases/t00045.md | 14 ++ docs/test_cases/t00045_class.svg | 235 +++++++++++++++++------------ docs/test_cases/t00046.md | 4 + docs/test_cases/t00046_class.svg | 217 +++++++++++++------------- docs/test_cases/t30001_package.svg | 54 +++---- docs/test_cases/t30002_package.svg | 112 +++++++------- docs/test_cases/t30003_package.svg | 28 ++-- docs/test_cases/t30004_package.svg | 38 ++--- docs/test_cases/t30005_package.svg | 42 +++--- docs/test_cases/t30006_package.svg | 22 +-- docs/test_cases/t30007_package.svg | 26 ++-- docs/test_cases/t30008_package.svg | 42 +++--- docs/test_cases/t40001_include.svg | 46 +++--- docs/test_cases/t40002_include.svg | 44 +++--- docs/test_cases/t40003_include.svg | 66 ++++---- 58 files changed, 1857 insertions(+), 1795 deletions(-) diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index 56ebfcb1..254d72fb 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,123 +9,123 @@ - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - - + + E - + - + as : std::vector<A*> - + - + foo_a() : void - + - + foo_c() : void - + This is class A - + This is class B - + This is class D which is a little like B diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index e1f46e2f..16fb5bc5 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,194 +9,194 @@ - - + + A - + - + public_member : int - + - + static_int : int - + - + static_const_int : int const - + - + auto_member : unsigned long const - + - + protected_member : int - + - + private_member : int - + - + a : int - + - + b : int - + - + c : int - + - - A() : void + + A() : void - + - - A(int i) : void + + A(int i) : void - + - - A(A&& ) : void + + A(A&& ) : void - + - - A(A const& ) : void + + A(A const& ) : void - + - - ~A() : void + + ~A() : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + double_int(int const i) : int - + - + sum(double const a, double const b) : double - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool(int const)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 290be35b..6a9563ba 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,38 +9,38 @@ - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + AA - - + + Lights @@ -50,8 +50,8 @@ Red - - + + AAA diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index f28a9846..d6c99079 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - + a : A - + - + b : B* - + - + c : C& - + - + d : D const* - + - + e : E const& - + - + f : F&& - + - + g : G** - + - + h : H*** - + - + i : I*& - + - + j : J volatile* - + - + k : K* diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 5ce99107..432a00df 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B*> - + - + c : std::map<int,C> - + - + d : std::map<int,D*> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G*>> - + - + h : std::array<H,10> - + - + i : std::array<I*,5> - + - + j : J[10] - + - + k : K*[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 0e786bcf..1378af33 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index c24a6939..5c10a00a 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T* - + - + reference : T& - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,33 +103,33 @@ int,Vector - - + + D - + - + ints : B<int,Vector> - + - + D(std::tuple<Items...>* ) : void - + - + add(int i) : void diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 975cabb1..31d3c3ce 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string>* - + - + avector : A<std::vector<std::string>>& diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 2071f128..1046597e 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 62a52fb4..04cf83d2 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,49 +18,49 @@ T - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + m_a : A* - + - + foo() : void diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 206bde74..c1fb3b94 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index e5e7a891..acbd03e4 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,83 +18,83 @@ T - + - + f : T - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int - + - + print(R* r) : void - - + + E @@ -102,16 +102,16 @@ T - + - + e : T - - + + G @@ -119,22 +119,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -142,7 +142,7 @@ int - + F @@ -150,7 +150,7 @@ int - + G @@ -158,7 +158,7 @@ int,float,std::string - + E @@ -166,103 +166,103 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> - + - + get_a(A* a) : int - + - + get_b(B& b) : int - + - + get_const_b(B const& b) : int - + - + get_c(C c) : int - + - + get_d(D&& d) : int - + - + get_d2(D&& d) : int - + - + get_e(E<T> e) : T - + - + get_int_e(E<int> const& e) : int - + - + get_int_e2(E<int>& e) : int - + - + get_f(F<T> const& f) : T - + - + get_int_f(F<int> const& f) : int diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 4d76fe1f..0e2866a6 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,bool - + A @@ -96,7 +96,7 @@ double,bool - + A @@ -104,7 +104,7 @@ long,float - + A @@ -112,7 +112,7 @@ double,float - + A @@ -120,7 +120,7 @@ bool,std::string - + A @@ -128,7 +128,7 @@ float,std::unique_ptr<std::string> - + A @@ -136,7 +136,7 @@ int,std::string - + A @@ -144,7 +144,7 @@ std::string,std::string - + A @@ -152,7 +152,7 @@ char,std::string - + A @@ -160,116 +160,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index d6eeb769..7bf579f5 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 7f171133..dfbfb93b 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -31,8 +31,8 @@ value : enum - - + + is_numeric @@ -43,8 +43,8 @@ value : enum - - + + is_numeric @@ -55,8 +55,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 5ebcd126..db62f262 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int* - + - + some_int_pointer_pointer : int** - + - + some_int_reference : int& - + - - R(int& some_int, C& cc, E const& ee, F&& ff, I*& ii) : void + + R(int& some_int, C& cc, E const& ee, F&& ff, I*& ii) : void diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 2dfd61c8..ba7283f7 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - - + + impl::widget - + - + n : int - + - + draw(widget const& w) const : void - + - + draw(widget const& w) : void - + - - widget(int n) : void + + widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - - widget(int ) : void + + widget(int ) : void - + - - ~widget() : void + + ~widget() : void - + - - widget(widget&& ) : void + + widget(widget&& ) : void - + - - widget(widget const& ) : void + + widget(widget const& ) : void - + - + operator=(widget&& ) : widget& - + - + operator=(widget const& ) : widget& diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 42387c90..c4ecc0cc 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Layer2 @@ -19,51 +19,51 @@ - + - + all_calls_count() const : int - - + + Base - + - - Base() : void + + Base() : void - + - - ~Base() : void + + ~Base() : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -72,22 +72,22 @@ - + - + m1() : int - + - + m2() : std::string - - + + Layer3 @@ -95,50 +95,50 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int - + - + m1() : int - + - + m2() : std::string - + - + m1_calls() const : int - + - + m2_calls() const : int - + Layer3 @@ -146,7 +146,7 @@ Base - + Layer2 @@ -154,7 +154,7 @@ Layer3<Base> - + Layer1 @@ -162,18 +162,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 47002417..9cef149e 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,174 +9,174 @@ - - + + ProductA - + - - ~ProductA() : void + + ~ProductA() : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - - ~ProductB() : void + + ~ProductB() : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 423c088c..517a3034 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,151 +9,151 @@ - - + + Visitor - + - - ~Visitor() : void + + ~Visitor() : void - + - + visit_A(A const& item) const = 0 : void - + - + visit_B(B const& item) const = 0 : void - - + + Visitor1 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor2 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Visitor3 - + - + visit_A(A const& item) const : void - + - + visit_B(B const& item) const : void - - + + Item - + - - ~Item() : void + + ~Item() : void - + - + accept(Visitor const& visitor) const = 0 : void - - + + A - + - + accept(Visitor const& visitor) const : void - - + + B - + - + accept(Visitor const& visitor) const : void diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 1362e2ff..0fd3d41d 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,77 +9,77 @@ - - + + A - + - + template_method() : void - + - + method1() = 0 : void - + - + method2() = 0 : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index bbfc2598..35c23a4d 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + Strategy - + - - ~Strategy() : void + + ~Strategy() : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> - + - - Context(std::unique_ptr<Strategy> strategy) : void + + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 516441e1..01e0c4be 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + Target - + - - ~Target() : void + + ~Target() : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> - + - - Proxy(std::shared_ptr<Target> target) : void + + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index becd62c3..868f1af7 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,36 +62,36 @@ T - + - + m_target : std::shared_ptr<T> - + - - Proxy(std::shared_ptr<T> target) : void + + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + Proxy @@ -99,7 +99,7 @@ Target1 - + Proxy @@ -107,25 +107,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index ad7de371..ecefd172 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,30 +18,30 @@ T - + - + m_value : T - + - - Memento(T&& v) : void + + Memento(T&& v) : void - + - + value() const : T - - + + Originator @@ -49,51 +49,51 @@ T - + - + m_value : T - + - - Originator(T&& v) : void + + Originator(T&& v) : void - + - + memoize_value() const : Memento<T> - + - + load(Memento<T> const& m) : void - + - + print() const : void - + - + set(T&& v) : void - - + + Caretaker @@ -101,29 +101,29 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - + - + state(std::string const& n) : Memento<T>& - + - + set_state(std::string const& s, Memento<T>&& m) : void - + Caretaker @@ -131,7 +131,7 @@ std::string - + Originator @@ -139,25 +139,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 33f1dc9f..13ce6e7f 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Shape - + - + display() = 0 : void - + - - ~Shape() : void + + ~Shape() : void - - + + Line @@ -41,15 +41,15 @@ - + - + display() : void - - + + Text @@ -58,30 +58,30 @@ - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -90,15 +90,15 @@ - + - + display() : void - - + + Weight @@ -107,14 +107,14 @@ - + - + display() : void - + Line @@ -122,7 +122,7 @@ Color,Weight - + Line @@ -130,7 +130,7 @@ Color - + Text @@ -138,7 +138,7 @@ Color,Weight - + Text @@ -146,39 +146,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 7f5a38e4..ca0941e1 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,68 +9,68 @@ - - + + A - + A class note. - + A class note. - - + + B - + B class note. - + B class note. - - + + C - + C class note. - + C class note. - - + + D - + D class note. - + D class note. - - + + E @@ -78,27 +78,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -108,13 +108,13 @@ three - + F enum note. - + F enum note. - + E @@ -122,67 +122,67 @@ int - - + + R - + - + aaa : A - + - + bbb : B* - + - + ccc : C& - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G** - + - - R(C& c) : void + + R(C& c) : void - + R class note. - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 715e98bb..a4566b70 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3& - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 579b4ce4..f07103f5 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,71 +9,71 @@ - - + + A - - + + B - - + + C - - + + D - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index 39a7663b..0882f265 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A* - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D* diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index edc023be..c7701f06 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -79,15 +79,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -95,18 +95,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index dec9c5a5..abac44ae 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index fa290d8f..cc45d72c 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator==(Void const& ) const : bool - + - + operator!=(Void const& ) const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,33 +71,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A>* - + - + lv : lift_void_t<void>* diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 0a289ac4..90d8b83a 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index ceff5f2d..df8ed6d0 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 8ebf2ec2..e373aac2 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - + + ST - + - + dimensions : «anonymous» - - + + <<anonymous>> - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + A - + - + st : ST - + - - A() : void + + A() : void diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index 63a1f81b..d4dac5da 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index a52c0cab..4fdb9e55 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B* - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T* - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M* - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M* - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N* diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 0e025ced..36c2e202 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,71 +9,71 @@ - - + + A - + - + ii_ : int - + - + get_a() : int - - + + AA - - + + AAA - + - + b : B* - + - + get_aaa() : int - - + + R - + - + foo(A* a) : void diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 3038a842..203c2289 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,93 +9,93 @@ - - + + R - - + + D - + - + rr : RR* - - + + E - - + + F - - + + RR - + - + e : E* - + - + f : F* - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 55ebf75f..a77f41d6 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + B @@ -35,18 +35,18 @@ T,K - + - + b : T - + - + bb : K diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index b6cf6cb6..bfa8e273 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,168 +9,168 @@ - + dependants - + dependencies - - + + A - - + + B - + - + b(dependants::A* a) : void - - + + BB - + - + bb(dependants::A* a) : void - - + + C - + - + c(dependants::B* b) : void - - + + D - + - + d(dependants::C* c) : void - + - + dd(dependants::BB* bb) : void - - + + E - + - + e(dependants::D* d) : void - - + + G - - + + GG - - + + H - + - + h(dependencies::G* g) : void - + - + hh(dependencies::GG* gg) : void - - + + I - + - + i(dependencies::H* h) : void - - + + J - + - + i(dependencies::I* i) : void diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 33d2236b..067865fc 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + sink @@ -19,8 +19,8 @@ - - + + signal_handler @@ -29,8 +29,8 @@ - - + + sink @@ -38,29 +38,29 @@ Ret,Args...,A - + - + signal : signal_t* - + - - sink(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2>>::signal_t& sh) : void + + sink(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2>>::signal_t& sh) : void - + signal_handler - - + + signal_handler diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md index 50268500..0ef54a70 100644 --- a/docs/test_cases/t00045.md +++ b/docs/test_cases/t00045.md @@ -21,6 +21,13 @@ class A { class AA { }; +class AAA { +}; + +template class AAAA { + T t; +}; + namespace ns1 { class A { @@ -43,6 +50,9 @@ class D : public ns1::ns2::A { class E : public ::A { }; +class AAA { +}; + class R { public: A *a; @@ -50,6 +60,10 @@ public: ns1::ns2::A *ns1_ns2_a; ::A *root_a; + friend ::AAA; + // TODO: + // template friend class ::AAAA; + void foo(::AA &aa) { (void)aa; } }; } diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index c66c7c16..86f29a53 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,137 +9,174 @@ - - + + A - - + + AA - - - - - ns1::A - - + + + + + AAA + + - - - - - ns1::ns2::A - - + + + + + AAAA + + T + - - - - - ns1::ns2::B - - + + + - - - - - ns1::ns2::C - - + + t : T - - - - - ns1::ns2::D - - + + + + + + ns1::A + + - - + + + + + ns1::ns2::A + + + + + + + + ns1::ns2::B + + + + + + + + ns1::ns2::C + + + + + + + + ns1::ns2::D + + + + + ns1::ns2::E - - - - - ns1::ns2::R - + + + + + ns1::ns2::AAA + + - - - + + + + + ns1::ns2::R + - - a : ns1::ns2::A* + + + - - - + + a : ns1::ns2::A* - - ns1_a : ns1::A* + + + - - - + + ns1_a : ns1::A* - - ns1_ns2_a : ns1::ns2::A* + + + - - - + + ns1_ns2_a : ns1::ns2::A* - - root_a : ::A* + + + - - - - + + root_a : ::A* - - foo(AA& aa) : void + + + + - - - - - - - + + foo(AA& aa) : void + + + + + + + + - - - +a - - - - ns1_ns2_a - - - - ns1_a - - - - root_a - - + + + +a + + + + ns1_ns2_a + + + + ns1_a + + + + root_a + + + + «friend» + + diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md index 60c76d94..eb9f9db9 100644 --- a/docs/test_cases/t00046.md +++ b/docs/test_cases/t00046.md @@ -16,6 +16,9 @@ diagrams: ## Source code File t00046.cc ```cpp +#include +#include + class A { }; @@ -50,6 +53,7 @@ public: ns1::A *ns1_a; ns1::ns2::A *ns1_ns2_a; ::A *root_a; + std::vector i; void foo(::AA &aa) { (void)aa; } }; diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 0a7f9082..9b13c8c0 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,143 +9,150 @@ - + ns1 - + ns2 - - - - - A - - + + + + + A + + - - - - - A - - + + + + + A + + - - - - - B - - + + + + + B + + - - - - - C - - + + + + + C + + - - - - - D - - + + + + + D + + - - - - - E - - + + + + + E + + - - - - - R - + + + + + R + - + - + a : ns1::ns2::A* - + - + ns1_a : ns1::A* - + - + ns1_ns2_a : ns1::ns2::A* - + - + root_a : ::A* - - - - + + + - - foo(AA& aa) : void + + i : std::vector<std::uint8_t> - - - - - A - - + + + + - - - - - AA - - + + foo(AA& aa) : void - - - - - - - - - - - +a - - - - ns1_ns2_a - - - - ns1_a - - - - root_a - - + + + + + A + + + + + + + + AA + + + + + + + + + + + + + + +a + + + + ns1_ns2_a + + + + ns1_a + + + + root_a + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index fb7ffafc..bb931bba 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,67 +9,67 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B - - - + + + diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index d6b02816..ae16c0d0 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + BBB - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 4586b637..64d91d3d 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 - + diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index c9c3d7bd..f25bfb47 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE - - - - + + + + diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index 7c5a6e16..c931151f 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC - + - + diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index b66db0a6..19b8d404 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - - + + B - - + + A - - + + C - + Top A note. - - + + - + diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 437b40d9..a9e74825 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,33 +9,33 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. - - + + - + diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 33ffb566..18e07f28 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - + - + - + - + diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index b9ac57bd..5d5d3bce 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + cppast/cpp_preprocessor.hpp - + This is a lib1 include dir - + This is a t40001_include1.h include file - + - + - + - + - + - + - - + + diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 16edbe07..58be2c91 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,58 +9,58 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h - + - + - + - + - + diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 867916c1..53e73ed2 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,84 +9,84 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc - + - + - + - + - + - + - + - +