Mariusz Pluciński : shell32/tests: Basic tests of IKnownFolderManager.
Alexandre Julliard
julliard at winehq.org
Fri Jun 10 11:16:21 CDT 2011
Module: wine
Branch: master
Commit: ab23dca7e9546a5e0f0e14a3fade6cd9ac93e3a8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ab23dca7e9546a5e0f0e14a3fade6cd9ac93e3a8
Author: Mariusz Pluciński <vshader at gmail.com>
Date: Thu Jun 9 10:40:02 2011 +0200
shell32/tests: Basic tests of IKnownFolderManager.
---
dlls/shell32/tests/shellpath.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index d81ce80..7e77b25 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -883,6 +883,37 @@ if (0) { /* crashes */
ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr);
}
+static void test_knownFolders(void)
+{
+ HRESULT hr;
+ IKnownFolderManager *mgr = NULL;
+ KNOWNFOLDERID folderId;
+ int csidl;
+
+ CoInitialize(NULL);
+
+ hr = CoCreateInstance(&CLSID_KnownFolderManager, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IKnownFolderManager, (LPVOID*)&mgr);
+ if(hr == REGDB_E_CLASSNOTREG)
+ win_skip("IKnownFolderManager unavailable\n");
+ else
+ {
+ ok(hr == S_OK, "failed to create KnownFolderManager instance: 0x%08x\n", hr);
+
+ hr = IKnownFolderManager_FolderIdFromCsidl(mgr, CSIDL_WINDOWS, &folderId);
+ ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08x\n", hr);
+ ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n");
+
+ hr = IKnownFolderManager_FolderIdToCsidl(mgr, &FOLDERID_Windows, &csidl);
+ ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08x\n", hr);
+ ok(csidl == CSIDL_WINDOWS, "invalid CSIDL returned\n");
+
+ hr = IKnownFolderManager_Release(mgr);
+ ok(hr == S_OK, "failed to release KnownFolderManager instance: 0x%08x\n", hr);
+ }
+ CoUninitialize();
+}
+
START_TEST(shellpath)
{
if (!init()) return;
@@ -909,5 +940,6 @@ START_TEST(shellpath)
testSystemDir();
test_NonExistentPath();
test_SHGetFolderPathEx();
+ test_knownFolders();
}
}
More information about the wine-cvs
mailing list