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 | |
parent | 6f41d1f08207bfaa64bc1bfccf936fb57564062c (diff) | |
download | wix-0800d94e8534da426ba89f60287511d07fe4f674.tar.gz wix-0800d94e8534da426ba89f60287511d07fe4f674.tar.bz2 wix-0800d94e8534da426ba89f60287511d07fe4f674.zip |
Retry intermittent LocLoadFromFile() test failures
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/LocControlsUtilTests.cpp | 11 | ||||
-rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/LocStringsUtilTests.cpp | 11 |
2 files changed, 20 insertions, 2 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); |
diff --git a/src/libs/dutil/test/DUtilUnitTest/LocStringsUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/LocStringsUtilTests.cpp index 1bfc4bb4..04130098 100644 --- a/src/libs/dutil/test/DUtilUnitTest/LocStringsUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/LocStringsUtilTests.cpp | |||
@@ -15,6 +15,7 @@ namespace DutilTests | |||
15 | void CanLoadStringsWxl() | 15 | void CanLoadStringsWxl() |
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_STRING* pLocString = NULL; | 20 | LOC_STRING* pLocString = NULL; |
20 | LPWSTR sczValue = NULL; | 21 | LPWSTR sczValue = NULL; |
@@ -27,7 +28,15 @@ namespace DutilTests | |||
27 | NativeAssert::Succeeded(hr, "Failed to initialize Xml."); | 28 | NativeAssert::Succeeded(hr, "Failed to initialize Xml."); |
28 | 29 | ||
29 | pin_ptr<const wchar_t> wxlFilePath = PtrToStringChars(TestData::Get("TestData", "LocUtilTests", "strings.wxl")); | 30 | pin_ptr<const wchar_t> wxlFilePath = PtrToStringChars(TestData::Get("TestData", "LocUtilTests", "strings.wxl")); |
30 | hr = LocLoadFromFile(wxlFilePath, &pLoc); | 31 | do |
32 | { | ||
33 | if (FAILED(hr)) | ||
34 | { | ||
35 | ::Sleep(500); | ||
36 | } | ||
37 | |||
38 | hr = LocLoadFromFile(wxlFilePath, &pLoc); | ||
39 | } while (FAILED(hr) && ++dwRetry < 5); | ||
31 | NativeAssert::Succeeded(hr, "Failed to parse strings.wxl: {0}", wxlFilePath); | 40 | NativeAssert::Succeeded(hr, "Failed to parse strings.wxl: {0}", wxlFilePath); |
32 | 41 | ||
33 | Assert::Equal(4ul, pLoc->cLocStrings); | 42 | Assert::Equal(4ul, pLoc->cLocStrings); |