Fixed formatting

This commit is contained in:
Bartek Kryza
2022-08-24 21:42:28 +02:00
parent e37d2d6683
commit dfd3fee444
8 changed files with 27 additions and 31 deletions

View File

@@ -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<Private>("bapair", "PairPairBA<bool>"));
@@ -76,7 +76,8 @@ TEST_CASE("t00014", "[test-case][class]")
REQUIRE_THAT(puml, IsInstantiation(_A("A<long,T>"), _A("A<long,bool>")));
REQUIRE_THAT(puml, IsInstantiation(_A("A<T,P>"), _A("A<long,T>")));
// REQUIRE_THAT(puml, !IsInstantiation(_A("A<long,T>"), _A("A<long,U>")));
// REQUIRE_THAT(puml, !IsInstantiation(_A("A<long,T>"),
// _A("A<long,U>")));
REQUIRE_THAT(
puml, IsInstantiation(_A("A<double,T>"), _A("A<double,float>")));
REQUIRE_THAT(
@@ -87,9 +88,8 @@ TEST_CASE("t00014", "[test-case][class]")
IsInstantiation(_A("A<T,std::string>"), _A("A<bool,std::string>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("A<T,std::string>"), _A("A<char,std::string>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("A<T,std::string>"),
_A("A<wchar_t,std::string>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("A<T,std::string>"), _A("A<wchar_t,std::string>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("A<T,std::unique_ptr<std::string>>"),
@@ -111,7 +111,7 @@ TEST_CASE("t00014", "[test-case][class]")
REQUIRE_THAT(puml,
IsAggregation(_A("R"), _A("A<float,std::unique_ptr<std::string>>"),
"-floatstring"));
REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<char,std::string>")));
REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<char,std::string>")));
REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A<wchar_t,std::string>")));
save_puml(

View File

@@ -3,7 +3,7 @@
namespace clanguml {
namespace t00048 {
void A::foo() {}
void A::foo() { }
}
}

View File

@@ -14,7 +14,7 @@ struct A : public Base {
template <typename T> struct ATemplate : public BaseTemplate<T> {
T a;
void foo() override {}
void foo() override { }
};
}

View File

@@ -3,7 +3,7 @@
namespace clanguml {
namespace t00048 {
void B::foo() {}
void B::foo() { }
}
}

View File

@@ -14,7 +14,7 @@ struct B : public Base {
template <typename T> struct BTemplate : public BaseTemplate<T> {
T b;
void foo() override {}
void foo() override { }
};
}

View File

@@ -1,7 +1,6 @@
#include "t00048.h"
namespace clanguml {
namespace t00048
{
namespace t00048 {
}
}

View File

@@ -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<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")));
//REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D")));
//REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F<T>"), _A("F<int>")));
// 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")));
// REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D")));
// REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F<T>"), _A("F<int>")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);