diff options
Diffstat (limited to 'src/burn/test/BurnUnitTest/PlanTest.cpp')
| -rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 35ddb22f..7e704c23 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
| @@ -117,7 +117,7 @@ namespace Bootstrapper | |||
| 117 | ValidateExecuteCommitMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ"); | 117 | ValidateExecuteCommitMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ"); |
| 118 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 118 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 119 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | 119 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); |
| 120 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | 120 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); |
| 121 | Assert::Equal(dwIndex, pPlan->cExecuteActions); | 121 | Assert::Equal(dwIndex, pPlan->cExecuteActions); |
| 122 | 122 | ||
| 123 | fRollback = TRUE; | 123 | fRollback = TRUE; |
| @@ -155,7 +155,7 @@ namespace Bootstrapper | |||
| 155 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 155 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 156 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 156 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 157 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | 157 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); |
| 158 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | 158 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); |
| 159 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | 159 | Assert::Equal(dwIndex, pPlan->cRollbackActions); |
| 160 | 160 | ||
| 161 | Assert::Equal(4ul, pPlan->cExecutePackagesTotal); | 161 | Assert::Equal(4ul, pPlan->cExecutePackagesTotal); |
| @@ -496,7 +496,7 @@ namespace Bootstrapper | |||
| 496 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 496 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 497 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 497 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 498 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | 498 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); |
| 499 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | 499 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); |
| 500 | Assert::Equal(dwIndex, pPlan->cExecuteActions); | 500 | Assert::Equal(dwIndex, pPlan->cExecuteActions); |
| 501 | 501 | ||
| 502 | fRollback = TRUE; | 502 | fRollback = TRUE; |
| @@ -514,7 +514,7 @@ namespace Bootstrapper | |||
| 514 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 514 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 515 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 515 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 516 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | 516 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); |
| 517 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | 517 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); |
| 518 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | 518 | Assert::Equal(dwIndex, pPlan->cRollbackActions); |
| 519 | 519 | ||
| 520 | Assert::Equal(2ul, pPlan->cExecutePackagesTotal); | 520 | Assert::Equal(2ul, pPlan->cExecutePackagesTotal); |
| @@ -1154,7 +1154,11 @@ namespace Bootstrapper | |||
| 1154 | pRelatedBundle->fPlannable = TRUE; | 1154 | pRelatedBundle->fPlannable = TRUE; |
| 1155 | pRelatedBundle->relationType = BOOTSTRAPPER_RELATION_UPGRADE; | 1155 | pRelatedBundle->relationType = BOOTSTRAPPER_RELATION_UPGRADE; |
| 1156 | 1156 | ||
| 1157 | hr = PseudoBundleInitialize(&pRelatedBundle->package, TRUE, TRUE, wzId, pRelatedBundle->relationType, BOOTSTRAPPER_PACKAGE_STATE_PRESENT, TRUE, wzFilePath, wzFilePath, NULL, 0, FALSE, L"-quiet", L"-repair -quiet", L"-uninstall -quiet", &dependencyProvider, NULL, 0); | 1157 | hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, TRUE, TRUE, wzId, |
| 1158 | #ifdef DEBUG | ||
| 1159 | pRelatedBundle->relationType, | ||
| 1160 | #endif | ||
| 1161 | TRUE, wzFilePath, 0, &dependencyProvider); | ||
| 1158 | NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId); | 1162 | NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId); |
| 1159 | 1163 | ||
| 1160 | ++pRelatedBundles->cRelatedBundles; | 1164 | ++pRelatedBundles->cRelatedBundles; |
| @@ -1310,7 +1314,7 @@ namespace Bootstrapper | |||
| 1310 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); | 1314 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); |
| 1311 | } | 1315 | } |
| 1312 | 1316 | ||
| 1313 | void ValidateExecuteExePackage( | 1317 | void ValidateExecuteRelatedBundle( |
| 1314 | __in BURN_PLAN* pPlan, | 1318 | __in BURN_PLAN* pPlan, |
| 1315 | __in BOOL fRollback, | 1319 | __in BOOL fRollback, |
| 1316 | __in DWORD dwIndex, | 1320 | __in DWORD dwIndex, |
| @@ -1320,10 +1324,25 @@ namespace Bootstrapper | |||
| 1320 | ) | 1324 | ) |
| 1321 | { | 1325 | { |
| 1322 | BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex); | 1326 | BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex); |
| 1327 | Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE, pAction->type); | ||
| 1328 | NativeAssert::StringEqual(wzPackageId, pAction->relatedBundle.pRelatedBundle->package.sczId); | ||
| 1329 | Assert::Equal<DWORD>(action, pAction->relatedBundle.action); | ||
| 1330 | NativeAssert::StringEqual(wzIgnoreDependencies, pAction->relatedBundle.sczIgnoreDependencies); | ||
| 1331 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); | ||
| 1332 | } | ||
| 1333 | |||
| 1334 | void ValidateExecuteExePackage( | ||
| 1335 | __in BURN_PLAN* pPlan, | ||
| 1336 | __in BOOL fRollback, | ||
| 1337 | __in DWORD dwIndex, | ||
| 1338 | __in LPCWSTR wzPackageId, | ||
| 1339 | __in BOOTSTRAPPER_ACTION_STATE action | ||
| 1340 | ) | ||
| 1341 | { | ||
| 1342 | BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex); | ||
| 1323 | Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE, pAction->type); | 1343 | Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE, pAction->type); |
| 1324 | NativeAssert::StringEqual(wzPackageId, pAction->exePackage.pPackage->sczId); | 1344 | NativeAssert::StringEqual(wzPackageId, pAction->exePackage.pPackage->sczId); |
| 1325 | Assert::Equal<DWORD>(action, pAction->exePackage.action); | 1345 | Assert::Equal<DWORD>(action, pAction->exePackage.action); |
| 1326 | NativeAssert::StringEqual(wzIgnoreDependencies, pAction->exePackage.sczIgnoreDependencies); | ||
| 1327 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); | 1346 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); |
| 1328 | } | 1347 | } |
| 1329 | 1348 | ||
