From 9ae1c04d5fa02ac020885cdad7c592f7bb43d83e Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 3 Aug 2021 15:41:53 -0500 Subject: Parse most of Burn command line parameters into BURN_ENGINE_COMMAND. --- src/burn/test/BurnUnitTest/PlanTest.cpp | 5 ++++- src/burn/test/BurnUnitTest/RegistrationTest.cpp | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src/burn/test') diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index c7f2037d..ee3dcf3a 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp @@ -1144,9 +1144,12 @@ namespace Bootstrapper __in LPCWSTR wzVersion ) { - HRESULT hr = StrAllocString(&pEngineState->registration.sczAncestors, wzId, 0); + HRESULT hr = StrAllocString(&pEngineState->internalCommand.sczAncestors, wzId, 0); NativeAssert::Succeeded(hr, "Failed to set registration's ancestors"); + hr = StrAllocFormatted(&pEngineState->registration.sczBundlePackageAncestors, L"%ls;%ls", wzId, pEngineState->registration.sczId); + NativeAssert::Succeeded(hr, "Failed to set registration's package ancestors"); + pEngineState->command.relationType = BOOTSTRAPPER_RELATION_UPGRADE; DetectPackagesAsPresentAndCached(pEngineState); diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index af52e893..32ff9ea2 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp @@ -115,9 +115,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -213,9 +214,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -334,9 +336,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -455,9 +458,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -601,9 +605,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -738,9 +743,10 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to parse registration from XML."); plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pCommand = &command; plan.pInternalCommand = &internalCommand; - hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); + hr = PlanSetResumeCommand(&plan, ®istration, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); -- cgit v1.2.3-55-g6feb