From bc38d5cd921c75972df6e05020f9593380770e8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= <vshader@gmail.com>
Date: Thu, 9 Jun 2011 10:41:04 +0200
Subject: [PATCH] shell32/tests: Test of IKnownFolder::GetFolderDefinition.

---
 dlls/shell32/tests/shellpath.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index 2a1c4367a22..2d710dc39ff 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -885,11 +885,13 @@ if (0) { /* crashes */
 
 static void test_knownFolders(void)
 {
+    static const WCHAR sWindows[] = {'W','i','n','d','o','w','s',0};
     HRESULT hr;
     IKnownFolderManager *mgr = NULL;
     IKnownFolder *folder = NULL;
     KNOWNFOLDERID folderId;
     KF_CATEGORY cat = 0;
+    KNOWNFOLDER_DEFINITION kfDefinition;
     int csidl;
     LPWSTR folderPath;
     KF_REDIRECTION_CAPABILITIES redirectionCapabilities = 1;
@@ -943,6 +945,20 @@ static void test_knownFolders(void)
             todo_wine
             ok(hr == E_INVALIDARG, "unexpected value from SetPath: 0x%08x\n", hr);
 
+            hr = IKnownFolder_GetFolderDefinition(folder, &kfDefinition);
+            todo_wine
+            ok(hr == S_OK, "failed to get folder definition: 0x%08x\n", hr);
+            if(SUCCEEDED(hr))
+            {
+                todo_wine
+                ok(kfDefinition.category==KF_CATEGORY_FIXED, "invalid folder category: 0x%08x\n", kfDefinition.category);
+                todo_wine
+                ok(lstrcmpW(kfDefinition.pszName, sWindows)==0, "invalid folder name: %s\n", wine_dbgstr_w(kfDefinition.pszName));
+                todo_wine
+                ok(kfDefinition.dwAttributes==0, "invalid folder attributes: %d\n", kfDefinition.dwAttributes);
+                FreeKnownFolderDefinitionFields(&kfDefinition);
+            }
+
             hr = IKnownFolder_Release(folder);
             ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
         }
-- 
GitLab