diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-03 17:48:57 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-07 19:44:36 -0500 |
| commit | 648f370f7966b2738c1446601057d888bbd2c70f (patch) | |
| tree | 9022566b1016f94127dfb7e84c9b4dfa057993cd /src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp | |
| parent | 6b0f2d978504da82070523eb6adb0b59f9812e93 (diff) | |
| download | wix-648f370f7966b2738c1446601057d888bbd2c70f.tar.gz wix-648f370f7966b2738c1446601057d888bbd2c70f.tar.bz2 wix-648f370f7966b2738c1446601057d888bbd2c70f.zip | |
Make PathGetSystemPath return an array of paths ordered by preference.
Diffstat (limited to 'src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp')
| -rw-r--r-- | src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp index d1d304d3..e9ef1047 100644 --- a/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp | |||
| @@ -800,6 +800,34 @@ namespace DutilTests | |||
| 800 | } | 800 | } |
| 801 | 801 | ||
| 802 | [Fact] | 802 | [Fact] |
| 803 | void PathGetSystemTempPathsTest() | ||
| 804 | { | ||
| 805 | HRESULT hr = S_OK; | ||
| 806 | LPWSTR* rgsczPaths = NULL; | ||
| 807 | DWORD cPaths = 0; | ||
| 808 | DWORD cPathsOriginal = 0; | ||
| 809 | |||
| 810 | try | ||
| 811 | { | ||
| 812 | hr = PathGetSystemTempPaths(&rgsczPaths, &cPaths); | ||
| 813 | NativeAssert::Succeeded(hr, "PathGetSystemTempPaths failed."); | ||
| 814 | |||
| 815 | Assert::InRange<DWORD>(cPaths, 1, 3); | ||
| 816 | WixAssert::StringEqual(Environment::ExpandEnvironmentVariables("%windir%\\temp\\"), gcnew String(rgsczPaths[cPaths - 1]), true); | ||
| 817 | |||
| 818 | cPathsOriginal = cPaths; | ||
| 819 | |||
| 820 | hr = PathGetSystemTempPaths(&rgsczPaths, &cPaths); | ||
| 821 | NativeAssert::Succeeded(hr, "PathGetSystemTempPaths failed."); | ||
| 822 | Assert::Equal(cPathsOriginal * 2, cPaths); | ||
| 823 | } | ||
| 824 | finally | ||
| 825 | { | ||
| 826 | ReleaseStrArray(rgsczPaths, cPaths); | ||
| 827 | } | ||
| 828 | } | ||
| 829 | |||
| 830 | [Fact] | ||
| 803 | void PathNormalizeSlashesFixedTest() | 831 | void PathNormalizeSlashesFixedTest() |
| 804 | { | 832 | { |
| 805 | HRESULT hr = S_OK; | 833 | HRESULT hr = S_OK; |
