From: Jacek Caban <jacek@codeweavers.com> Fixes -Wunused-but-set-global warnings. --- dlls/ieframe/tests/webbrowser.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index e887039434f..8c514a6ffc2 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -2930,18 +2930,20 @@ static void test_QueryStatusWB(IWebBrowser2 *webbrowser, BOOL has_document) * is enabled and IDM_STOP is not. */ status = 0xdeadbeef; - if (use_container_olecmd) SET_EXPECT(QueryStatus_STOP); + if (use_container_olecmd && has_document) SET_EXPECT(QueryStatus_STOP); hres = IWebBrowser2_QueryStatusWB(webbrowser, OLECMDID_STOP, &status); ok(hres == success_state, "QueryStatusWB failed: %08lx %08lx\n", hres, success_state); todo_wine_if (!use_container_olecmd && has_document) ok((has_document && status == success_flags) || (!has_document && status == 0xdeadbeef), "OLECMDID_STOP not enabled/supported: %08x %08x\n", status, success_flags); + if (use_container_olecmd && has_document) CHECK_CALLED(QueryStatus_STOP); status = 0xdeadbeef; - if (use_container_olecmd) SET_EXPECT(QueryStatus_IDM_STOP); + if (use_container_olecmd && has_document) SET_EXPECT(QueryStatus_IDM_STOP); hres = IWebBrowser2_QueryStatusWB(webbrowser, IDM_STOP, &status); ok(hres == success_state, "QueryStatusWB failed: %08lx %08lx\n", hres, success_state); ok((has_document && status == 0) || (!has_document && status == 0xdeadbeef), "IDM_STOP is enabled/supported: %08x %d\n", status, has_document); + if (use_container_olecmd && has_document) CHECK_CALLED(QueryStatus_IDM_STOP); } static void test_ExecWB(IWebBrowser2 *webbrowser, BOOL has_document) @@ -2965,24 +2967,29 @@ static void test_ExecWB(IWebBrowser2 *webbrowser, BOOL has_document) * These tests show that QueryStatusWB uses a NULL pguidCmdGroup, since OLECMDID_STOP * succeeds (S_OK) and IDM_STOP does not (OLECMDERR_E_NOTSUPPORTED). */ - if(use_container_olecmd) { - SET_EXPECT(Exec_STOP); - }else if(has_document) { + if(has_document) { + if(use_container_olecmd) + SET_EXPECT(Exec_STOP); SET_EXPECT(Invoke_STATUSTEXTCHANGE); SET_EXPECT(SetStatusText); } hres = IWebBrowser2_ExecWB(webbrowser, OLECMDID_STOP, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); - if(!use_container_olecmd && has_document) { - todo_wine ok(hres == olecmdid_state, "ExecWB failed: %08lx %08lx\n", hres, olecmdid_state); + if(has_document) { + if(use_container_olecmd) + CHECK_CALLED(Exec_STOP); + else + todo_wine ok(hres == olecmdid_state, "ExecWB failed: %08lx %08lx\n", hres, olecmdid_state); CLEAR_CALLED(Invoke_STATUSTEXTCHANGE); /* Called by IE9 */ CLEAR_CALLED(SetStatusText); /* Called by IE9 */ }else { ok(hres == olecmdid_state, "ExecWB failed: %08lx %08lx\n", hres, olecmdid_state); } - if (use_container_olecmd) + if (use_container_olecmd && has_document) SET_EXPECT(Exec_IDM_STOP); hres = IWebBrowser2_ExecWB(webbrowser, IDM_STOP, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); ok(hres == idm_state, "ExecWB failed: %08lx %08lx\n", hres, idm_state); + if (use_container_olecmd && has_document) + CHECK_CALLED(Exec_IDM_STOP); } static void test_download(DWORD flags) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11127