From 6d7a275edafb3ae0f3cff94d66503a82dafb71f7 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 3 Aug 2021 15:41:18 -0500 Subject: Replace static cache internals with a struct. Initialize them explicitly to make it clearer when that happens. --- src/burn/test/BurnUnitTest/CacheTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/burn/test/BurnUnitTest/CacheTest.cpp') diff --git a/src/burn/test/BurnUnitTest/CacheTest.cpp b/src/burn/test/BurnUnitTest/CacheTest.cpp index e9ad555b..6979ec1a 100644 --- a/src/burn/test/BurnUnitTest/CacheTest.cpp +++ b/src/burn/test/BurnUnitTest/CacheTest.cpp @@ -48,6 +48,8 @@ namespace Bootstrapper void CacheSignatureTest() { HRESULT hr = S_OK; + BURN_CACHE cache = { }; + BURN_ENGINE_COMMAND internalCommand = { }; BURN_PACKAGE package = { }; BURN_PAYLOAD payload = { }; LPWSTR sczPayloadPath = NULL; @@ -74,7 +76,10 @@ namespace Bootstrapper payload.qwFileSize = 27; payload.verification = BURN_PAYLOAD_VERIFICATION_HASH; - hr = CacheCompletePayload(package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE, CacheTestEventRoutine, CacheTestProgressRoutine, &context); + hr = CacheInitialize(&cache, &internalCommand); + TestThrowOnFailure(hr, L"Failed initialize cache."); + + hr = CacheCompletePayload(&cache, package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE, CacheTestEventRoutine, CacheTestProgressRoutine, &context); Assert::Equal(S_OK, hr); } finally -- cgit v1.2.3-55-g6feb