diff options
Diffstat (limited to 'src/test/BurnUnitTest/RegistrationTest.cpp')
| -rw-r--r-- | src/test/BurnUnitTest/RegistrationTest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
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 |
