diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index a6999acd..2bb2e2b0 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -486,7 +486,7 @@ bool is_identifier(const std::string &t) bool is_keyword(const std::string &t) { - static std::vector keywords {"alignas", "alignof", "asm", + static std::vector keywords{"alignas", "alignof", "asm", "auto", "bool", "break", "case", "catch", "char", "char16_t", "char32_t", "class", "concept", "const", "constexpr", "const_cast", "continue", "decltype", "default", "delete", "do", "double", diff --git a/tests/t00062/t00062.cc b/tests/t00062/t00062.cc index 68b9da1f..d9ccd5ef 100644 --- a/tests/t00062/t00062.cc +++ b/tests/t00062/t00062.cc @@ -21,7 +21,7 @@ template struct A { M C::*m; }; -template struct A { +template struct A { C &&c; M C::*m; }; diff --git a/tests/t00062/test_case.h b/tests/t00062/test_case.h index 87028856..116dbc9c 100644 --- a/tests/t00062/test_case.h +++ b/tests/t00062/test_case.h @@ -35,41 +35,39 @@ TEST_CASE("t00062", "[test-case][class]") REQUIRE_THAT(puml, StartsWith("@startuml")); REQUIRE_THAT(puml, EndsWith("@enduml\n")); - - // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("AAA"))); - - // Check if class templates exist - //REQUIRE_THAT(puml, IsClassTemplate("A", "T,P,CMP,int N")); - - // Check concepts - //REQUIRE_THAT(puml, IsConcept(_A("AConcept"))); - //REQUIRE_THAT(puml, - // IsConceptRequirement( - // _A("AConcept"), "sizeof (T) > sizeof (P)")); + // Check if all classes exist + REQUIRE_THAT(puml, IsClass(_A("AAA"))); - // 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 class templates exist + // REQUIRE_THAT(puml, IsClassTemplate("A", "T,P,CMP,int N")); - // 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"), "-ag")); - //REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D"), "-ac")); - //REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F"), _A("F"))); + // Check concepts + // REQUIRE_THAT(puml, IsConcept(_A("AConcept"))); + // REQUIRE_THAT(puml, + // IsConceptRequirement( + // _A("AConcept"), "sizeof (T) > sizeof (P)")); + // 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"), "-ag")); + // REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D"), "-ac")); + // REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F"), _A("F"))); save_puml( config.output_directory() + "/" + diagram->name + ".puml", puml); @@ -82,5 +80,4 @@ TEST_CASE("t00062", "[test-case][class]") save_json(config.output_directory() + "/" + diagram->name + ".json", j); } - } \ No newline at end of file diff --git a/tests/test_model.cc b/tests/test_model.cc index 6e5521f0..6b075c19 100644 --- a/tests/test_model.cc +++ b/tests/test_model.cc @@ -292,8 +292,7 @@ TEST_CASE( tp1.set_method_template(true); tp1.add_template_param(template_parameter::make_template_type("Ret")); tp1.add_template_param(template_parameter::make_template_type("C")); - tp1.add_template_param( - template_parameter::make_template_type("Arg0")); + tp1.add_template_param(template_parameter::make_template_type("Arg0")); auto tp2 = template_parameter::make_template_type({}); tp2.set_method_template(true); @@ -309,8 +308,7 @@ TEST_CASE( tp1.set_method_template(true); tp1.add_template_param(template_parameter::make_template_type("Ret")); tp1.add_template_param(template_parameter::make_template_type("C")); - tp1.add_template_param( - template_parameter::make_template_type("Arg0")); + tp1.add_template_param(template_parameter::make_template_type("Arg0")); auto tp2 = template_parameter::make_template_type({}); tp2.set_method_template(true); diff --git a/tests/test_util.cc b/tests/test_util.cc index 450f20ed..406919c8 100644 --- a/tests/test_util.cc +++ b/tests/test_util.cc @@ -352,8 +352,7 @@ TEST_CASE("Test tokenize_unexposed_template_parameter", "[unit-test]") { int i = 0; - auto r = tokenize_unexposed_template_parameter( - "const ns1::ns2::A &"); + auto r = tokenize_unexposed_template_parameter("const ns1::ns2::A &"); CHECK(r[i++] == "const"); CHECK(r[i++] == "ns1::ns2::A"); CHECK(r[i++] == "&"); @@ -362,8 +361,7 @@ TEST_CASE("Test tokenize_unexposed_template_parameter", "[unit-test]") { int i = 0; - auto r = tokenize_unexposed_template_parameter( - "class ns1::ns2::A &"); + auto r = tokenize_unexposed_template_parameter("class ns1::ns2::A &"); CHECK(r[i++] == "ns1::ns2::A"); CHECK(r[i++] == "&"); } @@ -371,8 +369,7 @@ TEST_CASE("Test tokenize_unexposed_template_parameter", "[unit-test]") { int i = 0; - auto r = tokenize_unexposed_template_parameter( - "ns1::ns2::A C::* &&"); + auto r = tokenize_unexposed_template_parameter("ns1::ns2::A C::* &&"); CHECK(r[i++] == "ns1::ns2::A"); CHECK(r[i++] == "C"); CHECK(r[i++] == "::"); @@ -383,8 +380,7 @@ TEST_CASE("Test tokenize_unexposed_template_parameter", "[unit-test]") { int i = 0; - auto r = tokenize_unexposed_template_parameter( - "unsigned int"); + auto r = tokenize_unexposed_template_parameter("unsigned int"); CHECK(r[i++] == "unsigned"); CHECK(r[i++] == "int"); }