aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-04-16 09:40:18 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-04-19 23:12:55 -0500
commit941c47e5a3f57ce9626b447a95740b1444e69343 (patch)
tree6225b78f5fc7c8f88a2abf187a6a76d45b36ec26 /src/test
parentd32f770ca05748df9e356444c7e617d5eeedb60c (diff)
downloadwix-941c47e5a3f57ce9626b447a95740b1444e69343.tar.gz
wix-941c47e5a3f57ce9626b447a95740b1444e69343.tar.bz2
wix-941c47e5a3f57ce9626b447a95740b1444e69343.zip
Detect a package as cached if any of its payloads exist.
Detect is supposed to be fast, so it can't fully verify every payload for every package. The engine was wasting its time by trying to verify file sizes without the hash. Even worse, it was making decisions during planning based on that insufficient verification. Contributes to #3640
Diffstat (limited to 'src/test')
-rw-r--r--src/test/BurnUnitTest/PlanTest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/BurnUnitTest/PlanTest.cpp b/src/test/BurnUnitTest/PlanTest.cpp
index 2a34cb16..2ebbca74 100644
--- a/src/test/BurnUnitTest/PlanTest.cpp
+++ b/src/test/BurnUnitTest/PlanTest.cpp
@@ -127,7 +127,6 @@ namespace Bootstrapper
127 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); 127 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
128 ValidateExecuteCommitMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ"); 128 ValidateExecuteCommitMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ");
129 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); 129 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
130 ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[23].syncpoint.hEvent);
131 ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); 130 ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL);
132 Assert::Equal(dwIndex, pPlan->cExecuteActions); 131 Assert::Equal(dwIndex, pPlan->cExecuteActions);
133 132
@@ -509,7 +508,6 @@ namespace Bootstrapper
509 ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER); 508 ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
510 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); 509 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
511 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); 510 ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
512 ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[6].syncpoint.hEvent);
513 ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); 511 ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL);
514 Assert::Equal(dwIndex, pPlan->cExecuteActions); 512 Assert::Equal(dwIndex, pPlan->cExecuteActions);
515 513
@@ -593,6 +591,7 @@ namespace Bootstrapper
593 Assert::Equal(0ul, pPlan->cOverallProgressTicksTotal); 591 Assert::Equal(0ul, pPlan->cOverallProgressTicksTotal);
594 592
595 dwIndex = 0; 593 dwIndex = 0;
594 ValidateCleanAction(pPlan, dwIndex++, L"PackageA");
596 Assert::Equal(dwIndex, pPlan->cCleanActions); 595 Assert::Equal(dwIndex, pPlan->cCleanActions);
597 596
598 UINT uIndex = 0; 597 UINT uIndex = 0;
@@ -1042,7 +1041,7 @@ namespace Bootstrapper
1042 void DetectPackageAsPresentAndCached(BURN_PACKAGE* pPackage) 1041 void DetectPackageAsPresentAndCached(BURN_PACKAGE* pPackage)
1043 { 1042 {
1044 pPackage->currentState = BOOTSTRAPPER_PACKAGE_STATE_PRESENT; 1043 pPackage->currentState = BOOTSTRAPPER_PACKAGE_STATE_PRESENT;
1045 pPackage->cache = BURN_CACHE_STATE_COMPLETE; 1044 pPackage->fCached = TRUE;
1046 if (pPackage->fCanAffectRegistration) 1045 if (pPackage->fCanAffectRegistration)
1047 { 1046 {
1048 pPackage->cacheRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_PRESENT; 1047 pPackage->cacheRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_PRESENT;
@@ -1158,7 +1157,7 @@ namespace Bootstrapper
1158 pRelatedBundle->fPlannable = TRUE; 1157 pRelatedBundle->fPlannable = TRUE;
1159 pRelatedBundle->relationType = BOOTSTRAPPER_RELATION_UPGRADE; 1158 pRelatedBundle->relationType = BOOTSTRAPPER_RELATION_UPGRADE;
1160 1159
1161 hr = PseudoBundleInitialize(0, &pRelatedBundle->package, TRUE, wzId, pRelatedBundle->relationType, BOOTSTRAPPER_PACKAGE_STATE_PRESENT, BURN_CACHE_STATE_COMPLETE, NULL, NULL, NULL, 0, FALSE, L"-quiet", L"-repair -quiet", L"-uninstall -quiet", &dependencyProvider, NULL, 0); 1160 hr = PseudoBundleInitialize(0, &pRelatedBundle->package, TRUE, wzId, pRelatedBundle->relationType, BOOTSTRAPPER_PACKAGE_STATE_PRESENT, TRUE, NULL, NULL, NULL, 0, FALSE, L"-quiet", L"-repair -quiet", L"-uninstall -quiet", &dependencyProvider, NULL, 0);
1162 NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId); 1161 NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId);
1163 1162
1164 ++pRelatedBundles->cRelatedBundles; 1163 ++pRelatedBundles->cRelatedBundles;