Skip to content

Commit 96b3638

Browse files
kythantDrusTheAxe
andauthored
VersionInfo WinRT API can be used in non-experimental builds or compile errors (#3691) (#3692)
Co-authored-by: Howard Kapustein <howardk@microsoft.com>
1 parent a84cc2a commit 96b3638

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/VersionInfo/VersionInfoTests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ namespace Test::VersionInfo
3838

3939
try
4040
{
41+
#if defined(WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED)
4142
auto release{ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::ReleaseInfo::AsString() };
4243
VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll");
44+
#else
45+
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
46+
#endif
4347
}
4448
catch (winrt::hresult_error& e)
4549
{
@@ -57,8 +61,12 @@ namespace Test::VersionInfo
5761

5862
try
5963
{
64+
#if defined(WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_VERSIONINFOAPI_ENABLED)
6065
auto runtime{ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::RuntimeInfo::AsString() };
6166
VERIFY_FAIL(L"Success is not expected without Microsoft.WindowsAppRuntime.Insights.Resource.dll");
67+
#else
68+
WEX::Logging::Log::Comment(WEX::Common::String(L"Feature_VersionInfoAPI is disabled. Skipping..."));
69+
#endif
6270
}
6371
catch (winrt::hresult_error& e)
6472
{

0 commit comments

Comments
 (0)