Added smart pointer alias to t20009 test case

This commit is contained in:
Bartek Kryza
2022-11-30 19:50:40 +01:00
parent 9c3d65bf47
commit 115ede3cc7
2 changed files with 6 additions and 0 deletions

View File

@@ -13,13 +13,17 @@ template <typename T> struct B {
std::unique_ptr<A<T>> a;
};
using BFloatPtr = std::shared_ptr<B<float>>;
void tmain()
{
std::shared_ptr<B<std::string>> bstring;
auto bint = std::make_unique<B<int>>();
BFloatPtr bfloat;
bstring->b("b");
bint.get()->b(42);
bfloat->b(1.0);
}
}
}

View File

@@ -42,6 +42,8 @@ TEST_CASE("t20009", "[test-case][sequence]")
REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B<int>"), "b"));
REQUIRE_THAT(puml, HasCall(_A("B<int>"), _A("A<int>"), "a"));
REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B<float>"), "b"));
REQUIRE_THAT(puml, HasCall(_A("B<float>"), _A("A<float>"), "a"));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
}