Fixed formatting

This commit is contained in:
Bartek Kryza
2022-11-27 15:24:01 +01:00
parent df0163cdbf
commit 93e95613b4
6 changed files with 53 additions and 50 deletions

View File

@@ -38,13 +38,11 @@ TEST_CASE("t20004", "[test-case][sequence]")
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<unsigned long>()"), "m1"));
REQUIRE_THAT(puml,
HasCall(_A("m1<unsigned long>()"), _A("m4<unsigned long>()"),
"m4"));
HasCall(_A("m1<unsigned long>()"), _A("m4<unsigned long>()"), "m4"));
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<std::string>()"), "m1"));
REQUIRE_THAT(puml,
HasCall(_A("m1<std::string>()"), _A("m2<std::string>()"),
"m2"));
REQUIRE_THAT(
puml, HasCall(_A("m1<std::string>()"), _A("m2<std::string>()"), "m2"));
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<int>()"), "m1"));
REQUIRE_THAT(puml, HasCall(_A("m1<int>()"), _A("m2<int>()"), "m2"));

View File

@@ -19,11 +19,10 @@ template <> struct B<std::string> {
};
template <typename T> struct AA {
void aa1(T t) { }
void aa2(T t) { }
void aa1(T t) { }
void aa2(T t) { }
};
template <typename T, typename F> struct BB {
void bb1(T t, F f) { aa_.aa1(t); }
void bb2(T t, F f) { aa_.aa2(t); }
@@ -38,7 +37,6 @@ template <typename T> struct BB<T, std::string> {
AA<T> aa_;
};
void tmain()
{
B<int> bint;

View File

@@ -1,9 +1,8 @@
#include <type_traits>
#include <string>
#include <type_traits>
namespace clanguml {
namespace t20008
{
namespace t20008 {
template <typename T> struct A {
void a1(T arg) { }
@@ -14,25 +13,26 @@ template <typename T> struct A {
template <typename T> struct B {
A<T> a;
void b(T arg) {
void b(T arg)
{
if constexpr (std::is_integral_v<T>) {
a.a1(arg);
}
else if constexpr(std::is_pointer_v<T>) {
else if constexpr (std::is_pointer_v<T>) {
a.a2(arg);
}
else {
a.a3(arg);
}
}
};
void tmain() {
void tmain()
{
using namespace std::string_literals;
B<int> bint;
B<const char*> bcharp;
B<const char *> bcharp;
B<std::string> bstring;
bint.b(1);

View File

@@ -79,19 +79,26 @@ template <typename T, typename... Ts> constexpr bool has_type() noexcept
return (std::is_same_v<T, Ts> || ... || false);
}
struct Public { };
struct Public {
};
struct Protected { };
struct Protected {
};
struct Private { };
struct Private {
};
struct Abstract { };
struct Abstract {
};
struct Static { };
struct Static {
};
struct Const { };
struct Const {
};
struct Default { };
struct Default {
};
struct HasCallWithResultMatcher : ContainsMatcher {
HasCallWithResultMatcher(