diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-12 14:17:41 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-14 12:15:52 -0700 |
commit | ad5aeb25c459196938cc88c404406bbbe1df9061 (patch) | |
tree | e49b0e5d798ba7a4d666bfac23b1a0e88713dc1f /src/test | |
parent | e9a4f673511dd06a8209f3e4037ad20f153d6caa (diff) | |
download | wix-ad5aeb25c459196938cc88c404406bbbe1df9061.tar.gz wix-ad5aeb25c459196938cc88c404406bbbe1df9061.tar.bz2 wix-ad5aeb25c459196938cc88c404406bbbe1df9061.zip |
Port support for ISO/IEC 19770-2:2105 (aka SWID Tags-2)
Fixes wixtoolset/issues#8380
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/BurnUnitTest/BurnUnitTest.vcxproj | 4 | ||||
-rw-r--r-- | src/test/BurnUnitTest/RegistrationTest.cpp | 22 | ||||
-rw-r--r-- | src/test/BurnUnitTest/VariableTest.cpp | 6 | ||||
-rw-r--r-- | src/test/BurnUnitTest/packages.config | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/test/BurnUnitTest/BurnUnitTest.vcxproj b/src/test/BurnUnitTest/BurnUnitTest.vcxproj index 529ab727..b57ebb16 100644 --- a/src/test/BurnUnitTest/BurnUnitTest.vcxproj +++ b/src/test/BurnUnitTest/BurnUnitTest.vcxproj | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 5 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
6 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" /> | 6 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" /> |
7 | <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" /> | 7 | <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" /> |
8 | <ItemGroup Label="ProjectConfigurations"> | 8 | <ItemGroup Label="ProjectConfigurations"> |
9 | <ProjectConfiguration Include="Debug|ARM64"> | 9 | <ProjectConfiguration Include="Debug|ARM64"> |
10 | <Configuration>Debug</Configuration> | 10 | <Configuration>Debug</Configuration> |
@@ -97,6 +97,6 @@ | |||
97 | </PropertyGroup> | 97 | </PropertyGroup> |
98 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props'))" /> | 98 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props'))" /> |
99 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets'))" /> | 99 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets'))" /> |
100 | <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.65\build\WixToolset.DUtil.props'))" /> | 100 | <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.67\build\WixToolset.DUtil.props'))" /> |
101 | </Target> | 101 | </Target> |
102 | </Project> \ No newline at end of file | 102 | </Project> \ No newline at end of file |
diff --git a/src/test/BurnUnitTest/RegistrationTest.cpp b/src/test/BurnUnitTest/RegistrationTest.cpp index 883a1258..2cb66c3f 100644 --- a/src/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/test/BurnUnitTest/RegistrationTest.cpp | |||
@@ -123,7 +123,7 @@ namespace Bootstrapper | |||
123 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr))); | 123 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr))); |
124 | 124 | ||
125 | // end session | 125 | // end session |
126 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 126 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
127 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 127 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
128 | 128 | ||
129 | // verify that registration was removed | 129 | // verify that registration was removed |
@@ -213,7 +213,7 @@ namespace Bootstrapper | |||
213 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 213 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
214 | 214 | ||
215 | // complete registration | 215 | // complete registration |
216 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 216 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
217 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 217 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
218 | 218 | ||
219 | // verify that registration was updated | 219 | // verify that registration was updated |
@@ -235,7 +235,7 @@ namespace Bootstrapper | |||
235 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 235 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
236 | 236 | ||
237 | // delete registration | 237 | // delete registration |
238 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 238 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
239 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 239 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
240 | 240 | ||
241 | // verify that registration was removed | 241 | // verify that registration was removed |
@@ -324,7 +324,7 @@ namespace Bootstrapper | |||
324 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 324 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
325 | 325 | ||
326 | // complete registration | 326 | // complete registration |
327 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 327 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
328 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 328 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
329 | 329 | ||
330 | // verify that registration variables were updated | 330 | // verify that registration variables were updated |
@@ -344,7 +344,7 @@ namespace Bootstrapper | |||
344 | // | 344 | // |
345 | 345 | ||
346 | // delete registration | 346 | // delete registration |
347 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 347 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
348 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 348 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
349 | 349 | ||
350 | // verify that registration was removed | 350 | // verify that registration was removed |
@@ -435,7 +435,7 @@ namespace Bootstrapper | |||
435 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 435 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
436 | 436 | ||
437 | // finish registration | 437 | // finish registration |
438 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 438 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
439 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 439 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
440 | 440 | ||
441 | // verify that registration was updated | 441 | // verify that registration was updated |
@@ -468,7 +468,7 @@ namespace Bootstrapper | |||
468 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 468 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
469 | 469 | ||
470 | // delete registration | 470 | // delete registration |
471 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 471 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
472 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 472 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
473 | 473 | ||
474 | // verify that registration was removed | 474 | // verify that registration was removed |
@@ -509,7 +509,7 @@ namespace Bootstrapper | |||
509 | BYTE rgbData[256] = { }; | 509 | BYTE rgbData[256] = { }; |
510 | BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; | 510 | BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; |
511 | BYTE* pbBuffer = NULL; | 511 | BYTE* pbBuffer = NULL; |
512 | DWORD cbBuffer = 0; | 512 | SIZE_T cbBuffer = 0; |
513 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}")); | 513 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}")); |
514 | try | 514 | try |
515 | { | 515 | { |
@@ -573,7 +573,7 @@ namespace Bootstrapper | |||
573 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); | 573 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); |
574 | 574 | ||
575 | // suspend session | 575 | // suspend session |
576 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); | 576 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); |
577 | TestThrowOnFailure(hr, L"Failed to suspend session."); | 577 | TestThrowOnFailure(hr, L"Failed to suspend session."); |
578 | 578 | ||
579 | // verify that run key was removed | 579 | // verify that run key was removed |
@@ -589,7 +589,7 @@ namespace Bootstrapper | |||
589 | hr = RegistrationLoadState(®istration, &pbBuffer, &cbBuffer); | 589 | hr = RegistrationLoadState(®istration, &pbBuffer, &cbBuffer); |
590 | TestThrowOnFailure(hr, L"Failed to load state."); | 590 | TestThrowOnFailure(hr, L"Failed to load state."); |
591 | 591 | ||
592 | Assert::Equal((DWORD)sizeof(rgbData), cbBuffer); | 592 | Assert::Equal((SIZE_T)sizeof(rgbData), cbBuffer); |
593 | Assert::True(0 == memcmp(pbBuffer, rgbData, sizeof(rgbData))); | 593 | Assert::True(0 == memcmp(pbBuffer, rgbData, sizeof(rgbData))); |
594 | 594 | ||
595 | // write active resume mode | 595 | // write active resume mode |
@@ -600,7 +600,7 @@ namespace Bootstrapper | |||
600 | Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); | 600 | Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); |
601 | 601 | ||
602 | // end session | 602 | // end session |
603 | hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); | 603 | hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); |
604 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 604 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
605 | 605 | ||
606 | // read resume type after session | 606 | // read resume type after session |
diff --git a/src/test/BurnUnitTest/VariableTest.cpp b/src/test/BurnUnitTest/VariableTest.cpp index ab45a73f..5c9dce03 100644 --- a/src/test/BurnUnitTest/VariableTest.cpp +++ b/src/test/BurnUnitTest/VariableTest.cpp | |||
@@ -134,7 +134,7 @@ namespace Bootstrapper | |||
134 | HRESULT hr = S_OK; | 134 | HRESULT hr = S_OK; |
135 | BURN_VARIABLES variables = { }; | 135 | BURN_VARIABLES variables = { }; |
136 | LPWSTR scz = NULL; | 136 | LPWSTR scz = NULL; |
137 | DWORD cch = 0; | 137 | SIZE_T cch = 0; |
138 | BOOL fContainsHiddenData = FALSE; | 138 | BOOL fContainsHiddenData = FALSE; |
139 | try | 139 | try |
140 | { | 140 | { |
@@ -180,12 +180,12 @@ namespace Bootstrapper | |||
180 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch); | 180 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch); |
181 | TestThrowOnFailure(hr, L"Failed to format string"); | 181 | TestThrowOnFailure(hr, L"Failed to format string"); |
182 | 182 | ||
183 | Assert::Equal((DWORD)lstrlenW(scz), cch); | 183 | Assert::Equal((SIZE_T)lstrlenW(scz), cch); |
184 | 184 | ||
185 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch); | 185 | hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch); |
186 | TestThrowOnFailure(hr, L"Failed to format string"); | 186 | TestThrowOnFailure(hr, L"Failed to format string"); |
187 | 187 | ||
188 | Assert::Equal((DWORD)lstrlenW(scz), cch); | 188 | Assert::Equal((SIZE_T)lstrlenW(scz), cch); |
189 | } | 189 | } |
190 | finally | 190 | finally |
191 | { | 191 | { |
diff --git a/src/test/BurnUnitTest/packages.config b/src/test/BurnUnitTest/packages.config index accce624..a7b88aa1 100644 --- a/src/test/BurnUnitTest/packages.config +++ b/src/test/BurnUnitTest/packages.config | |||
@@ -10,5 +10,5 @@ | |||
10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> | 10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> |
11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> | 11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> |
12 | <package id="WixBuildTools.TestSupport.Native" version="4.0.47" /> | 12 | <package id="WixBuildTools.TestSupport.Native" version="4.0.47" /> |
13 | <package id="WixToolset.DUtil" version="4.0.65" targetFramework="native" /> | 13 | <package id="WixToolset.DUtil" version="4.0.67" targetFramework="native" /> |
14 | </packages> \ No newline at end of file | 14 | </packages> \ No newline at end of file |