mirror of
https://github.com/bkryza/clang-uml.git
synced 2025-05-17 19:22:19 +08:00
Fixed formatting
This commit is contained in:
parent
31100af689
commit
fbe416b50e
@ -86,4 +86,4 @@ std::string render_name(std::string name)
|
||||
}
|
||||
|
||||
} // namespace generators::json
|
||||
} // namespace clanguml::common::model
|
||||
} // namespace clanguml::common
|
||||
|
@ -265,8 +265,10 @@ void generator::process_call_message(
|
||||
visited.push_back(m.from());
|
||||
|
||||
if (m.in_static_declaration_context()) {
|
||||
if (util::contains(already_generated_in_static_context_, m))
|
||||
if (util::contains(already_generated_in_static_context_, m)) {
|
||||
visited.pop_back();
|
||||
return;
|
||||
}
|
||||
|
||||
already_generated_in_static_context_.push_back(m);
|
||||
}
|
||||
|
@ -388,8 +388,7 @@ void generator::generate_participant(
|
||||
print_debug(class_participant, ostr);
|
||||
|
||||
auto participant_name =
|
||||
config().simplify_template_type(
|
||||
class_participant.full_name(false));
|
||||
config().simplify_template_type(class_participant.full_name(false));
|
||||
participant_name =
|
||||
config().using_namespace().relative(participant_name);
|
||||
|
||||
@ -534,7 +533,8 @@ void generator::generate_diagram(std::ostream &ostr) const
|
||||
if (from.value().type_name() == "method" ||
|
||||
config().combine_free_functions_into_file_participants()) {
|
||||
generate_participant(ostr, from_activity_id);
|
||||
ostr << "[->" << " " << generate_alias(from.value()) << " : "
|
||||
ostr << "[->"
|
||||
<< " " << generate_alias(from.value()) << " : "
|
||||
<< from.value().message_name(
|
||||
select_method_arguments_render_mode())
|
||||
<< '\n';
|
||||
@ -573,7 +573,8 @@ void generator::generate_diagram(std::ostream &ostr) const
|
||||
if (from.value().type_name() == "method" ||
|
||||
config().combine_free_functions_into_file_participants()) {
|
||||
generate_participant(ostr, from_activity_id);
|
||||
ostr << "[->" << " " << generate_alias(from.value()) << " : "
|
||||
ostr << "[->"
|
||||
<< " " << generate_alias(from.value()) << " : "
|
||||
<< from.value().message_name(
|
||||
select_method_arguments_render_mode())
|
||||
<< '\n';
|
||||
@ -637,7 +638,8 @@ void generator::generate_diagram(std::ostream &ostr) const
|
||||
// first activity for this 'start_from' condition
|
||||
if (from.value().type_name() == "method" ||
|
||||
config().combine_free_functions_into_file_participants()) {
|
||||
ostr << "[->" << " " << from_alias << " : "
|
||||
ostr << "[->"
|
||||
<< " " << from_alias << " : "
|
||||
<< from.value().message_name(render_mode) << '\n';
|
||||
}
|
||||
|
||||
@ -650,7 +652,8 @@ void generator::generate_diagram(std::ostream &ostr) const
|
||||
config().combine_free_functions_into_file_participants()) {
|
||||
|
||||
if (!from.value().is_void()) {
|
||||
ostr << "[<--" << " " << from_alias;
|
||||
ostr << "[<--"
|
||||
<< " " << from_alias;
|
||||
|
||||
if (config().generate_return_types())
|
||||
ostr << " : //" << from.value().return_type() << "//";
|
||||
|
@ -31,10 +31,10 @@ TEST_CASE("t20001")
|
||||
REQUIRE(MessageOrder(src,
|
||||
{
|
||||
//
|
||||
{"tmain()", "A", "A()"}, //
|
||||
{"tmain()", "A", "A()"}, //
|
||||
{"tmain()", "B", "B(A &)"}, //
|
||||
|
||||
{"tmain()", "A", "add(int,int)"}, //
|
||||
{"tmain()", "A", "add(int,int)"}, //
|
||||
|
||||
{"tmain()", "B", "wrap_add3(int,int,int)"}, //
|
||||
{"B", "A", "add3(int,int,int)"}, //
|
||||
|
@ -37,4 +37,4 @@ TEST_CASE("t20014")
|
||||
{"C<B,int>", "B", "b1(int,int)"}, //
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ TEST_CASE("t20015")
|
||||
}));
|
||||
|
||||
REQUIRE(!HasMessage(src, {"B", {"detail", "A"}, "set_x(int)"}));
|
||||
REQUIRE(!HasMessage(src, {"B", {"detail" ,"A"}, "set_y(int)"}));
|
||||
REQUIRE(!HasMessage(src, {"B", {"detail", "A"}, "set_y(int)"}));
|
||||
REQUIRE(!HasMessage(src, {"B", {"detail", "A"}, "set_z(int)"}));
|
||||
|
||||
REQUIRE(!HasMessage(src, {"B", "B", "set_x(int)"}));
|
||||
|
@ -30,7 +30,7 @@ TEST_CASE("t20019")
|
||||
{"tmain()", "Base<D1>", "name()"}, //
|
||||
{"Base<D1>", "D1", "impl()"}, //
|
||||
{"tmain()", "Base<D2>", "name()"}, //
|
||||
{"Base<D2>", "D2", "impl()"} //
|
||||
{"Base<D2>", "D2", "impl()"} //
|
||||
}));
|
||||
});
|
||||
}
|
@ -32,7 +32,7 @@ TEST_CASE("t20022")
|
||||
// properly
|
||||
{"tmain()", "A", "A(std::unique_ptr<B>)"}, //
|
||||
{"tmain()", "A", "a()"}, //
|
||||
{"A", "B", "b()"}, //
|
||||
{"A", "B", "b()"}, //
|
||||
}));
|
||||
});
|
||||
}
|
@ -33,59 +33,13 @@ TEST_CASE("t20037")
|
||||
{"a()", "B", "get()"}, //
|
||||
{"a()", "c()", ""}, //
|
||||
|
||||
// {"tmain(int,char **)", "a()", ""}, //
|
||||
// {"a()", "B", "get()"}, //
|
||||
// {"a()", "c()", ""}, //
|
||||
//
|
||||
// {"tmain(int,char **)", "a()", ""}, //
|
||||
// {"a()", "B", "get()"}, //
|
||||
// {"a()", "c()", ""} //
|
||||
{"tmain(int,char **)", "a()", ""}, //
|
||||
{"a()", "B", "get()"}, //
|
||||
{"a()", "c()", ""}, //
|
||||
|
||||
{"tmain(int,char **)", "a()", ""}, //
|
||||
{"a()", "B", "get()"}, //
|
||||
{"a()", "c()", ""} //
|
||||
}));
|
||||
});
|
||||
/*
|
||||
{
|
||||
auto src = generate_sequence_puml(diagram, *model);
|
||||
AliasMatcher _A(src);
|
||||
|
||||
REQUIRE_THAT(src, StartsWith("@startuml"));
|
||||
REQUIRE_THAT(src, EndsWith("@enduml\n"));
|
||||
|
||||
REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("a()"), ""));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("initb()"), ""));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("B"), "get()"));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("c()"), ""));
|
||||
|
||||
save_puml(config.output_directory(), diagram->name + ".puml", src);
|
||||
}
|
||||
|
||||
{
|
||||
auto j = generate_sequence_json(diagram, *model);
|
||||
|
||||
using namespace json;
|
||||
|
||||
std::vector<int> messages = {
|
||||
FindMessage(j, "tmain(int,char **)", "a()", ""),
|
||||
FindMessage(j, "a()", "initb()", ""),
|
||||
FindMessage(j, "a()", "B", "get()"),
|
||||
FindMessage(j, "a()", "c()", "")};
|
||||
|
||||
REQUIRE(std::is_sorted(messages.begin(), messages.end()));
|
||||
|
||||
save_json(config.output_directory(), diagram->name + ".json", j);
|
||||
}
|
||||
|
||||
{
|
||||
auto src = generate_sequence_mermaid(diagram, *model);
|
||||
|
||||
mermaid::SequenceDiagramAliasMatcher _A(src);
|
||||
using mermaid::HasCall;
|
||||
|
||||
REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("a()"), ""));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("initb()"), ""));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("B"), "get()"));
|
||||
REQUIRE_THAT(src, HasCall(_A("a()"), _A("c()"), ""));
|
||||
|
||||
save_mermaid(config.output_directory(), diagram->name + ".mmd",
|
||||
src);
|
||||
}*/
|
||||
}
|
@ -25,7 +25,8 @@ TEST_CASE("t20046")
|
||||
|
||||
CHECK_SEQUENCE_DIAGRAM(config, diagram, *model, [](const auto &src) {
|
||||
REQUIRE(MessageOrder(src,
|
||||
{//
|
||||
{
|
||||
//
|
||||
{"tmain()", "tmain()::(lambda t20046.cc:13:15)",
|
||||
"operator()(auto &&) const"}, //
|
||||
{"tmain()::(lambda t20046.cc:13:15)",
|
||||
|
@ -248,7 +248,8 @@ void try_run_test_case(const diagram_source_storage &diagrams, TC &&tc)
|
||||
std::cout << "-----------------------------------------------------"
|
||||
"--------------------------\n";
|
||||
std::cout << "Test case failed for diagram type "
|
||||
<< T::diagram_type_name << ": " << "\n\n";
|
||||
<< T::diagram_type_name << ": "
|
||||
<< "\n\n";
|
||||
std::cout << diagrams.get<T>().to_string() << "\n";
|
||||
|
||||
throw e;
|
||||
@ -610,7 +611,6 @@ void CHECK_INCLUDE_DIAGRAM(const clanguml::config::config &config,
|
||||
#include "t20052/test_case.h"
|
||||
#include "t20053/test_case.h"
|
||||
|
||||
|
||||
///
|
||||
/// Package diagram tests
|
||||
///
|
||||
|
@ -51,8 +51,6 @@ using namespace clanguml::util;
|
||||
std::pair<clanguml::config::config, clanguml::common::compilation_database_ptr>
|
||||
load_config(const std::string &test_name);
|
||||
|
||||
//void save_puml(const std::string &path, const std::string &puml);
|
||||
|
||||
namespace clanguml::test {
|
||||
|
||||
template <typename T, typename... Ts> constexpr bool has_type() noexcept
|
||||
|
Loading…
x
Reference in New Issue
Block a user