Closed CarlosNihelton closed 11 months ago
I've tagged a few project maintainers. If one of them is available to offer guidance and mentorship for this issue, they will reach out according to the contributing guide to discuss and agree on an approach.
@microsoft/cppwinrt-maintainers
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Version
C++/WinRT v2.0.220110.5
Summary
The conversation https://github.com/microsoft/cppwinrt/pull/477#discussion_r1300499404 suggests that it's desirable to have a way for an activation handler to return back to the default procedure in case it's not interested in a certain class. That's useful when tests deal with a couple of WinRT types, but only part of them are to be mocked.
The inclusion of the global
winrt_activation_handler
in #477 requires the custom activation handler to deal with all possible activation scenarios. In certain kinds of tests that might be an overkill.A small change as suggested below would allow handlers by convention to return a magic value meaning they cannot handle that activation and the original procedure should take over.
Augmenting
test\custom_activation.cpp
to try instantiating some other class thecustom_factory
is not interested in would result in a uncorrectable failure (even if we'd remove theREQUIRE
clauses from the handler and the custom_factory implementation code).Reproducible example
Expected behavior
No failure, no crash, the custom handler would defer activating the unhandled classes to the default procedure.
Actual behavior
The custom handler must handle all possible activations or crash (SIGSEGV)
Additional comments
No response