From dfd3fee444b3f97d5b72a0d1d3e64f6f47ad4f3c Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 24 Aug 2022 21:42:28 +0200 Subject: [PATCH] Fixed formatting --- src/common/generators/plantuml/generator.h | 4 +-- tests/t00014/test_case.h | 14 +++++------ tests/t00048/a_t00048.cc | 2 +- tests/t00048/a_t00048.h | 2 +- tests/t00048/b_t00048.cc | 2 +- tests/t00048/b_t00048.h | 2 +- tests/t00048/t00048.cc | 3 +-- tests/t00048/test_case.h | 29 ++++++++++------------ 8 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/common/generators/plantuml/generator.h b/src/common/generators/plantuml/generator.h index 5d262ea0..d8777295 100644 --- a/src/common/generators/plantuml/generator.h +++ b/src/common/generators/plantuml/generator.h @@ -263,8 +263,8 @@ public: visitor_.TraverseDecl(ast_context.getTranslationUnitDecl()); visitor_.finalize(); -// LOG_DBG("= Finalized translation unit: {}", -// ast_context.getTranslationUnitDecl()); + // LOG_DBG("= Finalized translation unit: {}", + // ast_context.getTranslationUnitDecl()); } }; diff --git a/tests/t00014/test_case.h b/tests/t00014/test_case.h index 5d7fbbb9..81c9f3dc 100644 --- a/tests/t00014/test_case.h +++ b/tests/t00014/test_case.h @@ -40,7 +40,7 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("A", "double,T")); // TODO: Figure out how to handle the same templates with different template // parameter names -// REQUIRE_THAT(puml, !IsClassTemplate("A", "long,U")); + // REQUIRE_THAT(puml, !IsClassTemplate("A", "long,U")); REQUIRE_THAT(puml, IsClassTemplate("A", "long,T")); REQUIRE_THAT(puml, IsClassTemplate("A", "long,bool")); REQUIRE_THAT(puml, IsClassTemplate("A", "double,bool")); @@ -48,7 +48,7 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("A", "double,float")); REQUIRE_THAT(puml, IsClassTemplate("A", "bool,std::string")); REQUIRE_THAT(puml, IsClassTemplate("A", "std::string,std::string")); - REQUIRE_THAT(puml, IsClassTemplate("A", "char,std::string")); + REQUIRE_THAT(puml, IsClassTemplate("A", "char,std::string")); REQUIRE_THAT(puml, IsClass(_A("B"))); REQUIRE_THAT(puml, IsField("bapair", "PairPairBA")); @@ -76,7 +76,8 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); -// REQUIRE_THAT(puml, !IsInstantiation(_A("A"), _A("A"))); + // REQUIRE_THAT(puml, !IsInstantiation(_A("A"), + // _A("A"))); REQUIRE_THAT( puml, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT( @@ -87,9 +88,8 @@ TEST_CASE("t00014", "[test-case][class]") IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, - IsInstantiation(_A("A"), - _A("A"))); + REQUIRE_THAT(puml, + IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT(puml, IsInstantiation(_A("A>"), @@ -111,7 +111,7 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("A>"), "-floatstring")); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); save_puml( diff --git a/tests/t00048/a_t00048.cc b/tests/t00048/a_t00048.cc index b67263bb..e98c50be 100644 --- a/tests/t00048/a_t00048.cc +++ b/tests/t00048/a_t00048.cc @@ -3,7 +3,7 @@ namespace clanguml { namespace t00048 { -void A::foo() {} +void A::foo() { } } } \ No newline at end of file diff --git a/tests/t00048/a_t00048.h b/tests/t00048/a_t00048.h index c130ca0f..26c57f7b 100644 --- a/tests/t00048/a_t00048.h +++ b/tests/t00048/a_t00048.h @@ -14,7 +14,7 @@ struct A : public Base { template struct ATemplate : public BaseTemplate { T a; - void foo() override {} + void foo() override { } }; } diff --git a/tests/t00048/b_t00048.cc b/tests/t00048/b_t00048.cc index 1897152e..582f5b6e 100644 --- a/tests/t00048/b_t00048.cc +++ b/tests/t00048/b_t00048.cc @@ -3,7 +3,7 @@ namespace clanguml { namespace t00048 { -void B::foo() {} +void B::foo() { } } } \ No newline at end of file diff --git a/tests/t00048/b_t00048.h b/tests/t00048/b_t00048.h index 95c14bb4..421289e3 100644 --- a/tests/t00048/b_t00048.h +++ b/tests/t00048/b_t00048.h @@ -14,7 +14,7 @@ struct B : public Base { template struct BTemplate : public BaseTemplate { T b; - void foo() override {} + void foo() override { } }; } diff --git a/tests/t00048/t00048.cc b/tests/t00048/t00048.cc index 22b281f8..347fb0e6 100644 --- a/tests/t00048/t00048.cc +++ b/tests/t00048/t00048.cc @@ -1,7 +1,6 @@ #include "t00048.h" namespace clanguml { -namespace t00048 -{ +namespace t00048 { } } \ No newline at end of file diff --git a/tests/t00048/test_case.h b/tests/t00048/test_case.h index a0575fd3..aeb8d00a 100644 --- a/tests/t00048/test_case.h +++ b/tests/t00048/test_case.h @@ -34,41 +34,38 @@ TEST_CASE("t00048", "[test-case][class]") REQUIRE_THAT(puml, StartsWith("@startuml")); REQUIRE_THAT(puml, EndsWith("@enduml\n")); - // Check if all classes exist REQUIRE_THAT(puml, IsAbstractClass(_A("Base"))); REQUIRE_THAT(puml, IsClass(_A("A"))); REQUIRE_THAT(puml, IsClass(_A("B"))); - // Check if class templates exist REQUIRE_THAT(puml, IsAbstractClassTemplate("BaseTemplate", "T")); REQUIRE_THAT(puml, IsClassTemplate("ATemplate", "T")); REQUIRE_THAT(puml, IsClassTemplate("BTemplate", "T")); // Check if all enums exist - //REQUIRE_THAT(puml, IsEnum(_A("Lights"))); - + // REQUIRE_THAT(puml, IsEnum(_A("Lights"))); + // Check if all inner classes exist - //REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("AA"))); + // REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("AA"))); // Check if all inheritance relationships exist REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("A"))); REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("B"))); // 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"))); + // 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"))); save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml);