shell32/tests: Add notification when expected known folder does not exists.

This commit is contained in:
Mariusz Pluciński 2011-07-29 19:07:55 +02:00 committed by Alexandre Julliard
parent e09f4ed0e8
commit 82ac4ae36e

View File

@ -1010,6 +1010,7 @@ static const struct knownFolderDef known_folders[] = {
{ NULL, NULL, 0, NULL, NULL, 0, 0 } { NULL, NULL, 0, NULL, NULL, 0, 0 }
}; };
#undef KNOWN_FOLDER #undef KNOWN_FOLDER
BOOL known_folder_found[sizeof(known_folders)/sizeof(known_folders[0])-1];
static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId) static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId)
{ {
@ -1021,14 +1022,15 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
WCHAR sName[1024], sRelativePath[MAX_PATH]; WCHAR sName[1024], sRelativePath[MAX_PATH];
BOOL validPath; BOOL validPath;
char sParentGuid[39]; char sParentGuid[39];
BOOL *current_known_folder_found = &known_folder_found[0];
BOOL found = FALSE; BOOL found = FALSE;
while(known_folder->folderId != NULL) while(known_folder->folderId != NULL)
{ {
if(IsEqualGUID(known_folder->folderId, folderId)) if(IsEqualGUID(known_folder->folderId, folderId))
{ {
*current_known_folder_found = TRUE;
found = TRUE; found = TRUE;
/* verify CSIDL */ /* verify CSIDL */
if(known_folder->csidl != NO_CSIDL) if(known_folder->csidl != NO_CSIDL)
{ {
@ -1084,6 +1086,7 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId
break; break;
} }
known_folder++; known_folder++;
current_known_folder_found++;
} }
if(!found) if(!found)
@ -1241,11 +1244,18 @@ static void test_knownFolders(void)
ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr); ok(hr == S_OK, "failed to release KnownFolder instance: 0x%08x\n", hr);
} }
for(i=0; i<sizeof(known_folder_found)/sizeof(known_folder_found[0]); ++i)
known_folder_found[i] = FALSE;
hr = IKnownFolderManager_GetFolderIds(mgr, &folders, &nCount); hr = IKnownFolderManager_GetFolderIds(mgr, &folders, &nCount);
ok(hr == S_OK, "failed to get known folders: 0x%08x\n", hr); ok(hr == S_OK, "failed to get known folders: 0x%08x\n", hr);
for(i=0;i<nCount;++i) for(i=0;i<nCount;++i)
check_known_folder(mgr, &folders[i]); check_known_folder(mgr, &folders[i]);
for(i=0; i<sizeof(known_folder_found)/sizeof(known_folder_found[0]); ++i)
if(!known_folder_found[i])
trace("Known folder %s not found on current platform\n", known_folders[i].sFolderId);
CoTaskMemFree(folders); CoTaskMemFree(folders);
/* test of registering new known folders */ /* test of registering new known folders */