diff options
| author | Rob Mensching <rob@firegiant.com> | 2025-05-28 15:41:20 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-05-28 16:30:52 -0700 |
| commit | 0800d94e8534da426ba89f60287511d07fe4f674 (patch) | |
| tree | 5f239794ea0c56bcdd0609b27ae63b9c0379df9b /src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp | |
| parent | 6f41d1f08207bfaa64bc1bfccf936fb57564062c (diff) | |
| download | wix-0800d94e8534da426ba89f60287511d07fe4f674.tar.gz wix-0800d94e8534da426ba89f60287511d07fe4f674.tar.bz2 wix-0800d94e8534da426ba89f60287511d07fe4f674.zip | |
Retry intermittent LocLoadFromFile() test failures
Diffstat (limited to 'src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp')
| -rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp index a558c0c5..fd8679cb 100644 --- a/src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp | |||
| @@ -15,6 +15,7 @@ namespace DutilTests | |||
| 15 | void CanLoadControlsWxl() | 15 | void CanLoadControlsWxl() |
| 16 | { | 16 | { |
| 17 | HRESULT hr = S_OK; | 17 | HRESULT hr = S_OK; |
| 18 | DWORD dwRetry = 0; | ||
| 18 | WIX_LOCALIZATION* pLoc = NULL; | 19 | WIX_LOCALIZATION* pLoc = NULL; |
| 19 | LOC_CONTROL* pLocControl = NULL; | 20 | LOC_CONTROL* pLocControl = NULL; |
| 20 | 21 | ||
| @@ -26,7 +27,15 @@ namespace DutilTests | |||
| 26 | NativeAssert::Succeeded(hr, "Failed to initialize Xml."); | 27 | NativeAssert::Succeeded(hr, "Failed to initialize Xml."); |
| 27 | 28 | ||
| 28 | pin_ptr<const wchar_t> wxlFilePath = PtrToStringChars(TestData::Get("TestData", "LocUtilTests", "controls.wxl")); | 29 | pin_ptr<const wchar_t> wxlFilePath = PtrToStringChars(TestData::Get("TestData", "LocUtilTests", "controls.wxl")); |
| 29 | hr = LocLoadFromFile(wxlFilePath, &pLoc); | 30 | do |
| 31 | { | ||
| 32 | if (FAILED(hr)) | ||
| 33 | { | ||
| 34 | ::Sleep(500); | ||
| 35 | } | ||
| 36 | |||
| 37 | hr = LocLoadFromFile(wxlFilePath, &pLoc); | ||
| 38 | } while (FAILED(hr) && ++dwRetry < 5); | ||
| 30 | NativeAssert::Succeeded(hr, "Failed to parse controls.wxl: {0}", wxlFilePath); | 39 | NativeAssert::Succeeded(hr, "Failed to parse controls.wxl: {0}", wxlFilePath); |
| 31 | 40 | ||
| 32 | Assert::Equal(3ul, pLoc->cLocControls); | 41 | Assert::Equal(3ul, pLoc->cLocControls); |
