diff options
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; |
