From f33f1ef2368b462e97163f20fd1d3812c6fc2114 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 31 Mar 2022 20:51:46 +0200 Subject: [PATCH] Extended subclass filter test with template inheritance --- tests/t00039/.clang-uml | 1 + tests/t00039/t00039.cc | 21 +++++++++++++++++++++ tests/t00039/test_case.h | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/tests/t00039/.clang-uml b/tests/t00039/.clang-uml index b81fa27f..89ff7ef5 100644 --- a/tests/t00039/.clang-uml +++ b/tests/t00039/.clang-uml @@ -11,5 +11,6 @@ diagrams: include: subclasses: - clanguml::t00039::A + - clanguml::t00039::ns3::F relationships: - inheritance \ No newline at end of file diff --git a/tests/t00039/t00039.cc b/tests/t00039/t00039.cc index 3aa60938..2944ed5e 100644 --- a/tests/t00039/t00039.cc +++ b/tests/t00039/t00039.cc @@ -1,3 +1,5 @@ +#include + namespace clanguml::t00039 { struct B { }; @@ -21,4 +23,23 @@ namespace ns2 { struct AAAA : public AAA { }; } // namespace ns2 + +namespace ns3 { +template struct F { + T *t; +}; + +template struct FF : public F { + M *m; +}; + +template struct FE : public F { + M *m; +}; + +template struct FFF : public FF { + N *n; +}; + +} // namespace ns3 } // namespace clanguml::t00039 diff --git a/tests/t00039/test_case.h b/tests/t00039/test_case.h index d80c6601..6a2caf2c 100644 --- a/tests/t00039/test_case.h +++ b/tests/t00039/test_case.h @@ -46,6 +46,11 @@ TEST_CASE("t00039", "[test-case][class]") REQUIRE_THAT(puml, !IsClass(_A("B"))); REQUIRE_THAT(puml, !IsClass(_A("ns1::BB"))); + REQUIRE_THAT(puml, IsClassTemplate("ns3::F", "T")); + REQUIRE_THAT(puml, IsClassTemplate("ns3::FF", "T,M")); + REQUIRE_THAT(puml, IsClassTemplate("ns3::FE", "T,M")); + REQUIRE_THAT(puml, IsClassTemplate("ns3::FFF", "T,M,N")); + save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); }