Skip to content

Commit

Permalink
Add a test case where fusion manifest is used to support activation w…
Browse files Browse the repository at this point in the history
…ithout regfree
  • Loading branch information
dmachaj committed Nov 7, 2024
1 parent 3734b0e commit 2ead2c5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_cpp20/activation_without_regfree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ TEST_CASE("activation_withoug_regfree_system_type")
REQUIRE_NOTHROW(Uri(L"https://bing.com"));
}

TEST_CASE("activation_manifested_avoiding_regfree")
{
bool fusionRegistrationWorked{ false };
try
{
// app.manifest has registration for the Simple runtimeclass so activation should succeed.
Simple s{};
fusionRegistrationWorked = true;
}
catch (...)
{
}
REQUIRE(fusionRegistrationWorked);
}

TEST_CASE("activation_withoug_regfree_fails")
{
bool threwException{ false };
Expand Down
9 changes: 9 additions & 0 deletions test/test_cpp20/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<file name="test_component.dll">
<activatableClass
name="test_component.Simple"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1"
/>
</file>
</assembly>
3 changes: 3 additions & 0 deletions test/test_cpp20/test_cpp20.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@
</ClCompile>
<ClCompile Include="ranges.cpp" />
</ItemGroup>
<ItemGroup>
<Manifest Include="app.manifest" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down

0 comments on commit 2ead2c5

Please sign in to comment.