From 675f8b7e7949211f3de9cc6d356781160f0e23e9 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Thu, 23 Feb 2023 12:53:20 -0600 Subject: [PATCH] Add a uniform initialization test --- test/old_tests/UnitTests/as_implements.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/old_tests/UnitTests/as_implements.cpp b/test/old_tests/UnitTests/as_implements.cpp index 4c99631fb..ce3ef4d51 100644 --- a/test/old_tests/UnitTests/as_implements.cpp +++ b/test/old_tests/UnitTests/as_implements.cpp @@ -74,6 +74,16 @@ TEST_CASE("as_implements") REQUIRE(foo.get() == foo2.get()); } +TEST_CASE("as_implements_uniform_initialization") +{ + // uniform initialization relies on IStringable(IStringable&&), + // which requires non-const rvalue semantics. + com_ptr foo = make_self(); + IStringable stringable{ foo.as() }; + com_ptr foo2 = stringable.as(); + REQUIRE(foo.get() == foo2.get()); +} + TEST_CASE("as_implements_inheritance") { com_ptr bar = make_self();