diff options
Diffstat (limited to 'src/test/BurnUnitTest/SearchTest.cpp')
| -rw-r--r-- | src/test/BurnUnitTest/SearchTest.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/test/BurnUnitTest/SearchTest.cpp b/src/test/BurnUnitTest/SearchTest.cpp index 32107d87..d868190d 100644 --- a/src/test/BurnUnitTest/SearchTest.cpp +++ b/src/test/BurnUnitTest/SearchTest.cpp | |||
| @@ -106,6 +106,7 @@ namespace Bootstrapper | |||
| 106 | BURN_SEARCHES searches = { }; | 106 | BURN_SEARCHES searches = { }; |
| 107 | BURN_EXTENSIONS burnExtensions = { }; | 107 | BURN_EXTENSIONS burnExtensions = { }; |
| 108 | ULARGE_INTEGER uliVersion = { }; | 108 | ULARGE_INTEGER uliVersion = { }; |
| 109 | VERUTIL_VERSION* pVersion = NULL; | ||
| 109 | try | 110 | try |
| 110 | { | 111 | { |
| 111 | hr = VariableInitialize(&variables); | 112 | hr = VariableInitialize(&variables); |
| @@ -117,6 +118,9 @@ namespace Bootstrapper | |||
| 117 | hr = FileVersion(wzFile2, &uliVersion.HighPart, &uliVersion.LowPart); | 118 | hr = FileVersion(wzFile2, &uliVersion.HighPart, &uliVersion.LowPart); |
| 118 | TestThrowOnFailure(hr, L"Failed to get DLL version."); | 119 | TestThrowOnFailure(hr, L"Failed to get DLL version."); |
| 119 | 120 | ||
| 121 | hr = VerVersionFromQword(uliVersion.QuadPart, &pVersion); | ||
| 122 | NativeAssert::Succeeded(hr, "Failed to create version."); | ||
| 123 | |||
| 120 | VariableSetStringHelper(&variables, L"File1", wzFile1, FALSE); | 124 | VariableSetStringHelper(&variables, L"File1", wzFile1, FALSE); |
| 121 | VariableSetStringHelper(&variables, L"File2", wzFile2, FALSE); | 125 | VariableSetStringHelper(&variables, L"File2", wzFile2, FALSE); |
| 122 | 126 | ||
| @@ -140,10 +144,11 @@ namespace Bootstrapper | |||
| 140 | // check variable values | 144 | // check variable values |
| 141 | Assert::Equal(0ll, VariableGetNumericHelper(&variables, L"Variable1")); | 145 | Assert::Equal(0ll, VariableGetNumericHelper(&variables, L"Variable1")); |
| 142 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable2")); | 146 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable2")); |
| 143 | Assert::Equal(uliVersion.QuadPart, VariableGetVersionHelper(&variables, L"Variable3")); | 147 | Assert::Equal<String^>(gcnew String(pVersion->sczVersion), VariableGetVersionHelper(&variables, L"Variable3")); |
| 144 | } | 148 | } |
| 145 | finally | 149 | finally |
| 146 | { | 150 | { |
| 151 | ReleaseVerutilVersion(pVersion); | ||
| 147 | ReleaseObject(pixeBundle); | 152 | ReleaseObject(pixeBundle); |
| 148 | VariablesUninitialize(&variables); | 153 | VariablesUninitialize(&variables); |
| 149 | SearchesUninitialize(&searches); | 154 | SearchesUninitialize(&searches); |
| @@ -247,8 +252,8 @@ namespace Bootstrapper | |||
| 247 | Assert::NotEqual(gcnew String(L"String1 %TEMP%"), VariableGetStringHelper(&variables, L"Variable10")); | 252 | Assert::NotEqual(gcnew String(L"String1 %TEMP%"), VariableGetStringHelper(&variables, L"Variable10")); |
| 248 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable11")); | 253 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable11")); |
| 249 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable12")); | 254 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable12")); |
| 250 | Assert::Equal(MAKEQWORDVERSION(1,1,1,1), VariableGetVersionHelper(&variables, L"Variable13")); | 255 | Assert::Equal<String^>(gcnew String(L"1.1.1.1"), VariableGetVersionHelper(&variables, L"Variable13")); |
| 251 | Assert::Equal(MAKEQWORDVERSION(1,1,1,1), VariableGetVersionHelper(&variables, L"Variable14")); | 256 | Assert::Equal<String^>(gcnew String(L"1.1.1.1"), VariableGetVersionHelper(&variables, L"Variable14")); |
| 252 | Assert::Equal<String^>(gcnew String(L"String1"), VariableGetStringHelper(&variables, L"Variable15")); | 257 | Assert::Equal<String^>(gcnew String(L"String1"), VariableGetStringHelper(&variables, L"Variable15")); |
| 253 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable16")); | 258 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable16")); |
| 254 | Assert::False(VariableExistsHelper(&variables, L"Variable17")); | 259 | Assert::False(VariableExistsHelper(&variables, L"Variable17")); |
| @@ -401,11 +406,11 @@ namespace Bootstrapper | |||
| 401 | 406 | ||
| 402 | // check variable values | 407 | // check variable values |
| 403 | Assert::Equal(2ll, VariableGetNumericHelper(&variables, L"Variable1")); | 408 | Assert::Equal(2ll, VariableGetNumericHelper(&variables, L"Variable1")); |
| 404 | Assert::Equal(MAKEQWORDVERSION(1,0,0,0), VariableGetVersionHelper(&variables, L"Variable2")); | 409 | Assert::Equal<String^>(gcnew String(L"1.0.0.0"), VariableGetVersionHelper(&variables, L"Variable2")); |
| 405 | Assert::Equal(1033ll, VariableGetNumericHelper(&variables, L"Variable3")); | 410 | Assert::Equal(1033ll, VariableGetNumericHelper(&variables, L"Variable3")); |
| 406 | Assert::Equal(5ll, VariableGetNumericHelper(&variables, L"Variable4")); | 411 | Assert::Equal(5ll, VariableGetNumericHelper(&variables, L"Variable4")); |
| 407 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable5")); | 412 | Assert::Equal(1ll, VariableGetNumericHelper(&variables, L"Variable5")); |
| 408 | Assert::Equal(MAKEQWORDVERSION(1,0,0,0), VariableGetVersionHelper(&variables, L"Variable6")); | 413 | Assert::Equal<String^>(gcnew String(L"1.0.0.0"), VariableGetVersionHelper(&variables, L"Variable6")); |
| 409 | } | 414 | } |
| 410 | finally | 415 | finally |
| 411 | { | 416 | { |
| @@ -581,7 +586,7 @@ namespace Bootstrapper | |||
| 581 | Assert::Equal<String^>(gcnew String(L"VAL5"), VariableGetStringHelper(&variables, L"PROP5")); | 586 | Assert::Equal<String^>(gcnew String(L"VAL5"), VariableGetStringHelper(&variables, L"PROP5")); |
| 582 | Assert::Equal<String^>(gcnew String(L"VAL6"), VariableGetStringHelper(&variables, L"PROP6")); | 587 | Assert::Equal<String^>(gcnew String(L"VAL6"), VariableGetStringHelper(&variables, L"PROP6")); |
| 583 | Assert::Equal(7ll, VariableGetNumericHelper(&variables, L"PROP7")); | 588 | Assert::Equal(7ll, VariableGetNumericHelper(&variables, L"PROP7")); |
| 584 | Assert::Equal(MAKEQWORDVERSION(1, 1, 0, 0), VariableGetVersionHelper(&variables, L"PROP8")); | 589 | Assert::Equal<String^>(gcnew String(L"1.1.0.0"), VariableGetVersionHelper(&variables, L"PROP8")); |
| 585 | Assert::Equal<String^>(gcnew String(L"1.1.0.0"), VariableGetStringHelper(&variables, L"PROP8")); | 590 | Assert::Equal<String^>(gcnew String(L"1.1.0.0"), VariableGetStringHelper(&variables, L"PROP8")); |
| 586 | Assert::Equal<String^>(gcnew String(L"[VAL9]"), VariableGetStringHelper(&variables, L"PROP9")); | 591 | Assert::Equal<String^>(gcnew String(L"[VAL9]"), VariableGetStringHelper(&variables, L"PROP9")); |
| 587 | 592 | ||
