shell32/tests: Skip interactive part of SetNameOf test on Win2k.
Nicolas Le Cam
niko.lecam at gmail.com
Tue Apr 7 12:15:35 CDT 2009
---
dlls/shell32/tests/shlfolder.c | 63 +++++++++++++++++++++------------------
1 files changed, 34 insertions(+), 29 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 08ea9cc..cbbad01 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -473,7 +473,7 @@ static void test_GetDisplayName(void)
IShellFolder_Release(psfFile);
}
- if(!pSHBindToParent)
+ if (!pSHBindToParent)
{
win_skip("SHBindToParent is missing\n");
DeleteFileA(szTestFile);
@@ -482,37 +482,42 @@ static void test_GetDisplayName(void)
}
/* Some tests for IShellFolder::SetNameOf */
- hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
- ok(SUCCEEDED(hr), "SHBindToParent failed! hr = %08x\n", hr);
- if (SUCCEEDED(hr)) {
- /* It's ok to use this fixed path. Call will fail anyway. */
- WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
- LPITEMIDLIST pidlNew;
-
- /* The pidl returned through the last parameter of SetNameOf is a simple one. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
- ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
- if(hr == S_OK)
- {
- ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
- "pidl returned from SetNameOf should be simple!\n");
-
- /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
- * is implemented on top of SHFileOperation in WinXP. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
- SHGDN_FORPARSING, NULL);
- ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
-
- /* Rename the file back to its original name. SetNameOf ignores the fact, that the
- * SHGDN flags specify an absolute path. */
- hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
+ if (pSHGetFolderPathAndSubDirA)
+ {
+ hr = pSHBindToParent(pidlTestFile, &IID_IShellFolder, (VOID**)&psfPersonal, &pidlLast);
+ ok(SUCCEEDED(hr), "SHBindToParent failed! hr = %08x\n", hr);
+ if (SUCCEEDED(hr)) {
+ /* It's ok to use this fixed path. Call will fail anyway. */
+ WCHAR wszAbsoluteFilename[] = { 'C',':','\\','w','i','n','e','t','e','s','t', 0 };
+ LPITEMIDLIST pidlNew;
+
+ /* The pidl returned through the last parameter of SetNameOf is a simple one. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlLast, wszDirName, SHGDN_NORMAL, &pidlNew);
ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
+ if (hr == S_OK)
+ {
+ ok (((LPITEMIDLIST)((LPBYTE)pidlNew+pidlNew->mkid.cb))->mkid.cb == 0,
+ "pidl returned from SetNameOf should be simple!\n");
+
+ /* Passing an absolute path to SetNameOf fails. The HRESULT code indicates that SetNameOf
+ * is implemented on top of SHFileOperation in WinXP. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszAbsoluteFilename,
+ SHGDN_FORPARSING, NULL);
+ ok (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "SetNameOf succeeded! hr = %08x\n", hr);
+
+ /* Rename the file back to its original name. SetNameOf ignores the fact, that the
+ * SHGDN flags specify an absolute path. */
+ hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
+ ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
+
+ pILFree(pidlNew);
+ }
- pILFree(pidlNew);
+ IShellFolder_Release(psfPersonal);
}
-
- IShellFolder_Release(psfPersonal);
}
+ else
+ win_skip("Avoid needs of interaction on Win2k\n");
/* Deleting the file and the directory */
DeleteFileA(szTestFile);
--
1.5.6.3
--=-i9kZToyyg3eVvp87OLjT--
More information about the wine-patches
mailing list