[PATCH 5/8] urlmon/tests: CoInternetParseUrl not present on W95B

Detlef Riekenberg wine.dev at web.de
Thu Apr 15 17:20:26 CDT 2010


---
 dlls/urlmon/tests/misc.c |   41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index cd8985f..6ec3536 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -66,6 +66,7 @@ DEFINE_EXPECT(unk_Release);
 static HRESULT (WINAPI *pCoInternetCompareUrl)(LPCWSTR, LPCWSTR, DWORD);
 static HRESULT (WINAPI *pCoInternetGetSecurityUrl)(LPCWSTR, LPWSTR*, PSUACTION, DWORD);
 static HRESULT (WINAPI *pCoInternetGetSession)(DWORD, IInternetSession **, DWORD);
+static HRESULT (WINAPI *pCoInternetParseUrl)(LPCWSTR, PARSEACTION, DWORD, LPWSTR, DWORD, DWORD *, DWORD);
 
 static void test_CreateFormatEnum(void)
 {
@@ -308,27 +309,32 @@ static void test_CoInternetParseUrl(void)
 
     static WCHAR buf[4096];
 
+    if (!pCoInternetParseUrl) {
+        win_skip("CoInternetParseUrl not found\n");
+        return;
+    }
+
     memset(buf, 0xf0, sizeof(buf));
-    hres = CoInternetParseUrl(parse_tests[0].url, PARSE_SCHEMA, 0, buf,
+    hres = pCoInternetParseUrl(parse_tests[0].url, PARSE_SCHEMA, 0, buf,
             3, &size, 0);
     ok(hres == E_POINTER, "schema failed: %08x, expected E_POINTER\n", hres);
 
     for(i=0; i < sizeof(parse_tests)/sizeof(parse_tests[0]); i++) {
         memset(buf, 0xf0, sizeof(buf));
-        hres = CoInternetParseUrl(parse_tests[i].url, PARSE_SECURITY_URL, 0, buf,
+        hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SECURITY_URL, 0, buf,
                 sizeof(buf)/sizeof(WCHAR), &size, 0);
         ok(hres == parse_tests[i].secur_hres, "[%d] security url failed: %08x, expected %08x\n",
                 i, hres, parse_tests[i].secur_hres);
 
         memset(buf, 0xf0, sizeof(buf));
-        hres = CoInternetParseUrl(parse_tests[i].url, PARSE_ENCODE, 0, buf,
+        hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ENCODE, 0, buf,
                 sizeof(buf)/sizeof(WCHAR), &size, 0);
         ok(hres == S_OK, "[%d] encoding failed: %08x\n", i, hres);
         ok(size == lstrlenW(parse_tests[i].encoded_url), "[%d] wrong size\n", i);
         ok(!lstrcmpW(parse_tests[i].encoded_url, buf), "[%d] wrong encoded url\n", i);
 
         memset(buf, 0xf0, sizeof(buf));
-        hres = CoInternetParseUrl(parse_tests[i].url, PARSE_PATH_FROM_URL, 0, buf,
+        hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_PATH_FROM_URL, 0, buf,
                 sizeof(buf)/sizeof(WCHAR), &size, 0);
         ok(hres == parse_tests[i].path_hres, "[%d] path failed: %08x, expected %08x\n",
                 i, hres, parse_tests[i].path_hres);
@@ -338,7 +344,7 @@ static void test_CoInternetParseUrl(void)
         }
 
         memset(buf, 0xf0, sizeof(buf));
-        hres = CoInternetParseUrl(parse_tests[i].url, PARSE_SCHEMA, 0, buf,
+        hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SCHEMA, 0, buf,
                 sizeof(buf)/sizeof(WCHAR), &size, 0);
         ok(hres == S_OK, "[%d] schema failed: %08x\n", i, hres);
         ok(size == lstrlenW(parse_tests[i].schema), "[%d] wrong size\n", i);
@@ -347,7 +353,7 @@ static void test_CoInternetParseUrl(void)
         if(memcmp(parse_tests[i].url, wszRes, 3*sizeof(WCHAR))
                 && memcmp(parse_tests[i].url, wszAbout, 5*sizeof(WCHAR))) {
             memset(buf, 0xf0, sizeof(buf));
-            hres = CoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf,
+            hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf,
                     sizeof(buf)/sizeof(WCHAR), &size, 0);
             ok(hres == parse_tests[i].domain_hres, "[%d] domain failed: %08x\n", i, hres);
             if(parse_tests[i].domain)
@@ -355,7 +361,7 @@ static void test_CoInternetParseUrl(void)
         }
 
         memset(buf, 0xf0, sizeof(buf));
-        hres = CoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf,
+        hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf,
                 sizeof(buf)/sizeof(WCHAR), &size, 0);
         ok(hres == parse_tests[i].rootdocument_hres, "[%d] rootdocument failed: %08x\n", i, hres);
         if(parse_tests[i].rootdocument)
@@ -928,8 +934,8 @@ static void test_NameSpace(void)
 
     static const WCHAR wszTest[] = {'t','e','s','t',0};
 
-    if (!pCoInternetGetSession) {
-        win_skip("CoInternetGetSession not found\n");
+    if (!pCoInternetGetSession || !pCoInternetParseUrl) {
+        win_skip("CoInternetGetSession or CoInternetParseUrl not found\n");
         return;
     }
 
@@ -956,7 +962,7 @@ static void test_NameSpace(void)
     SET_EXPECT(CreateInstance);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -968,7 +974,7 @@ static void test_NameSpace(void)
     SET_EXPECT(QI_IInternetProtocolInfo);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -978,7 +984,7 @@ static void test_NameSpace(void)
     SET_EXPECT(QI_IInternetProtocolInfo);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf,
+    hres = pCoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf,
             sizeof(buf)/sizeof(WCHAR), &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
     ok(size == sizeof(url1)/sizeof(WCHAR), "Size = %d\n", size);
@@ -1008,7 +1014,7 @@ static void test_NameSpace(void)
     hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf, wszTest);
     ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -1027,7 +1033,7 @@ static void test_NameSpace(void)
     SET_EXPECT(QI_IInternetProtocolInfo);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -1040,7 +1046,7 @@ static void test_NameSpace(void)
     SET_EXPECT(QI_IInternetProtocolInfo);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -1054,7 +1060,7 @@ static void test_NameSpace(void)
     SET_EXPECT(QI_IInternetProtocolInfo);
     SET_EXPECT(ParseUrl);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -1073,7 +1079,7 @@ static void test_NameSpace(void)
     hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf2, wszTest);
     ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);
 
-    hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
+    hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
                               &size, 0);
     ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
 
@@ -1436,6 +1442,7 @@ START_TEST(misc)
     pCoInternetCompareUrl = (void *) GetProcAddress(hurlmon, "CoInternetCompareUrl");
     pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
     pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
+    pCoInternetParseUrl = (void*) GetProcAddress(hurlmon, "CoInternetParseUrl");
 
     register_protocols();
 
-- 
1.7.0.4




More information about the wine-patches mailing list