From ce8acddf52bde840571535c3dfd56a2371d80684 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 3 Aug 2021 15:41:34 -0500 Subject: Add BURN_DEPENDENCIES struct to store Dependency state. --- src/burn/test/BurnUnitTest/PlanTest.cpp | 8 +----- src/burn/test/BurnUnitTest/RegistrationTest.cpp | 36 ++++++++++++++++++++----- src/burn/test/BurnUnitTest/precomp.h | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) (limited to 'src/burn/test') diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 2e3b1092..c7f2037d 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp @@ -959,15 +959,9 @@ namespace Bootstrapper void PlanTestDetect(BURN_ENGINE_STATE* pEngineState) { - HRESULT hr = S_OK; - BURN_REGISTRATION* pRegistration = &pEngineState->registration; - - DetectReset(pRegistration, &pEngineState->packages); + DetectReset(&pEngineState->registration, &pEngineState->packages); PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); - hr = DepDependencyArrayAlloc(&pRegistration->rgIgnoredDependencies, &pRegistration->cIgnoredDependencies, pRegistration->sczProviderKey, NULL); - NativeAssert::Succeeded(hr, "Failed to add the bundle provider key to the list of dependencies to ignore."); - pEngineState->userExperience.fEngineActive = TRUE; pEngineState->fDetected = TRUE; } diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index 7c0dde5a..af52e893 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp @@ -75,6 +75,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); @@ -113,7 +114,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -170,6 +174,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); @@ -207,7 +212,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -287,6 +295,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); @@ -324,7 +333,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -402,6 +414,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); @@ -441,7 +454,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -534,6 +550,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; BYTE* pbBuffer = NULL; @@ -583,7 +600,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); @@ -668,6 +688,7 @@ namespace Bootstrapper BURN_REGISTRATION registration = { }; BURN_LOGGING logging = { }; BURN_PACKAGES packages = { }; + BURN_PLAN plan = { }; BURN_CACHE cache = { }; BURN_ENGINE_COMMAND internalCommand = { }; BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; @@ -716,7 +737,10 @@ namespace Bootstrapper hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); TestThrowOnFailure(hr, L"Failed to parse registration from XML."); - hr = PlanSetResumeCommand(®istration, BOOTSTRAPPER_ACTION_INSTALL, &command, &logging); + plan.action = BOOTSTRAPPER_ACTION_INSTALL; + plan.pInternalCommand = &internalCommand; + + hr = PlanSetResumeCommand(&plan, ®istration, &command, &logging); TestThrowOnFailure(hr, L"Failed to set registration resume command."); hr = PathForCurrentProcess(&sczCurrentProcess, NULL); diff --git a/src/burn/test/BurnUnitTest/precomp.h b/src/burn/test/BurnUnitTest/precomp.h index a77dfe32..a31917b4 100644 --- a/src/burn/test/BurnUnitTest/precomp.h +++ b/src/burn/test/BurnUnitTest/precomp.h @@ -57,13 +57,13 @@ #include "pipe.h" #include "logging.h" #include "cache.h" +#include "dependency.h" #include "core.h" #include "apply.h" #include "exeengine.h" #include "msiengine.h" #include "mspengine.h" #include "msuengine.h" -#include "dependency.h" #include "elevation.h" #include "embedded.h" #include "manifest.h" -- cgit v1.2.3-55-g6feb