File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1033,8 +1033,8 @@ namespace winrt::impl
10331033 {
10341034 return error_bad_alloc;
10351035 }
1036- *array = std::copy (local_iids.second , local_iids.second + local_count, *array);
1037- std::copy (inner_iids.cbegin (), inner_iids.cend (), *array );
1036+ auto next = std::copy (local_iids.second , local_iids.second + local_count, *array);
1037+ std::copy (inner_iids.cbegin (), inner_iids.cend (), next );
10381038 }
10391039 else
10401040 {
Original file line number Diff line number Diff line change @@ -167,4 +167,20 @@ TEST_CASE("Composable conversions")
167167{
168168 TestCalls (*make_self<Foo>());
169169 TestCalls (*make_self<Bar>());
170- }
170+ }
171+
172+ TEST_CASE (" Composable get_interfaces" )
173+ {
174+ struct Foo : Composable::BaseT<Foo, IStringable> {
175+ hstring ToString () const { return L" Foo" ; }
176+ };
177+
178+ auto obj = make<Foo>();
179+ auto iids = winrt::get_interfaces (obj);
180+ // BaseOverrides IID gets repeated twice. There are only 4 unique interfaces.
181+ REQUIRE (iids.size () == 5 );
182+ REQUIRE (std::find (iids.begin (), iids.end (), guid_of<IBase>()) != iids.end ());
183+ REQUIRE (std::find (iids.begin (), iids.end (), guid_of<IBaseProtected>()) != iids.end ());
184+ REQUIRE (std::find (iids.begin (), iids.end (), guid_of<IBaseOverrides>()) != iids.end ());
185+ REQUIRE (std::find (iids.begin (), iids.end (), guid_of<IStringable>()) != iids.end ());
186+ }
You can’t perform that action at this time.
0 commit comments