Robert Wilhelm : scrrun: Test whether IFolder_get_Path() returns an absolute path.
Module: wine Branch: master Commit: 4e360e8d428a383ff49546e91701a1bd43ffcc7d URL: https://gitlab.winehq.org/wine/wine/-/commit/4e360e8d428a383ff49546e91701a1b... Author: Robert Wilhelm <robert.wilhelm(a)gmx.net> Date: Mon Sep 5 20:35:19 2022 +0200 scrrun: Test whether IFolder_get_Path() returns an absolute path. --- dlls/scrrun/tests/filesystem.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index 59f5859c556..98652ecf523 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -27,6 +27,7 @@ #include "olectl.h" #include "oleauto.h" #include "dispex.h" +#include "shlwapi.h" #include "wine/test.h" @@ -927,7 +928,9 @@ static void test_BuildPath(void) static void test_GetFolder(void) { - WCHAR buffW[MAX_PATH]; + static const WCHAR dir[] = L"test_dir"; + + WCHAR buffW[MAX_PATH], temp_path[MAX_PATH], prev_path[MAX_PATH]; IFolder *folder; HRESULT hr; BSTR str; @@ -959,6 +962,22 @@ static void test_GetFolder(void) SysFreeString(str); test_provideclassinfo(folder, &CLSID_Folder); IFolder_Release(folder); + + GetCurrentDirectoryW(MAX_PATH, prev_path); + GetTempPathW(MAX_PATH, temp_path); + SetCurrentDirectoryW(temp_path); + ok(CreateDirectoryW(dir, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(dir)); + str = SysAllocString(dir); + hr = IFileSystem3_GetFolder(fs3, str, &folder); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + SysFreeString(str); + hr = IFolder_get_Path(folder, &str); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine ok(!PathIsRelativeW(str), "path %s is relative.\n", wine_dbgstr_w(str)); + SysFreeString(str); + IFolder_Release(folder); + RemoveDirectoryW(dir); + SetCurrentDirectoryW(prev_path); } static void _test_clone(IEnumVARIANT *enumvar, BOOL position_inherited, LONG count, int line)
participants (1)
-
Alexandre Julliard