Commit c99a406b authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

shell32: Fix unused knownfolder definition.

parent 8b982a19
......@@ -2445,9 +2445,9 @@ static const CSIDL_DATA CSIDL_Data[] =
},
{ /* 0x45 */
&GUID_NULL,
CSIDL_Type_User,
CSIDL_Type_Disallowed,
NULL,
NULL,
DocumentsW
},
{ /* 0x46 */
&FOLDERID_DocumentsLibrary,
......
......@@ -111,6 +111,7 @@ static const BYTE printersType[] = { PT_YAGUID, PT_SHELLEXT, 0x71 };
static const BYTE ieSpecialType[] = { PT_IESPECIAL2 };
static const BYTE shellExtType[] = { PT_SHELLEXT };
static const BYTE workgroupType[] = { PT_WORKGRP };
static const BYTE missingType[] = { 0xff };
#define DECLARE_TYPE(x, y) { x, ARRAY_SIZE(y), y }
static const struct shellExpectedValues requiredShellValues[] = {
DECLARE_TYPE(CSIDL_BITBUCKET, guidType),
......@@ -178,6 +179,14 @@ static const struct shellExpectedValues optionalShellValues[] = {
DECLARE_TYPE(CSIDL_RESOURCES, folderType),
DECLARE_TYPE(CSIDL_RESOURCES_LOCALIZED, folderType),
};
static const struct shellExpectedValues undefinedShellValues[] = {
DECLARE_TYPE(0x0f, missingType),
DECLARE_TYPE(0x32, missingType),
DECLARE_TYPE(0x33, missingType),
DECLARE_TYPE(0x34, missingType),
DECLARE_TYPE(0x3c, missingType),
DECLARE_TYPE(0x45, missingType),
};
#undef DECLARE_TYPE
static void loadShell32(void)
......@@ -1399,8 +1408,7 @@ static BYTE testSHGetSpecialFolderLocation(int folder)
HRESULT hr;
BYTE ret = 0xff;
/* treat absence of function as success */
if (!pSHGetSpecialFolderLocation) return TRUE;
if (!pSHGetSpecialFolderLocation) return ret;
pidl = NULL;
hr = pSHGetSpecialFolderLocation(NULL, folder, &pidl);
......@@ -1447,8 +1455,14 @@ static void test_SHGetSpecialFolderPath(BOOL optional, int folder)
getFolderName(folder));
}
enum ShellValuesTestExpect {
ShellValuesTestExpect_Required,
ShellValuesTestExpect_Optional,
ShellValuesTestExpect_Missing,
};
static void test_ShellValues(const struct shellExpectedValues testEntries[],
int numEntries, BOOL optional)
int numEntries, enum ShellValuesTestExpect expect)
{
int i;
......@@ -1462,7 +1476,9 @@ static void test_ShellValues(const struct shellExpectedValues testEntries[],
for (j = 0; !foundTypeMatch && j < testEntries[i].numTypes; j++)
if (testEntries[i].types[j] == type)
foundTypeMatch = TRUE;
ok(foundTypeMatch || optional || broken(type == 0xff) /* Win9x */,
ok((expect == ShellValuesTestExpect_Required && foundTypeMatch) ||
(expect == ShellValuesTestExpect_Optional) ||
(expect == ShellValuesTestExpect_Missing && type == 0xff),
"%s has unexpected type %d (0x%02x)\n",
getFolderName(testEntries[i].folder), type, type);
......@@ -1471,18 +1487,23 @@ static void test_ShellValues(const struct shellExpectedValues testEntries[],
j < testEntries[i].numTypes; j++)
if (testEntries[i].types[j] == type)
foundTypeMatch = TRUE;
ok(foundTypeMatch || optional || broken(type == 0xff) /* Win9x */,
ok((expect == ShellValuesTestExpect_Required && foundTypeMatch) ||
(expect == ShellValuesTestExpect_Optional) ||
(expect == ShellValuesTestExpect_Missing && type == 0xff),
"%s has unexpected type %d (0x%02x)\n",
getFolderName(testEntries[i].folder), type, type);
switch (type)
if (expect != ShellValuesTestExpect_Missing)
{
case PT_FOLDER:
case PT_DRIVE:
case PT_DRIVE2:
case PT_IESPECIAL2:
test_SHGetFolderPath(optional, testEntries[i].folder);
test_SHGetSpecialFolderPath(optional, testEntries[i].folder);
break;
switch (type)
{
case PT_FOLDER:
case PT_DRIVE:
case PT_DRIVE2:
case PT_IESPECIAL2:
test_SHGetFolderPath(expect == ShellValuesTestExpect_Optional, testEntries[i].folder);
test_SHGetSpecialFolderPath(expect == ShellValuesTestExpect_Optional, testEntries[i].folder);
break;
}
}
}
}
......@@ -1555,8 +1576,9 @@ static void test_PidlTypes(void)
test_SHGetFolderPath(FALSE, CSIDL_DESKTOP);
test_SHGetSpecialFolderPath(FALSE, CSIDL_DESKTOP);
test_ShellValues(requiredShellValues, ARRAY_SIZE(requiredShellValues), FALSE);
test_ShellValues(optionalShellValues, ARRAY_SIZE(optionalShellValues), TRUE);
test_ShellValues(requiredShellValues, ARRAY_SIZE(requiredShellValues), ShellValuesTestExpect_Required);
test_ShellValues(optionalShellValues, ARRAY_SIZE(optionalShellValues), ShellValuesTestExpect_Optional);
test_ShellValues(undefinedShellValues, ARRAY_SIZE(undefinedShellValues), ShellValuesTestExpect_Missing);
}
/* FIXME: Should be in shobjidl.idl */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment