diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-13 23:47:55 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-03-14 14:53:29 -0500 |
commit | 78125b7c4bd59468275d65b63860bdb68b1bc6f1 (patch) | |
tree | 05c73a4e9ac79172afd42ba817c69d37571c3dc4 /src/burn/test/BurnUnitTest/PlanTest.cpp | |
parent | 4cd1c4e06145434ca940ac828772dc47b9d9738e (diff) | |
download | wix-78125b7c4bd59468275d65b63860bdb68b1bc6f1.tar.gz wix-78125b7c4bd59468275d65b63860bdb68b1bc6f1.tar.bz2 wix-78125b7c4bd59468275d65b63860bdb68b1bc6f1.zip |
Log rest of plan and add testing of registration actions to PlanTest.
Diffstat (limited to 'src/burn/test/BurnUnitTest/PlanTest.cpp')
-rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 372 |
1 files changed, 370 insertions, 2 deletions
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 7852f1c9..a3b58426 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
@@ -60,11 +60,26 @@ namespace Bootstrapper | |||
60 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 60 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
61 | 61 | ||
62 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 62 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
63 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleId); | ||
64 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleProviderKey); | ||
65 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
63 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 66 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
67 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
64 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 68 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
69 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
65 | 70 | ||
66 | BOOL fRollback = FALSE; | 71 | BOOL fRollback = FALSE; |
67 | DWORD dwIndex = 0; | 72 | DWORD dwIndex = 0; |
73 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}"); | ||
74 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
75 | |||
76 | fRollback = TRUE; | ||
77 | dwIndex = 0; | ||
78 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}"); | ||
79 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
80 | |||
81 | fRollback = FALSE; | ||
82 | dwIndex = 0; | ||
68 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 83 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
69 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 84 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
70 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 85 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -204,11 +219,26 @@ namespace Bootstrapper | |||
204 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 219 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
205 | 220 | ||
206 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 221 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
222 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleId); | ||
223 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleProviderKey); | ||
224 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
207 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 225 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
226 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
208 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 227 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
228 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
209 | 229 | ||
210 | BOOL fRollback = FALSE; | 230 | BOOL fRollback = FALSE; |
211 | DWORD dwIndex = 0; | 231 | DWORD dwIndex = 0; |
232 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}"); | ||
233 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
234 | |||
235 | fRollback = TRUE; | ||
236 | dwIndex = 0; | ||
237 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}"); | ||
238 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
239 | |||
240 | fRollback = FALSE; | ||
241 | dwIndex = 0; | ||
212 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 242 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
213 | 243 | ||
214 | fRollback = TRUE; | 244 | fRollback = TRUE; |
@@ -321,11 +351,24 @@ namespace Bootstrapper | |||
321 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 351 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
322 | 352 | ||
323 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 353 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
354 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
355 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
356 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
324 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 357 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
358 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
325 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 359 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
360 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
326 | 361 | ||
327 | BOOL fRollback = FALSE; | 362 | BOOL fRollback = FALSE; |
328 | DWORD dwIndex = 0; | 363 | DWORD dwIndex = 0; |
364 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
365 | |||
366 | fRollback = TRUE; | ||
367 | dwIndex = 0; | ||
368 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
369 | |||
370 | fRollback = FALSE; | ||
371 | dwIndex = 0; | ||
329 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 372 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
330 | 373 | ||
331 | fRollback = TRUE; | 374 | fRollback = TRUE; |
@@ -407,11 +450,26 @@ namespace Bootstrapper | |||
407 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 450 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
408 | 451 | ||
409 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 452 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
453 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
454 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
455 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
410 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 456 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
457 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
411 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 458 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
459 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
412 | 460 | ||
413 | BOOL fRollback = FALSE; | 461 | BOOL fRollback = FALSE; |
414 | DWORD dwIndex = 0; | 462 | DWORD dwIndex = 0; |
463 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
464 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
465 | |||
466 | fRollback = TRUE; | ||
467 | dwIndex = 0; | ||
468 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
469 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
470 | |||
471 | fRollback = FALSE; | ||
472 | dwIndex = 0; | ||
415 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 473 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
416 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 474 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
417 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 475 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -510,11 +568,26 @@ namespace Bootstrapper | |||
510 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 568 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
511 | 569 | ||
512 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 570 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
571 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
572 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
573 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
513 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 574 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
575 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
514 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 576 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
577 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
515 | 578 | ||
516 | BOOL fRollback = FALSE; | 579 | BOOL fRollback = FALSE; |
517 | DWORD dwIndex = 0; | 580 | DWORD dwIndex = 0; |
581 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
582 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
583 | |||
584 | fRollback = TRUE; | ||
585 | dwIndex = 0; | ||
586 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
587 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
588 | |||
589 | fRollback = FALSE; | ||
590 | dwIndex = 0; | ||
518 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 591 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
519 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 592 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
520 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 593 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -597,11 +670,26 @@ namespace Bootstrapper | |||
597 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 670 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
598 | 671 | ||
599 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_CACHE, pPlan->action); | 672 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_CACHE, pPlan->action); |
673 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
674 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
675 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
600 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 676 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
677 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
601 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 678 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
679 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
602 | 680 | ||
603 | BOOL fRollback = FALSE; | 681 | BOOL fRollback = FALSE; |
604 | DWORD dwIndex = 0; | 682 | DWORD dwIndex = 0; |
683 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
684 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
685 | |||
686 | fRollback = TRUE; | ||
687 | dwIndex = 0; | ||
688 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
689 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
690 | |||
691 | fRollback = FALSE; | ||
692 | dwIndex = 0; | ||
605 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 693 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
606 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 694 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
607 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 695 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -675,11 +763,24 @@ namespace Bootstrapper | |||
675 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 763 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
676 | 764 | ||
677 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 765 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
766 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
767 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
768 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
678 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 769 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
770 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
679 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 771 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
772 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
680 | 773 | ||
681 | BOOL fRollback = FALSE; | 774 | BOOL fRollback = FALSE; |
682 | DWORD dwIndex = 0; | 775 | DWORD dwIndex = 0; |
776 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
777 | |||
778 | fRollback = TRUE; | ||
779 | dwIndex = 0; | ||
780 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
781 | |||
782 | fRollback = FALSE; | ||
783 | dwIndex = 0; | ||
683 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 784 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
684 | 785 | ||
685 | fRollback = TRUE; | 786 | fRollback = TRUE; |
@@ -750,11 +851,24 @@ namespace Bootstrapper | |||
750 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 851 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
751 | 852 | ||
752 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 853 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
854 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
855 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
856 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
753 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 857 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
858 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
754 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 859 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
860 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
755 | 861 | ||
756 | BOOL fRollback = FALSE; | 862 | BOOL fRollback = FALSE; |
757 | DWORD dwIndex = 0; | 863 | DWORD dwIndex = 0; |
864 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
865 | |||
866 | fRollback = TRUE; | ||
867 | dwIndex = 0; | ||
868 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
869 | |||
870 | fRollback = FALSE; | ||
871 | dwIndex = 0; | ||
758 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 872 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
759 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 873 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
760 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 874 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -827,11 +941,26 @@ namespace Bootstrapper | |||
827 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 941 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
828 | 942 | ||
829 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 943 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
944 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
945 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
946 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
830 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 947 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
948 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
831 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 949 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
950 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
832 | 951 | ||
833 | BOOL fRollback = FALSE; | 952 | BOOL fRollback = FALSE; |
834 | DWORD dwIndex = 0; | 953 | DWORD dwIndex = 0; |
954 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
955 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
956 | |||
957 | fRollback = TRUE; | ||
958 | dwIndex = 0; | ||
959 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
960 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
961 | |||
962 | fRollback = FALSE; | ||
963 | dwIndex = 0; | ||
835 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 964 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
836 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 965 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
837 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 966 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -917,11 +1046,26 @@ namespace Bootstrapper | |||
917 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1046 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
918 | 1047 | ||
919 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_MODIFY, pPlan->action); | 1048 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_MODIFY, pPlan->action); |
1049 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
1050 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
1051 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
920 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1052 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1053 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
921 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1054 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1055 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
922 | 1056 | ||
923 | BOOL fRollback = FALSE; | 1057 | BOOL fRollback = FALSE; |
924 | DWORD dwIndex = 0; | 1058 | DWORD dwIndex = 0; |
1059 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1060 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1061 | |||
1062 | fRollback = TRUE; | ||
1063 | dwIndex = 0; | ||
1064 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1065 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1066 | |||
1067 | fRollback = FALSE; | ||
1068 | dwIndex = 0; | ||
925 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1069 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
926 | 1070 | ||
927 | fRollback = TRUE; | 1071 | fRollback = TRUE; |
@@ -980,11 +1124,26 @@ namespace Bootstrapper | |||
980 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1124 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
981 | 1125 | ||
982 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1126 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
1127 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
1128 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
1129 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
983 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1130 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1131 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
984 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1132 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1133 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
985 | 1134 | ||
986 | BOOL fRollback = FALSE; | 1135 | BOOL fRollback = FALSE; |
987 | DWORD dwIndex = 0; | 1136 | DWORD dwIndex = 0; |
1137 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1138 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1139 | |||
1140 | fRollback = TRUE; | ||
1141 | dwIndex = 0; | ||
1142 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1143 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1144 | |||
1145 | fRollback = FALSE; | ||
1146 | dwIndex = 0; | ||
988 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1147 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
989 | 1148 | ||
990 | fRollback = TRUE; | 1149 | fRollback = TRUE; |
@@ -1044,6 +1203,76 @@ namespace Bootstrapper | |||
1044 | } | 1203 | } |
1045 | 1204 | ||
1046 | [Fact] | 1205 | [Fact] |
1206 | void SingleMsiUninstallWithDependentTest() | ||
1207 | { | ||
1208 | HRESULT hr = S_OK; | ||
1209 | BURN_ENGINE_STATE engineState = { }; | ||
1210 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
1211 | BURN_PLAN* pPlan = &engineState.plan; | ||
1212 | |||
1213 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | ||
1214 | DetectPackagesAsPresentAndCached(pEngineState); | ||
1215 | DetectBundleDependent(pEngineState, L"{29855EB1-724D-4285-A89C-5D37D8549DCD}"); | ||
1216 | |||
1217 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | ||
1218 | NativeAssert::Succeeded(hr, "CorePlan failed"); | ||
1219 | |||
1220 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | ||
1221 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
1222 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
1223 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1224 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | ||
1225 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1226 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | ||
1227 | Assert::Equal<BOOL>(TRUE, pPlan->fDisallowRemoval); | ||
1228 | |||
1229 | BOOL fRollback = FALSE; | ||
1230 | DWORD dwIndex = 0; | ||
1231 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1232 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1233 | |||
1234 | fRollback = TRUE; | ||
1235 | dwIndex = 0; | ||
1236 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1237 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1238 | |||
1239 | fRollback = FALSE; | ||
1240 | dwIndex = 0; | ||
1241 | Assert::Equal(dwIndex, pPlan->cCacheActions); | ||
1242 | |||
1243 | fRollback = TRUE; | ||
1244 | dwIndex = 0; | ||
1245 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | ||
1246 | |||
1247 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1248 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | ||
1249 | |||
1250 | fRollback = FALSE; | ||
1251 | dwIndex = 0; | ||
1252 | Assert::Equal(dwIndex, pPlan->cExecuteActions); | ||
1253 | |||
1254 | fRollback = TRUE; | ||
1255 | dwIndex = 0; | ||
1256 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | ||
1257 | |||
1258 | Assert::Equal(0ul, pPlan->cExecutePackagesTotal); | ||
1259 | Assert::Equal(0ul, pPlan->cOverallProgressTicksTotal); | ||
1260 | |||
1261 | dwIndex = 0; | ||
1262 | Assert::Equal(dwIndex, pPlan->cRestoreRelatedBundleActions); | ||
1263 | |||
1264 | dwIndex = 0; | ||
1265 | Assert::Equal(dwIndex, pPlan->cCleanActions); | ||
1266 | |||
1267 | UINT uIndex = 0; | ||
1268 | ValidatePlannedProvider(pPlan, uIndex++, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", NULL); | ||
1269 | Assert::Equal(uIndex, pPlan->cPlannedProviders); | ||
1270 | |||
1271 | Assert::Equal(1ul, pEngineState->packages.cPackages); | ||
1272 | ValidateNonPermanentPackageExpectedStates(&pEngineState->packages.rgPackages[0], L"PackageA", BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN, BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN); | ||
1273 | } | ||
1274 | |||
1275 | [Fact] | ||
1047 | void SingleMsiUninstallTestFromUpgradeBundleWithSameExactPackage() | 1276 | void SingleMsiUninstallTestFromUpgradeBundleWithSameExactPackage() |
1048 | { | 1277 | { |
1049 | HRESULT hr = S_OK; | 1278 | HRESULT hr = S_OK; |
@@ -1058,11 +1287,26 @@ namespace Bootstrapper | |||
1058 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1287 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1059 | 1288 | ||
1060 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1289 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
1290 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
1291 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
1292 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1061 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1293 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1294 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1062 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1295 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1296 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1063 | 1297 | ||
1064 | BOOL fRollback = FALSE; | 1298 | BOOL fRollback = FALSE; |
1065 | DWORD dwIndex = 0; | 1299 | DWORD dwIndex = 0; |
1300 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1301 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1302 | |||
1303 | fRollback = TRUE; | ||
1304 | dwIndex = 0; | ||
1305 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1306 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1307 | |||
1308 | fRollback = FALSE; | ||
1309 | dwIndex = 0; | ||
1066 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1310 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
1067 | 1311 | ||
1068 | fRollback = TRUE; | 1312 | fRollback = TRUE; |
@@ -1126,11 +1370,26 @@ namespace Bootstrapper | |||
1126 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1370 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1127 | 1371 | ||
1128 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL, pPlan->action); | 1372 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL, pPlan->action); |
1373 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleId); | ||
1374 | NativeAssert::StringEqual(L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", pPlan->wzBundleProviderKey); | ||
1375 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1129 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1376 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1377 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1130 | Assert::Equal<BOOL>(TRUE, pPlan->fDisableRollback); | 1378 | Assert::Equal<BOOL>(TRUE, pPlan->fDisableRollback); |
1379 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1131 | 1380 | ||
1132 | BOOL fRollback = FALSE; | 1381 | BOOL fRollback = FALSE; |
1133 | DWORD dwIndex = 0; | 1382 | DWORD dwIndex = 0; |
1383 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1384 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1385 | |||
1386 | fRollback = TRUE; | ||
1387 | dwIndex = 0; | ||
1388 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}"); | ||
1389 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1390 | |||
1391 | fRollback = FALSE; | ||
1392 | dwIndex = 0; | ||
1134 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1393 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
1135 | 1394 | ||
1136 | fRollback = TRUE; | 1395 | fRollback = TRUE; |
@@ -1205,11 +1464,26 @@ namespace Bootstrapper | |||
1205 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1464 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1206 | 1465 | ||
1207 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1466 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
1467 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleId); | ||
1468 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleProviderKey); | ||
1469 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1208 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1470 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1471 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1209 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1472 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1473 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1210 | 1474 | ||
1211 | BOOL fRollback = FALSE; | 1475 | BOOL fRollback = FALSE; |
1212 | DWORD dwIndex = 0; | 1476 | DWORD dwIndex = 0; |
1477 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1478 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1479 | |||
1480 | fRollback = TRUE; | ||
1481 | dwIndex = 0; | ||
1482 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1483 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1484 | |||
1485 | fRollback = FALSE; | ||
1486 | dwIndex = 0; | ||
1213 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 1487 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
1214 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); | 1488 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); |
1215 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 1489 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -1320,11 +1594,26 @@ namespace Bootstrapper | |||
1320 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1594 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1321 | 1595 | ||
1322 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1596 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
1597 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleId); | ||
1598 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleProviderKey); | ||
1599 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1323 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1600 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1601 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1324 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1602 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1603 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1325 | 1604 | ||
1326 | BOOL fRollback = FALSE; | 1605 | BOOL fRollback = FALSE; |
1327 | DWORD dwIndex = 0; | 1606 | DWORD dwIndex = 0; |
1607 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1608 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1609 | |||
1610 | fRollback = TRUE; | ||
1611 | dwIndex = 0; | ||
1612 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1613 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1614 | |||
1615 | fRollback = FALSE; | ||
1616 | dwIndex = 0; | ||
1328 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1617 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
1329 | 1618 | ||
1330 | fRollback = TRUE; | 1619 | fRollback = TRUE; |
@@ -1420,11 +1709,26 @@ namespace Bootstrapper | |||
1420 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1709 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1421 | 1710 | ||
1422 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1711 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
1712 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleId); | ||
1713 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleProviderKey); | ||
1714 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1423 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1715 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1716 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1424 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1717 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1718 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1425 | 1719 | ||
1426 | BOOL fRollback = FALSE; | 1720 | BOOL fRollback = FALSE; |
1427 | DWORD dwIndex = 0; | 1721 | DWORD dwIndex = 0; |
1722 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1723 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1724 | |||
1725 | fRollback = TRUE; | ||
1726 | dwIndex = 0; | ||
1727 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1728 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1729 | |||
1730 | fRollback = FALSE; | ||
1731 | dwIndex = 0; | ||
1428 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 1732 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
1429 | 1733 | ||
1430 | fRollback = TRUE; | 1734 | fRollback = TRUE; |
@@ -1475,7 +1779,7 @@ namespace Bootstrapper | |||
1475 | Assert::Equal(dwIndex, pPlan->cCleanActions); | 1779 | Assert::Equal(dwIndex, pPlan->cCleanActions); |
1476 | 1780 | ||
1477 | UINT uIndex = 0; | 1781 | UINT uIndex = 0; |
1478 | ValidatePlannedProvider(pPlan, uIndex++, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", NULL); | 1782 | ValidatePlannedProvider(pPlan, uIndex++, L"{DC94A8E0-4BF4-4026-B80B-2755DAFC05D3}", NULL); |
1479 | ValidatePlannedProvider(pPlan, uIndex++, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", NULL); | 1783 | ValidatePlannedProvider(pPlan, uIndex++, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", NULL); |
1480 | Assert::Equal(uIndex, pPlan->cPlannedProviders); | 1784 | Assert::Equal(uIndex, pPlan->cPlannedProviders); |
1481 | 1785 | ||
@@ -1499,11 +1803,26 @@ namespace Bootstrapper | |||
1499 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1803 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
1500 | 1804 | ||
1501 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1805 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
1806 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleId); | ||
1807 | NativeAssert::StringEqual(L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", pPlan->wzBundleProviderKey); | ||
1808 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
1502 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | 1809 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); |
1810 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | ||
1503 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1811 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1812 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
1504 | 1813 | ||
1505 | BOOL fRollback = FALSE; | 1814 | BOOL fRollback = FALSE; |
1506 | DWORD dwIndex = 0; | 1815 | DWORD dwIndex = 0; |
1816 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, TRUE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1817 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
1818 | |||
1819 | fRollback = TRUE; | ||
1820 | dwIndex = 0; | ||
1821 | ValidateDependentRegistrationAction(pPlan, fRollback, dwIndex++, FALSE, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}"); | ||
1822 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
1823 | |||
1824 | fRollback = FALSE; | ||
1825 | dwIndex = 0; | ||
1507 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 1826 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
1508 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); | 1827 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); |
1509 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 1828 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
@@ -1576,7 +1895,7 @@ namespace Bootstrapper | |||
1576 | Assert::Equal(dwIndex, pPlan->cCleanActions); | 1895 | Assert::Equal(dwIndex, pPlan->cCleanActions); |
1577 | 1896 | ||
1578 | UINT uIndex = 0; | 1897 | UINT uIndex = 0; |
1579 | ValidatePlannedProvider(pPlan, uIndex++, L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", NULL); | 1898 | ValidatePlannedProvider(pPlan, uIndex++, L"{DC94A8E0-4BF4-4026-B80B-2755DAFC05D3}", NULL); |
1580 | Assert::Equal(uIndex, pPlan->cPlannedProviders); | 1899 | Assert::Equal(uIndex, pPlan->cPlannedProviders); |
1581 | 1900 | ||
1582 | Assert::Equal(2ul, pEngineState->packages.cPackages); | 1901 | Assert::Equal(2ul, pEngineState->packages.cPackages); |
@@ -1728,6 +2047,29 @@ namespace Bootstrapper | |||
1728 | } | 2047 | } |
1729 | } | 2048 | } |
1730 | 2049 | ||
2050 | void DetectBundleDependent(BURN_ENGINE_STATE* pEngineState, LPCWSTR wzId) | ||
2051 | { | ||
2052 | HRESULT hr = S_OK; | ||
2053 | BURN_DEPENDENCIES* pDependencies = &pEngineState->dependencies; | ||
2054 | BURN_REGISTRATION* pRegistration = &pEngineState->registration; | ||
2055 | |||
2056 | hr = DepDependencyArrayAlloc(&pRegistration->rgDependents, &pRegistration->cDependents, wzId, NULL); | ||
2057 | NativeAssert::Succeeded(hr, "Failed to add package dependent"); | ||
2058 | |||
2059 | if (pDependencies->fSelfDependent || pDependencies->fActiveParent) | ||
2060 | { | ||
2061 | if (pDependencies->fActiveParent && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pDependencies->wzActiveParent, -1, wzId, -1)) | ||
2062 | { | ||
2063 | pRegistration->fParentRegisteredAsDependent = TRUE; | ||
2064 | } | ||
2065 | |||
2066 | if (pDependencies->fSelfDependent && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pDependencies->wzSelfDependent, -1, wzId, -1)) | ||
2067 | { | ||
2068 | pRegistration->fSelfRegisteredAsDependent = TRUE; | ||
2069 | } | ||
2070 | } | ||
2071 | } | ||
2072 | |||
1731 | void DetectPackageDependent(BURN_PACKAGE* pPackage, LPCWSTR wzId) | 2073 | void DetectPackageDependent(BURN_PACKAGE* pPackage, LPCWSTR wzId) |
1732 | { | 2074 | { |
1733 | HRESULT hr = S_OK; | 2075 | HRESULT hr = S_OK; |
@@ -1761,6 +2103,11 @@ namespace Bootstrapper | |||
1761 | 2103 | ||
1762 | pEngineState->registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL; | 2104 | pEngineState->registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL; |
1763 | 2105 | ||
2106 | if (pEngineState->dependencies.wzSelfDependent) | ||
2107 | { | ||
2108 | DetectBundleDependent(pEngineState, pEngineState->dependencies.wzSelfDependent); | ||
2109 | } | ||
2110 | |||
1764 | for (DWORD i = 0; i < pEngineState->packages.cPackages; ++i) | 2111 | for (DWORD i = 0; i < pEngineState->packages.cPackages; ++i) |
1765 | { | 2112 | { |
1766 | BURN_PACKAGE* pPackage = pEngineState->packages.rgPackages + i; | 2113 | BURN_PACKAGE* pPackage = pEngineState->packages.rgPackages + i; |
@@ -1971,6 +2318,27 @@ namespace Bootstrapper | |||
1971 | NativeAssert::StringEqual(wzPackageId, pCleanAction->pPackage->sczId); | 2318 | NativeAssert::StringEqual(wzPackageId, pCleanAction->pPackage->sczId); |
1972 | } | 2319 | } |
1973 | 2320 | ||
2321 | BURN_DEPENDENT_REGISTRATION_ACTION* ValidateDependentRegistrationActionExists(BURN_PLAN* pPlan, BOOL fRollback, DWORD dwIndex) | ||
2322 | { | ||
2323 | Assert::InRange(dwIndex + 1ul, 1ul, (fRollback ? pPlan->cRollbackRegistrationActions : pPlan->cRegistrationActions)); | ||
2324 | return (fRollback ? pPlan->rgRollbackRegistrationActions : pPlan->rgRegistrationActions) + dwIndex; | ||
2325 | } | ||
2326 | |||
2327 | void ValidateDependentRegistrationAction( | ||
2328 | __in BURN_PLAN* pPlan, | ||
2329 | __in BOOL fRollback, | ||
2330 | __in DWORD dwIndex, | ||
2331 | __in BOOL fRegister, | ||
2332 | __in LPCWSTR wzBundleId, | ||
2333 | __in LPCWSTR wzProviderKey | ||
2334 | ) | ||
2335 | { | ||
2336 | BURN_DEPENDENT_REGISTRATION_ACTION* pAction = ValidateDependentRegistrationActionExists(pPlan, fRollback, dwIndex); | ||
2337 | Assert::Equal<DWORD>(fRegister ? BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_REGISTER : BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_UNREGISTER, pAction->type); | ||
2338 | NativeAssert::StringEqual(wzBundleId, pAction->sczBundleId); | ||
2339 | NativeAssert::StringEqual(wzProviderKey, pAction->sczDependentProviderKey); | ||
2340 | } | ||
2341 | |||
1974 | BURN_EXECUTE_ACTION* ValidateExecuteActionExists(BURN_PLAN* pPlan, BOOL fRollback, DWORD dwIndex) | 2342 | BURN_EXECUTE_ACTION* ValidateExecuteActionExists(BURN_PLAN* pPlan, BOOL fRollback, DWORD dwIndex) |
1975 | { | 2343 | { |
1976 | Assert::InRange(dwIndex + 1ul, 1ul, (fRollback ? pPlan->cRollbackActions : pPlan->cExecuteActions)); | 2344 | Assert::InRange(dwIndex + 1ul, 1ul, (fRollback ? pPlan->cRollbackActions : pPlan->cExecuteActions)); |