Fixed formatting

This commit is contained in:
Bartek Kryza
2022-07-31 00:42:13 +02:00
parent 37757b2ccc
commit dd85cfc19b
23 changed files with 76 additions and 64 deletions

View File

@@ -107,8 +107,8 @@ private:
namespace std {
template <>
struct hash<std::reference_wrapper<
const clanguml::class_diagram::model::class_>> {
struct hash<
std::reference_wrapper<const clanguml::class_diagram::model::class_>> {
std::size_t operator()(const std::reference_wrapper<
const clanguml::class_diagram::model::class_> &key) const
{

View File

@@ -144,7 +144,8 @@ private:
const clang::TemplateSpecializationType &template_instantiation_type);
void process_unexposed_template_specialization_parameters(
const std::string &tspec, clanguml::class_diagram::model::template_parameter &tp,
const std::string &tspec,
clanguml::class_diagram::model::template_parameter &tp,
clanguml::class_diagram::model::class_ &c);
bool find_relationships_in_unexposed_template_params(

View File

@@ -67,7 +67,8 @@ public:
return false;
}
virtual bool should_include(const namespace_ &ns, const std::string &name) const;
virtual bool should_include(
const namespace_ &ns, const std::string &name) const;
private:
std::string name_;

View File

@@ -34,8 +34,6 @@ namespace clanguml::common::model {
class element : public diagram_element, public source_location {
public:
element(const namespace_ &using_namespace);
virtual ~element() = default;

View File

@@ -52,7 +52,8 @@ void generator::generate_relationships(
// },
// [&f, &ostr](const auto &r) {
// ostr << f.alias() << " "
// << plantuml_common::to_plantuml(r.type(), r.style()) << " "
// << plantuml_common::to_plantuml(r.type(), r.style())
// << " "
// << r.destination() << '\n';
// });
// }

View File

@@ -43,6 +43,7 @@ public:
void operator()(const cppast::cpp_entity &file);
void finalize() { }
private:
clang::SourceManager &source_manager_;

View File

@@ -106,8 +106,7 @@ int main(int argc, const char *argv[])
std::string err{};
auto db =
clang::tooling::CompilationDatabase::autoDetectFromDirectory(
auto db = clang::tooling::CompilationDatabase::autoDetectFromDirectory(
config.compilation_database_dir(), err);
if (!err.empty()) {

View File

@@ -39,7 +39,8 @@ void generator::generate_relationships(
for (const auto &r : p.relationships()) {
std::stringstream relstr;
try {
relstr << p.alias() << " ..> "
relstr << p.alias()
<< " ..> "
//<< m_model.get_ to_alias(uns.relative(r.destination()))
<< '\n';
ostr << relstr.str();

View File

@@ -41,6 +41,7 @@ public:
const clanguml::config::package_diagram &config);
void finalize() { }
private:
clang::SourceManager &source_manager_;

View File

@@ -22,7 +22,6 @@
#include "cx/util.h"
#include "translation_unit_context.h"
namespace clanguml::sequence_diagram::visitor {
translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
@@ -34,7 +33,6 @@ translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
{
}
/*
void translation_unit_visitor::process_activities(const cppast::cpp_function &e)
{

View File

@@ -34,6 +34,7 @@ public:
const clanguml::config::sequence_diagram &config);
void finalize() { }
private:
clang::SourceManager &source_manager_;

View File

@@ -84,9 +84,11 @@ TEST_CASE("t00014", "[test-case][class]")
REQUIRE_THAT(puml,
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>")));
// 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>")));
// IsInstantiation(_A("A<T,std::string>"),
// _A("A<wchar_t,std::string>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("A<T,std::unique_ptr<std::string>>"),
@@ -109,7 +111,8 @@ TEST_CASE("t00014", "[test-case][class]")
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<wchar_t,std::string>")));
// REQUIRE_THAT(puml, IsDependency(_A("R"),
// _A("A<wchar_t,std::string>")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);

View File

@@ -46,8 +46,8 @@ TEST_CASE("t00016", "[test-case][class]")
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<bool>")));
REQUIRE_THAT(
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<char>")));
REQUIRE_THAT(puml,
IsInstantiation(_A("is_numeric<>"), _A("is_numeric<float>")));
REQUIRE_THAT(
puml, IsInstantiation(_A("is_numeric<>"), _A("is_numeric<float>")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);

View File

@@ -48,7 +48,8 @@ TEST_CASE("t00017", "[test-case][class]")
REQUIRE_THAT(puml, (IsField<Private>("some_int", "int")));
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer", "int *")));
REQUIRE_THAT(puml, (IsField<Private>("some_int_pointer_pointer", "int **")));
REQUIRE_THAT(
puml, (IsField<Private>("some_int_pointer_pointer", "int **")));
// Relationship members should not be rendered as part of this testcase
REQUIRE_THAT(puml, !(IsField<Private>("a", _A("A"))));

View File

@@ -47,10 +47,8 @@ TEST_CASE("t00025", "[test-case][class]")
puml, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1"));
REQUIRE_THAT(
puml, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2"));
REQUIRE_THAT(
puml, IsDependency(_A("Proxy<Target1>"), _A("Target1")));
REQUIRE_THAT(
puml, IsDependency(_A("Proxy<Target2>"), _A("Target2")));
REQUIRE_THAT(puml, IsDependency(_A("Proxy<Target1>"), _A("Target1")));
REQUIRE_THAT(puml, IsDependency(_A("Proxy<Target2>"), _A("Target2")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);

View File

@@ -4,15 +4,20 @@
namespace clanguml {
namespace t00030 {
class A { };
class A {
};
class B { };
class B {
};
class C { };
class C {
};
class D { };
class D {
};
class E { };
class E {
};
struct R {
/// @uml{association[]}

View File

@@ -25,7 +25,8 @@ namespace ns2 {
namespace ns22 {
// TODO: Fix for incomplete struct C declaration "struct C;"
struct C {};
struct C {
};
}
}

View File

@@ -32,7 +32,8 @@ struct key_t {
std::string key;
};
template <typename T> struct map {};
template <typename T> struct map {
};
using namespace thirdparty::ns1;

View File

@@ -37,8 +37,8 @@
#include "catch.h"
#include <clang/Tooling/Tooling.h>
#include <clang/Tooling/CompilationDatabase.h>
#include <clang/Tooling/Tooling.h>
#include <algorithm>
#include <complex>
@@ -52,7 +52,8 @@ using Catch::Matchers::StartsWith;
using Catch::Matchers::VectorContains;
using namespace clanguml::util;
std::pair<clanguml::config::config, std::unique_ptr<clang::tooling::CompilationDatabase>>
std::pair<clanguml::config::config,
std::unique_ptr<clang::tooling::CompilationDatabase>>
load_config(const std::string &test_name);
std::string generate_sequence_puml(