From a9b27c2b0d2ac196fc627c75310bda4b4bd44fcc Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 16 May 2019 21:59:39 +0200 Subject: [PATCH] urlmon/tests: Make ParseUrl call tests more strict. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/urlmon/tests/misc.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c index ff0f24ed764..de0c6544e29 100644 --- a/dlls/urlmon/tests/misc.c +++ b/dlls/urlmon/tests/misc.c @@ -61,6 +61,7 @@ DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xA }while(0) DEFINE_EXPECT(ParseUrl); +DEFINE_EXPECT(ParseUrl_ENCODE); DEFINE_EXPECT(QI_IInternetProtocolInfo); DEFINE_EXPECT(CreateInstance); DEFINE_EXPECT(unk_Release); @@ -875,9 +876,9 @@ static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved) { - CHECK_EXPECT2(ParseUrl); - - if(ParseAction == PARSE_SECURITY_URL) { + switch(ParseAction) { + case PARSE_SECURITY_URL: + CHECK_EXPECT2(ParseUrl); if(pcchResult) *pcchResult = ARRAY_SIZE(url1); @@ -886,6 +887,12 @@ static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface memcpy(pwzResult, url1, sizeof(url1)); return S_OK; + case PARSE_ENCODE: + CHECK_EXPECT2(ParseUrl_ENCODE); + break; + default: + CHECK_EXPECT2(ParseUrl); + break; } return E_NOTIMPL; @@ -1030,24 +1037,24 @@ static void test_NameSpace(void) expect_cf = &test_protocol_cf; SET_EXPECT(QI_IInternetProtocolInfo); SET_EXPECT(CreateInstance); - SET_EXPECT(ParseUrl); + SET_EXPECT(ParseUrl_ENCODE); hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); CHECK_CALLED(QI_IInternetProtocolInfo); CHECK_CALLED(CreateInstance); - CHECK_CALLED(ParseUrl); + CHECK_CALLED(ParseUrl_ENCODE); qiret = S_OK; SET_EXPECT(QI_IInternetProtocolInfo); - SET_EXPECT(ParseUrl); + SET_EXPECT(ParseUrl_ENCODE); hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); CHECK_CALLED(QI_IInternetProtocolInfo); - CHECK_CALLED(ParseUrl); + CHECK_CALLED(ParseUrl_ENCODE); SET_EXPECT(QI_IInternetProtocolInfo); SET_EXPECT(ParseUrl); @@ -1097,38 +1104,38 @@ static void test_NameSpace(void) ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres); SET_EXPECT(QI_IInternetProtocolInfo); - SET_EXPECT(ParseUrl); + SET_EXPECT(ParseUrl_ENCODE); hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); CHECK_CALLED(QI_IInternetProtocolInfo); - CHECK_CALLED(ParseUrl); + CHECK_CALLED(ParseUrl_ENCODE); hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf, wszTest); ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres); SET_EXPECT(QI_IInternetProtocolInfo); - SET_EXPECT(ParseUrl); + SET_EXPECT(ParseUrl_ENCODE); hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); CHECK_CALLED(QI_IInternetProtocolInfo); - CHECK_CALLED(ParseUrl); + CHECK_CALLED(ParseUrl_ENCODE); hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf, wszTest); ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres); expect_cf = &test_protocol_cf2; SET_EXPECT(QI_IInternetProtocolInfo); - SET_EXPECT(ParseUrl); + SET_EXPECT(ParseUrl_ENCODE); hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); CHECK_CALLED(QI_IInternetProtocolInfo); - CHECK_CALLED(ParseUrl); + CHECK_CALLED(ParseUrl_ENCODE); hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf, wszTest); ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);