Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/shell32/tests/shlfolder.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 43cbbfda2c..14d243a03b 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -4356,23 +4356,19 @@ if (hr == S_OK) 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; + UINT count, i, max_id; HRESULT hr;
test_contextmenu_qi(menu, FALSE);
- hr = IContextMenu_QueryContextMenu(menu, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL); + hr = IContextMenu_QueryContextMenu(menu, hmenu, 0, 64, 32767, CMF_NORMAL); ok(SUCCEEDED(hr), "Failed to query the menu, hr %#x.\n", hr);
max_id = HRESULT_CODE(hr) - 1; /* returns max_id + 1 */ - ok(max_id <= id_upper_limit, "Got %d\n", max_id); + ok(max_id <= 32767, "Got %d\n", max_id); count = GetMenuItemCount(hmenu); ok(count, "Got %d\n", count);
- max_id_check = 0; for (i = 0; i < count; i++) { MENUITEMINFOA mii; @@ -4387,26 +4383,20 @@ static void test_contextmenu(IContextMenu *menu, BOOL background) res = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(res, "Failed to get menu item info, error %d.\n", GetLastError());
- ok((mii.wID <= id_upper_limit) || (mii.fType & MFT_SEPARATOR), - "Got non-separator ID out of range: %d (type: %x)\n", mii.wID, mii.fType); if (!(mii.fType & MFT_SEPARATOR)) { - max_id_check = (mii.wID > max_id_check) ? mii.wID : max_id_check; - hr = IContextMenu_GetCommandString(menu, mii.wID - baseItem, GCS_VERBA, 0, buf, sizeof(buf)); + ok(mii.wID >= 64 && mii.wID <= 64 + max_id, + "Expected between 64 and %d, got %d.\n", 64 + max_id, mii.wID); + hr = IContextMenu_GetCommandString(menu, mii.wID - 64, GCS_VERBA, 0, buf, sizeof(buf)); todo_wine_if(background) - ok(SUCCEEDED(hr) || hr == E_NOTIMPL, "for id 0x%x got 0x%08x (menustr: %s)\n", mii.wID - baseItem, hr, mii.dwTypeData); - if (SUCCEEDED(hr)) - trace("for id 0x%x got string %s (menu string: %s)\n", mii.wID - baseItem, buf, mii.dwTypeData); - else if (hr == E_NOTIMPL) - trace("for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.wID - baseItem, mii.dwTypeData); + ok(hr == S_OK || hr == E_NOTIMPL || hr == E_INVALIDARG, + "Got unexpected hr %#x for ID %d, string %s.\n", hr, mii.wID, debugstr_a(mii.dwTypeData)); + if (hr == S_OK) + trace("Got ID %d, verb %s, string %s.\n", mii.wID, debugstr_a(buf), debugstr_a(mii.dwTypeData)); + else + trace("Got ID %d, hr %#x, string %s.\n", mii.wID, hr, debugstr_a(mii.dwTypeData)); } } - max_id_check -= baseItem; - ok((max_id_check == max_id) || - (max_id_check == max_id-1) || /* Win 7 */ - (max_id_check == max_id-2) || /* Win 8 */ - (max_id_check == max_id-3), - "Not equal (or near equal), got %d and %d\n", max_id_check, max_id);
if (count) {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=63358
Your paranoid android.
=== w2003std (32 bit report) ===
shell32: shlfolder.c:4939: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 8) shlfolder.c:4939: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 2) shlfolder.c:4939: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 10) shlfolder.c:4939: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8) shlfolder.c:4939: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8) shlfolder.c:4939: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8)
=== w1064v1809 (32 bit report) ===
shell32: shlfolder.c:4834: Test failed: CREATE: expected notification type 2, got: 40000 shlfolder.c:4841: Test failed: GetDisplayNameOf failed: 0x80070057 shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 2)
=== w1064v1809_2scr (32 bit report) ===
shell32: shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 40000)
=== w1064v1809_he (32 bit report) ===
shell32: shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 3)
=== w1064v1809 (64 bit report) ===
shell32: shlfolder.c:4834: Test failed: MKDIR: expected notification type 8, got: 40000 shlfolder.c:4841: Test failed: GetDisplayNameOf failed: 0x80070057 shlfolder.c:4851: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 8)