Commit 42ecb0ec authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

shell32/tests: Test what Shell_MergeMenus() does with a negative adjustment.

parent 91a8b481
...@@ -2673,6 +2673,7 @@ test_shlmenu(void) { ...@@ -2673,6 +2673,7 @@ test_shlmenu(void) {
src_menu = CreatePopupMenu (); src_menu = CreatePopupMenu ();
ok (src_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ()); ok (src_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ());
dst_menu = CreatePopupMenu (); dst_menu = CreatePopupMenu ();
ok (dst_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ()); ok (dst_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ());
bres = InsertMenuA (src_menu, -1, MF_BYPOSITION | MF_STRING, 10, "item1"); bres = InsertMenuA (src_menu, -1, MF_BYPOSITION | MF_STRING, 10, "item1");
...@@ -2690,6 +2691,16 @@ test_shlmenu(void) { ...@@ -2690,6 +2691,16 @@ test_shlmenu(void) {
ok (bres, "GetMenuItemInfoA failed, error %d\n", GetLastError ()); ok (bres, "GetMenuItemInfoA failed, error %d\n", GetLastError ());
ok (item_info.wID == 133, "got %d\n", item_info.wID); ok (item_info.wID == 133, "got %d\n", item_info.wID);
DestroyMenu (dst_menu); DestroyMenu (dst_menu);
/* integer overflow: Shell_MergeMenus() return value is wrong, but items are still added */
dst_menu = CreatePopupMenu ();
ok (dst_menu != NULL, "CreatePopupMenu() failed, error %d\n", GetLastError ());
hres = Shell_MergeMenus (dst_menu, src_menu, 0, -1, 133, MM_SUBMENUSHAVEIDS);
ok (hres == -1, "got %d\n", hres);
count = GetMenuItemCount (dst_menu);
ok (count == 2, "got %d\n", count);
DestroyMenu (dst_menu);
DestroyMenu (src_menu); DestroyMenu (src_menu);
} }
......
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