Commit 7af66935 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

shell32/tests: Add more tests for Shell_MergeMenus().

Show Shell_MergeMenus() really adds the offset instead of changing IDs to start with it, and that it really honours the maximum allowed value. Signed-off-by: 's avatarDamjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 80985b7e
......@@ -2661,10 +2661,36 @@ static void test_unicode(void)
static void
test_shlmenu(void) {
HRESULT hres;
HMENU src_menu, dst_menu;
int count;
MENUITEMINFOA item_info;
BOOL bres;
hres = Shell_MergeMenus (0, 0, 0x42, 0x4242, 0x424242, 0);
ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
hres = Shell_MergeMenus ((HMENU)42, 0, 0x42, 0x4242, 0x424242, 0);
ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
src_menu = CreatePopupMenu ();
ok (src_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ());
dst_menu = CreatePopupMenu ();
ok (dst_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ());
bres = InsertMenuA (src_menu, -1, MF_BYPOSITION | MF_STRING, 10, "item1");
ok (bres, "InsertMenuA failed, error %d\n", GetLastError());
bres = InsertMenuA (src_menu, -1, MF_BYPOSITION | MF_STRING, 11, "item2");
ok (bres, "InsertMenuA failed, error %d\n", GetLastError());
hres = Shell_MergeMenus (dst_menu, src_menu, 0, 123, 133, MM_SUBMENUSHAVEIDS);
ok (hres == 134, "got %d\n", hres);
count = GetMenuItemCount (dst_menu);
ok (count == 1, "got %d\n", count);
memset (&item_info, 0, sizeof(item_info));
item_info.cbSize = sizeof(item_info);
item_info.fMask = MIIM_ID;
bres = GetMenuItemInfoA (dst_menu, 0, TRUE, &item_info);
ok (bres, "GetMenuItemInfoA failed, error %d\n", GetLastError ());
ok (item_info.wID == 133, "got %d\n", item_info.wID);
DestroyMenu (dst_menu);
DestroyMenu (src_menu);
}
/* Check for old shell32 (4.0.x) */
......
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