Fixed formatting

This commit is contained in:
Bartek Kryza
2023-04-23 19:29:46 +02:00
parent 192e1993e8
commit 3ed50ba3b2
5 changed files with 38 additions and 47 deletions

View File

@@ -486,7 +486,7 @@ bool is_identifier(const std::string &t)
bool is_keyword(const std::string &t)
{
static std::vector<std::string> keywords {"alignas", "alignof", "asm",
static std::vector<std::string> 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",

View File

@@ -21,7 +21,7 @@ template <typename M, typename C> struct A<M C::*> {
M C::*m;
};
template <typename M, typename C> struct A<M C::* &&> {
template <typename M, typename C> struct A<M C::*&&> {
C &&c;
M C::*m;
};

View File

@@ -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<T>")));
//REQUIRE_THAT(puml,
// IsConceptRequirement(
// _A("AConcept<T,P>"), "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<Public, Const>("foo")));
// Check if all fields exist
//REQUIRE_THAT(puml, (IsField<Private>("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<T>"), _A("F<int>")));
// Check concepts
// REQUIRE_THAT(puml, IsConcept(_A("AConcept<T>")));
// REQUIRE_THAT(puml,
// IsConceptRequirement(
// _A("AConcept<T,P>"), "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<Public, Const>("foo")));
// Check if all fields exist
// REQUIRE_THAT(puml, (IsField<Private>("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<T>"), _A("F<int>")));
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);
}
}

View File

@@ -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);

View File

@@ -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");
}