diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-17 20:58:32 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-19 23:12:55 -0500 |
commit | d4c76dd11f5a096b4fd3ee9c5efc1f44559ac3da (patch) | |
tree | 002f0351a05420b3cc1cbca052d4159cfc11706d /src/test | |
parent | 26151ceeb5c57e3fd0bf73e9c13d8d72b41cce74 (diff) | |
download | wix-d4c76dd11f5a096b4fd3ee9c5efc1f44559ac3da.tar.gz wix-d4c76dd11f5a096b4fd3ee9c5efc1f44559ac3da.tar.bz2 wix-d4c76dd11f5a096b4fd3ee9c5efc1f44559ac3da.zip |
Send more progress during cache verification.
Add verifyStep to OnCacheVerifyProgress.
Send OnContainerOrPayloadVerify events only if file existed in cache.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/BurnUnitTest/CacheTest.cpp | 46 | ||||
-rw-r--r-- | src/test/BurnUnitTest/PlanTest.cpp | 10 |
2 files changed, 50 insertions, 6 deletions
diff --git a/src/test/BurnUnitTest/CacheTest.cpp b/src/test/BurnUnitTest/CacheTest.cpp index fc0b4531..d0cc237f 100644 --- a/src/test/BurnUnitTest/CacheTest.cpp +++ b/src/test/BurnUnitTest/CacheTest.cpp | |||
@@ -2,6 +2,26 @@ | |||
2 | 2 | ||
3 | #include "precomp.h" | 3 | #include "precomp.h" |
4 | 4 | ||
5 | static HRESULT CALLBACK CacheTestEventRoutine( | ||
6 | __in BURN_CACHE_MESSAGE* pMessage, | ||
7 | __in LPVOID pvContext | ||
8 | ); | ||
9 | |||
10 | static DWORD CALLBACK CacheTestProgressRoutine( | ||
11 | __in LARGE_INTEGER TotalFileSize, | ||
12 | __in LARGE_INTEGER TotalBytesTransferred, | ||
13 | __in LARGE_INTEGER StreamSize, | ||
14 | __in LARGE_INTEGER StreamBytesTransferred, | ||
15 | __in DWORD dwStreamNumber, | ||
16 | __in DWORD dwCallbackReason, | ||
17 | __in HANDLE hSourceFile, | ||
18 | __in HANDLE hDestinationFile, | ||
19 | __in_opt LPVOID lpData | ||
20 | ); | ||
21 | |||
22 | typedef struct _CACHE_TEST_CONTEXT | ||
23 | { | ||
24 | } CACHE_TEST_CONTEXT; | ||
5 | 25 | ||
6 | namespace Microsoft | 26 | namespace Microsoft |
7 | { | 27 | { |
@@ -33,6 +53,7 @@ namespace Bootstrapper | |||
33 | LPWSTR sczPayloadPath = NULL; | 53 | LPWSTR sczPayloadPath = NULL; |
34 | BYTE* pb = NULL; | 54 | BYTE* pb = NULL; |
35 | DWORD cb = NULL; | 55 | DWORD cb = NULL; |
56 | CACHE_TEST_CONTEXT context = { }; | ||
36 | 57 | ||
37 | try | 58 | try |
38 | { | 59 | { |
@@ -51,7 +72,7 @@ namespace Bootstrapper | |||
51 | payload.pbHash = pb; | 72 | payload.pbHash = pb; |
52 | payload.cbHash = cb; | 73 | payload.cbHash = cb; |
53 | 74 | ||
54 | hr = CacheCompletePayload(package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE); | 75 | hr = CacheCompletePayload(package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE, CacheTestEventRoutine, CacheTestProgressRoutine, &context); |
55 | Assert::Equal(S_OK, hr); | 76 | Assert::Equal(S_OK, hr); |
56 | } | 77 | } |
57 | finally | 78 | finally |
@@ -73,3 +94,26 @@ namespace Bootstrapper | |||
73 | } | 94 | } |
74 | } | 95 | } |
75 | } | 96 | } |
97 | |||
98 | static HRESULT CALLBACK CacheTestEventRoutine( | ||
99 | __in BURN_CACHE_MESSAGE* /*pMessage*/, | ||
100 | __in LPVOID /*pvContext*/ | ||
101 | ) | ||
102 | { | ||
103 | return S_OK; | ||
104 | } | ||
105 | |||
106 | static DWORD CALLBACK CacheTestProgressRoutine( | ||
107 | __in LARGE_INTEGER /*TotalFileSize*/, | ||
108 | __in LARGE_INTEGER /*TotalBytesTransferred*/, | ||
109 | __in LARGE_INTEGER /*StreamSize*/, | ||
110 | __in LARGE_INTEGER /*StreamBytesTransferred*/, | ||
111 | __in DWORD /*dwStreamNumber*/, | ||
112 | __in DWORD /*dwCallbackReason*/, | ||
113 | __in HANDLE /*hSourceFile*/, | ||
114 | __in HANDLE /*hDestinationFile*/, | ||
115 | __in_opt LPVOID /*lpData*/ | ||
116 | ) | ||
117 | { | ||
118 | return PROGRESS_QUIET; | ||
119 | } | ||
diff --git a/src/test/BurnUnitTest/PlanTest.cpp b/src/test/BurnUnitTest/PlanTest.cpp index c073696b..a7c1d83c 100644 --- a/src/test/BurnUnitTest/PlanTest.cpp +++ b/src/test/BurnUnitTest/PlanTest.cpp | |||
@@ -71,7 +71,7 @@ namespace Bootstrapper | |||
71 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 71 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
72 | 72 | ||
73 | Assert::Equal(107082ull, pPlan->qwEstimatedSize); | 73 | Assert::Equal(107082ull, pPlan->qwEstimatedSize); |
74 | Assert::Equal(303687ull, pPlan->qwCacheSizeTotal); | 74 | Assert::Equal(506145ull, pPlan->qwCacheSizeTotal); |
75 | 75 | ||
76 | fRollback = FALSE; | 76 | fRollback = FALSE; |
77 | dwIndex = 0; | 77 | dwIndex = 0; |
@@ -308,7 +308,7 @@ namespace Bootstrapper | |||
308 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 308 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
309 | 309 | ||
310 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | 310 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); |
311 | Assert::Equal(101229ull, pPlan->qwCacheSizeTotal); | 311 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
312 | 312 | ||
313 | fRollback = FALSE; | 313 | fRollback = FALSE; |
314 | dwIndex = 0; | 314 | dwIndex = 0; |
@@ -388,7 +388,7 @@ namespace Bootstrapper | |||
388 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 388 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
389 | 389 | ||
390 | Assert::Equal(33743ull, pPlan->qwEstimatedSize); | 390 | Assert::Equal(33743ull, pPlan->qwEstimatedSize); |
391 | Assert::Equal(101229ull, pPlan->qwCacheSizeTotal); | 391 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
392 | 392 | ||
393 | fRollback = FALSE; | 393 | fRollback = FALSE; |
394 | dwIndex = 0; | 394 | dwIndex = 0; |
@@ -458,7 +458,7 @@ namespace Bootstrapper | |||
458 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 458 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
459 | 459 | ||
460 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | 460 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); |
461 | Assert::Equal(101229ull, pPlan->qwCacheSizeTotal); | 461 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
462 | 462 | ||
463 | fRollback = FALSE; | 463 | fRollback = FALSE; |
464 | dwIndex = 0; | 464 | dwIndex = 0; |
@@ -739,7 +739,7 @@ namespace Bootstrapper | |||
739 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 739 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
740 | 740 | ||
741 | Assert::Equal(3055111ull, pPlan->qwEstimatedSize); | 741 | Assert::Equal(3055111ull, pPlan->qwEstimatedSize); |
742 | Assert::Equal(106496ull, pPlan->qwCacheSizeTotal); | 742 | Assert::Equal(212992ull, pPlan->qwCacheSizeTotal); |
743 | 743 | ||
744 | fRollback = FALSE; | 744 | fRollback = FALSE; |
745 | dwIndex = 0; | 745 | dwIndex = 0; |