Nikolay Sivov : shell32/tests: Run more tests on menus created with SHCreateDefaultContextMenu().
Alexandre Julliard
julliard at winehq.org
Mon Feb 19 13:52:01 CST 2018
Module: wine
Branch: master
Commit: 0282f3aadee9b6570a2f2d20763a7ab62f68257e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0282f3aadee9b6570a2f2d20763a7ab62f68257e
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Feb 18 19:10:46 2018 +0300
shell32/tests: Run more tests on menus created with SHCreateDefaultContextMenu().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/tests/shlfolder.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index ee7ec49..716a486 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -4343,23 +4343,34 @@ static void test_desktop_IPersist(void)
IShellFolder_Release(desktop);
}
-static void test_contextmenu(IContextMenu *menu, BOOL background)
+static void test_contextmenu_qi(IContextMenu *menu, BOOL todo)
{
- HMENU hmenu = CreatePopupMenu();
- const int id_upper_limit = 32767;
- const int baseItem = 0x40;
- INT max_id, max_id_check;
IUnknown *unk;
- UINT count, i;
HRESULT hr;
hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (void **)&unk);
+todo_wine_if(todo)
ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr);
+if (hr == S_OK)
IUnknown_Release(unk);
hr = IContextMenu_QueryInterface(menu, &IID_IObjectWithSite, (void **)&unk);
+todo_wine_if(todo)
ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr);
+if (hr == S_OK)
IUnknown_Release(unk);
+}
+
+static void test_contextmenu(IContextMenu *menu, BOOL background)
+{
+ HMENU hmenu = CreatePopupMenu();
+ const int id_upper_limit = 32767;
+ const int baseItem = 0x40;
+ INT max_id, max_id_check;
+ UINT count, i;
+ HRESULT hr;
+
+ test_contextmenu_qi(menu, FALSE);
hr = IContextMenu_QueryContextMenu(menu, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL);
ok(SUCCEEDED(hr), "Failed to query the menu, hr %#x.\n", hr);
@@ -5011,7 +5022,6 @@ static void test_SHCreateDefaultContextMenu(void)
IPersistFolder2_Release(persist);
if(SUCCEEDED(hr))
{
-
cminfo.hwnd=NULL;
cminfo.pcmcb=NULL;
cminfo.psf=folder;
@@ -5021,13 +5031,18 @@ static void test_SHCreateDefaultContextMenu(void)
cminfo.aKeys=NULL;
cminfo.cKeys=0;
cminfo.punkAssociationInfo=NULL;
+
hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(void**)&cmenu);
ok(hr==S_OK,"Got 0x%08x\n", hr);
+ test_contextmenu_qi(cmenu, TRUE);
IContextMenu_Release(cmenu);
+
cminfo.pidlFolder=pidlFolder;
hr = pSHCreateDefaultContextMenu(&cminfo,&IID_IContextMenu,(void**)&cmenu);
ok(hr==S_OK,"Got 0x%08x\n", hr);
+ test_contextmenu_qi(cmenu, TRUE);
IContextMenu_Release(cmenu);
+
status = RegOpenKeyExA(HKEY_CLASSES_ROOT,"*",0,KEY_READ,keys);
if(status==ERROR_SUCCESS){
for(i=1;i<16;i++)
More information about the wine-cvs
mailing list