4 * Copyright 2010 Thomas Mullaly
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
32 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
33 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
34 #define URI_BUILDER_STR_PROPERTY_COUNT 7
36 static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
37 static HRESULT (WINAPI *pCreateUriWithFragment)(LPCWSTR, LPCWSTR, DWORD, DWORD_PTR, IUri**);
38 static HRESULT (WINAPI *pCreateIUriBuilder)(IUri*, DWORD, DWORD_PTR, IUriBuilder**);
39 static HRESULT (WINAPI *pCoInternetCombineIUri)(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);
41 static const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
42 '.','o','r','g','/',0};
43 static const WCHAR http_url_fragW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
44 '.','o','r','g','/','#','F','r','a','g',0};
46 typedef struct _uri_create_flag_test {
49 } uri_create_flag_test;
51 static const uri_create_flag_test invalid_flag_tests[] = {
52 /* Set of invalid flag combinations to test for. */
53 {Uri_CREATE_DECODE_EXTRA_INFO | Uri_CREATE_NO_DECODE_EXTRA_INFO, E_INVALIDARG},
54 {Uri_CREATE_CANONICALIZE | Uri_CREATE_NO_CANONICALIZE, E_INVALIDARG},
55 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES | Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, E_INVALIDARG},
56 {Uri_CREATE_PRE_PROCESS_HTML_URI | Uri_CREATE_NO_PRE_PROCESS_HTML_URI, E_INVALIDARG},
57 {Uri_CREATE_IE_SETTINGS | Uri_CREATE_NO_IE_SETTINGS, E_INVALIDARG}
60 typedef struct _uri_str_property {
64 const char* broken_value;
67 typedef struct _uri_dword_property {
73 typedef struct _uri_properties {
76 HRESULT create_expected;
81 uri_str_property str_props[URI_STR_PROPERTY_COUNT];
82 uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT];
85 static const uri_properties uri_tests[] = {
86 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK, FALSE,
87 /* A flag bitmap containing all the Uri_HAS_* flags that correspond to this uri. */
88 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
89 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|
90 Uri_HAS_PORT|Uri_HAS_SCHEME,
93 {"http://www.winehq.org/",S_OK,FALSE}, /* ABSOLUTE_URI */
94 {"www.winehq.org",S_OK,FALSE}, /* AUTHORITY */
95 {"http://www.winehq.org/",S_OK,FALSE}, /* DISPLAY_URI */
96 {"winehq.org",S_OK,FALSE}, /* DOMAIN */
97 {"",S_FALSE,FALSE}, /* EXTENSION */
98 {"",S_FALSE,FALSE}, /* FRAGMENT */
99 {"www.winehq.org",S_OK,FALSE}, /* HOST */
100 {"",S_FALSE,FALSE}, /* PASSWORD */
101 {"/",S_OK,FALSE}, /* PATH */
102 {"/",S_OK,FALSE}, /* PATH_AND_QUERY */
103 {"",S_FALSE,FALSE}, /* QUERY */
104 {"http://www.winehq.org/tests/../tests/../..",S_OK,FALSE}, /* RAW_URI */
105 {"http",S_OK,FALSE}, /* SCHEME_NAME */
106 {"",S_FALSE,FALSE}, /* USER_INFO */
107 {"",S_FALSE,FALSE} /* USER_NAME */
110 {Uri_HOST_DNS,S_OK,FALSE}, /* HOST_TYPE */
111 {80,S_OK,FALSE}, /* PORT */
112 {URL_SCHEME_HTTP,S_OK,FALSE}, /* SCHEME */
113 {URLZONE_INVALID,E_NOTIMPL,FALSE} /* ZONE */
116 { "http://winehq.org/tests/.././tests", 0, S_OK, FALSE,
117 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
118 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|
119 Uri_HAS_PORT|Uri_HAS_SCHEME,
122 {"http://winehq.org/tests",S_OK,FALSE},
123 {"winehq.org",S_OK,FALSE},
124 {"http://winehq.org/tests",S_OK,FALSE},
125 {"winehq.org",S_OK,FALSE},
128 {"winehq.org",S_OK,FALSE},
130 {"/tests",S_OK,FALSE},
131 {"/tests",S_OK,FALSE},
133 {"http://winehq.org/tests/.././tests",S_OK,FALSE},
139 {Uri_HOST_DNS,S_OK,FALSE},
141 {URL_SCHEME_HTTP,S_OK,FALSE},
142 {URLZONE_INVALID,E_NOTIMPL,FALSE}
145 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE,
146 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
147 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
148 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
151 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
152 {"www.winehq.org",S_OK,FALSE},
153 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
154 {"winehq.org",S_OK,FALSE},
157 {"www.winehq.org",S_OK,FALSE},
160 {"/?query=x&return=y",S_OK,FALSE},
161 {"?query=x&return=y",S_OK,FALSE},
162 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
168 {Uri_HOST_DNS,S_OK,FALSE},
170 {URL_SCHEME_HTTP,S_OK,FALSE},
171 {URLZONE_INVALID,E_NOTIMPL,FALSE},
174 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK, FALSE,
175 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|Uri_HAS_PATH|
176 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|
177 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
180 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
181 {"usEr%3Ainfo@example.com",S_OK,FALSE},
182 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
183 {"example.com",S_OK,FALSE},
186 {"example.com",S_OK,FALSE},
188 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
189 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
191 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK,FALSE},
193 {"usEr%3Ainfo",S_OK,FALSE},
194 {"usEr%3Ainfo",S_OK,FALSE}
197 {Uri_HOST_DNS,S_OK,FALSE},
199 {URL_SCHEME_HTTP,S_OK,FALSE},
200 {URLZONE_INVALID,E_NOTIMPL,FALSE},
203 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK, FALSE,
204 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_EXTENSION|
205 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
206 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
210 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
211 {"winepass:wine@ftp.winehq.org:9999",S_OK,FALSE},
212 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
213 {"winehq.org",S_OK,FALSE},
216 {"ftp.winehq.org",S_OK,FALSE},
218 {"/dir/foo%20bar.txt",S_OK,FALSE},
219 {"/dir/foo%20bar.txt",S_OK,FALSE},
221 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK,FALSE},
223 {"winepass:wine",S_OK,FALSE},
224 {"winepass",S_OK,FALSE}
227 {Uri_HOST_DNS,S_OK,FALSE},
229 {URL_SCHEME_FTP,S_OK,FALSE},
230 {URLZONE_INVALID,E_NOTIMPL,FALSE}
233 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK, FALSE,
234 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
235 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
238 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
240 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
246 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
247 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
249 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
255 {Uri_HOST_UNKNOWN,S_OK,FALSE},
257 {URL_SCHEME_FILE,S_OK,FALSE},
258 {URLZONE_INVALID,E_NOTIMPL,FALSE}
261 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK, FALSE,
262 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
263 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
266 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
268 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
274 {"/tests/test%20file.README.txt",S_OK,FALSE},
275 {"/tests/test%20file.README.txt",S_OK,FALSE},
277 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK,FALSE},
283 {Uri_HOST_UNKNOWN,S_OK,FALSE},
285 {URL_SCHEME_FILE,S_OK,FALSE},
286 {URLZONE_INVALID,E_NOTIMPL,FALSE}
289 { "urn:nothing:should:happen here", 0, S_OK, FALSE,
290 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
291 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
294 {"urn:nothing:should:happen here",S_OK,FALSE},
296 {"urn:nothing:should:happen here",S_OK,FALSE},
302 {"nothing:should:happen here",S_OK,FALSE},
303 {"nothing:should:happen here",S_OK,FALSE},
305 {"urn:nothing:should:happen here",S_OK,FALSE},
311 {Uri_HOST_UNKNOWN,S_OK,FALSE},
313 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
314 {URLZONE_INVALID,E_NOTIMPL,FALSE}
317 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK, FALSE,
318 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|
319 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
320 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
323 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
324 {"127.0.0.1",S_OK,FALSE},
325 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
329 {"127.0.0.1",S_OK,FALSE},
331 {"/test%20dir/test.txt",S_OK,FALSE},
332 {"/test%20dir/test.txt",S_OK,FALSE},
334 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK,FALSE},
340 {Uri_HOST_IPV4,S_OK,FALSE},
342 {URL_SCHEME_HTTP,S_OK,FALSE},
343 {URLZONE_INVALID,E_NOTIMPL,FALSE}
346 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK, FALSE,
347 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
348 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
349 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
352 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
353 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,FALSE},
354 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
358 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK,FALSE},
363 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK,FALSE},
369 {Uri_HOST_IPV6,S_OK,FALSE},
371 {URL_SCHEME_HTTP,S_OK,FALSE},
372 {URLZONE_INVALID,E_NOTIMPL,FALSE}
375 { "ftp://[::13.1.68.3]", 0, S_OK, FALSE,
376 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
377 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
378 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
381 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
382 {"[::13.1.68.3]",S_OK,FALSE},
383 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
387 {"::13.1.68.3",S_OK,FALSE},
392 {"ftp://[::13.1.68.3]",S_OK,FALSE},
398 {Uri_HOST_IPV6,S_OK,FALSE},
400 {URL_SCHEME_FTP,S_OK,FALSE},
401 {URLZONE_INVALID,E_NOTIMPL,FALSE}
404 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK, FALSE,
405 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
406 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
407 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
410 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
411 {"[fedc:ba98::3210]",S_OK,FALSE},
412 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
416 {"fedc:ba98::3210",S_OK,FALSE},
421 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK,FALSE},
427 {Uri_HOST_IPV6,S_OK,FALSE},
429 {URL_SCHEME_HTTP,S_OK,FALSE},
430 {URLZONE_INVALID,E_NOTIMPL,FALSE}
433 { "1234://www.winehq.org", 0, S_OK, FALSE,
434 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
435 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
436 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
439 {"1234://www.winehq.org/",S_OK,FALSE},
440 {"www.winehq.org",S_OK,FALSE},
441 {"1234://www.winehq.org/",S_OK,FALSE},
442 {"winehq.org",S_OK,FALSE},
445 {"www.winehq.org",S_OK,FALSE},
450 {"1234://www.winehq.org",S_OK,FALSE},
456 {Uri_HOST_DNS,S_OK,FALSE},
458 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
459 {URLZONE_INVALID,E_NOTIMPL,FALSE}
462 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
463 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
464 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
465 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
468 {"file:///C:/test/test.mp3",S_OK,FALSE},
470 {"file:///C:/test/test.mp3",S_OK,FALSE},
476 {"/C:/test/test.mp3",S_OK,FALSE},
477 {"/C:/test/test.mp3",S_OK,FALSE},
479 {"C:/test/test.mp3",S_OK,FALSE},
485 {Uri_HOST_UNKNOWN,S_OK,FALSE},
487 {URL_SCHEME_FILE,S_OK,FALSE},
488 {URLZONE_INVALID,E_NOTIMPL,FALSE}
491 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
492 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
493 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|
494 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_HOST|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
495 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
498 {"file://server/test.mp3",S_OK,FALSE},
499 {"server",S_OK,FALSE},
500 {"file://server/test.mp3",S_OK,FALSE},
504 {"server",S_OK,FALSE},
506 {"/test.mp3",S_OK,FALSE},
507 {"/test.mp3",S_OK,FALSE},
509 {"\\\\Server/test.mp3",S_OK,FALSE},
515 {Uri_HOST_DNS,S_OK,FALSE},
517 {URL_SCHEME_FILE,S_OK,FALSE},
518 {URLZONE_INVALID,E_NOTIMPL,FALSE}
521 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
522 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
523 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|
527 {"*:www.winehq.org/test",S_OK,FALSE},
528 {"www.winehq.org",S_OK,FALSE},
529 {"*:www.winehq.org/test",S_OK,FALSE},
530 {"winehq.org",S_OK,FALSE},
533 {"www.winehq.org",S_OK,FALSE},
535 {"/test",S_OK,FALSE},
536 {"/test",S_OK,FALSE},
538 {"www.winehq.org/test",S_OK,FALSE},
544 {Uri_HOST_DNS,S_OK,FALSE},
546 {URL_SCHEME_WILDCARD,S_OK,FALSE},
547 {URLZONE_INVALID,E_NOTIMPL,FALSE}
550 /* Valid since the '*' is the only character in the scheme name. */
551 { "*:www.winehq.org/test", 0, S_OK, FALSE,
552 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
553 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|
557 {"*:www.winehq.org/test",S_OK,FALSE},
558 {"www.winehq.org",S_OK,FALSE},
559 {"*:www.winehq.org/test",S_OK,FALSE},
560 {"winehq.org",S_OK,FALSE},
563 {"www.winehq.org",S_OK,FALSE},
565 {"/test",S_OK,FALSE},
566 {"/test",S_OK,FALSE},
568 {"*:www.winehq.org/test",S_OK,FALSE},
574 {Uri_HOST_DNS,S_OK,FALSE},
576 {URL_SCHEME_WILDCARD,S_OK,FALSE},
577 {URLZONE_INVALID,E_NOTIMPL,FALSE}
580 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE,
581 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
582 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
585 {"/../some dir/test.ext",S_OK,FALSE},
587 {"/../some dir/test.ext",S_OK,FALSE},
593 {"/../some dir/test.ext",S_OK,FALSE},
594 {"/../some dir/test.ext",S_OK,FALSE},
596 {"/../some dir/test.ext",S_OK,FALSE},
602 {Uri_HOST_UNKNOWN,S_OK,FALSE},
604 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
605 {URLZONE_INVALID,E_NOTIMPL,FALSE}
608 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
609 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|Uri_HAS_PATH|
610 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
613 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
615 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
621 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
622 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
624 {"//implicit/wildcard/uri scheme",S_OK,FALSE},
630 {Uri_HOST_UNKNOWN,S_OK,FALSE},
632 {URL_SCHEME_WILDCARD,S_OK,FALSE},
633 {URLZONE_INVALID,E_NOTIMPL,FALSE}
636 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and its an unknown scheme. */
637 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, S_OK, FALSE,
638 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
639 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME_NAME|
643 {"zip:/.//google.com",S_OK,FALSE},
645 {"zip:/.//google.com",S_OK,FALSE},
651 {"/.//google.com",S_OK,FALSE},
652 {"/.//google.com",S_OK,FALSE},
654 {"zip://google.com",S_OK,FALSE},
660 {Uri_HOST_UNKNOWN,S_OK,FALSE},
662 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
663 {URLZONE_INVALID,E_NOTIMPL,FALSE}
666 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
667 { "ftp://user:pass:word@winehq.org/", 0, S_OK, FALSE,
668 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
669 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
670 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
674 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
675 {"user:pass:word@winehq.org",S_OK,FALSE},
676 {"ftp://winehq.org/",S_OK,FALSE},
677 {"winehq.org",S_OK,FALSE},
680 {"winehq.org",S_OK,FALSE},
681 {"pass:word",S_OK,FALSE},
685 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
687 {"user:pass:word",S_OK,FALSE},
691 {Uri_HOST_DNS,S_OK,FALSE},
693 {URL_SCHEME_FTP,S_OK,FALSE},
694 {URLZONE_INVALID,E_NOTIMPL,FALSE}
697 /* Make sure % encoded unreserved characters are decoded. */
698 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK, FALSE,
699 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
700 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
701 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
705 {"ftp://wINe:PASS@ftp.google.com/",S_OK,FALSE},
706 {"wINe:PASS@ftp.google.com",S_OK,FALSE},
707 {"ftp://ftp.google.com/",S_OK,FALSE},
708 {"google.com",S_OK,FALSE},
711 {"ftp.google.com",S_OK,FALSE},
716 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE},
718 {"wINe:PASS",S_OK,FALSE},
722 {Uri_HOST_DNS,S_OK,FALSE},
724 {URL_SCHEME_FTP,S_OK,FALSE},
725 {URLZONE_INVALID,E_NOTIMPL,FALSE}
728 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
729 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK, FALSE,
730 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
731 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
732 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
736 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
737 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,FALSE},
738 {"ftp://ftp.google.com/",S_OK,FALSE},
739 {"google.com",S_OK,FALSE},
742 {"ftp.google.com",S_OK,FALSE},
743 {"PA%7B%7D",S_OK,FALSE},
747 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
749 {"w%5D%5Be:PA%7B%7D",S_OK,FALSE},
750 {"w%5D%5Be",S_OK,FALSE}
753 {Uri_HOST_DNS,S_OK,FALSE},
755 {URL_SCHEME_FTP,S_OK,FALSE},
756 {URLZONE_INVALID,E_NOTIMPL,FALSE}
759 /* You're allowed to have an empty password portion in the userinfo section. */
760 { "ftp://empty:@ftp.google.com/", 0, S_OK, FALSE,
761 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
762 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
763 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
767 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
768 {"empty:@ftp.google.com",S_OK,FALSE},
769 {"ftp://ftp.google.com/",S_OK,FALSE},
770 {"google.com",S_OK,FALSE},
773 {"ftp.google.com",S_OK,FALSE},
778 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
780 {"empty:",S_OK,FALSE},
784 {Uri_HOST_DNS,S_OK,FALSE},
786 {URL_SCHEME_FTP,S_OK,FALSE},
787 {URLZONE_INVALID,E_NOTIMPL,FALSE}
790 /* Make sure forbidden characters in "userinfo" get encoded. */
791 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK, FALSE,
792 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
793 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
794 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
798 {"ftp://%22%20%22weird@ftp.google.com/",S_OK,FALSE},
799 {"%22%20%22weird@ftp.google.com",S_OK,FALSE},
800 {"ftp://ftp.google.com/",S_OK,FALSE},
801 {"google.com",S_OK,FALSE},
804 {"ftp.google.com",S_OK,FALSE},
809 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
811 {"%22%20%22weird",S_OK,FALSE},
812 {"%22%20%22weird",S_OK,FALSE}
815 {Uri_HOST_DNS,S_OK,FALSE},
817 {URL_SCHEME_FTP,S_OK,FALSE},
818 {URLZONE_INVALID,E_NOTIMPL,FALSE}
821 /* Make sure the forbidden characters don't get percent encoded. */
822 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
823 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
824 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
825 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
829 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
830 {"\" \"weird@ftp.google.com",S_OK,FALSE},
831 {"ftp://ftp.google.com/",S_OK,FALSE},
832 {"google.com",S_OK,FALSE},
835 {"ftp.google.com",S_OK,FALSE},
840 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
842 {"\" \"weird",S_OK,FALSE},
843 {"\" \"weird",S_OK,FALSE}
846 {Uri_HOST_DNS,S_OK,FALSE},
848 {URL_SCHEME_FTP,S_OK,FALSE},
849 {URLZONE_INVALID,E_NOTIMPL,FALSE}
852 /* Allowed to have invalid % encoded because its an unknown scheme type. */
853 { "zip://%xy:word@winehq.org/", 0, S_OK, FALSE,
854 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
855 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
856 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
859 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
860 {"%xy:word@winehq.org",S_OK,FALSE},
861 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
862 {"winehq.org",S_OK,FALSE},
865 {"winehq.org",S_OK,FALSE},
870 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
872 {"%xy:word",S_OK,FALSE},
876 {Uri_HOST_DNS,S_OK,FALSE},
878 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
879 {URLZONE_INVALID,E_NOTIMPL,FALSE}
882 /* Unreserved, percent encoded characters aren't decoded in the userinfo becuase the scheme
885 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK, FALSE,
886 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
887 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
888 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
891 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
892 {"%2E:%52%53ord@winehq.org",S_OK,FALSE},
893 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
894 {"winehq.org",S_OK,FALSE},
897 {"winehq.org",S_OK,FALSE},
898 {"%52%53ord",S_OK,FALSE},
902 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
904 {"%2E:%52%53ord",S_OK,FALSE},
908 {Uri_HOST_DNS,S_OK,FALSE},
910 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
911 {URLZONE_INVALID,E_NOTIMPL,FALSE}
914 { "ftp://[](),'test':word@winehq.org/", 0, S_OK, FALSE,
915 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
916 Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
917 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
921 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
922 {"[](),'test':word@winehq.org",S_OK,FALSE},
923 {"ftp://winehq.org/",S_OK,FALSE},
924 {"winehq.org",S_OK,FALSE},
927 {"winehq.org",S_OK,FALSE},
932 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
934 {"[](),'test':word",S_OK,FALSE},
935 {"[](),'test'",S_OK,FALSE}
938 {Uri_HOST_DNS,S_OK,FALSE},
940 {URL_SCHEME_FTP,S_OK,FALSE},
941 {URLZONE_INVALID,E_NOTIMPL,FALSE}
944 { "ftp://test?:word@winehq.org/", 0, S_OK, FALSE,
945 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
946 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
947 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
950 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
952 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
959 {"/?:word@winehq.org/",S_OK,FALSE},
960 {"?:word@winehq.org/",S_OK,FALSE},
961 {"ftp://test?:word@winehq.org/",S_OK,FALSE},
967 {Uri_HOST_DNS,S_OK,FALSE},
969 {URL_SCHEME_FTP,S_OK,FALSE},
970 {URLZONE_INVALID,E_NOTIMPL,FALSE}
973 { "ftp://test#:word@winehq.org/", 0, S_OK, FALSE,
974 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_FRAGMENT|Uri_HAS_HOST|
975 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
976 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
979 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
981 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
984 {"#:word@winehq.org/",S_OK,FALSE},
990 {"ftp://test#:word@winehq.org/",S_OK,FALSE},
996 {Uri_HOST_DNS,S_OK,FALSE},
998 {URL_SCHEME_FTP,S_OK,FALSE},
999 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1002 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1003 { "zip://test\\:word@winehq.org/", 0, S_OK, FALSE,
1004 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
1005 Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1006 Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1009 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1010 {"test\\:word@winehq.org",S_OK,FALSE},
1011 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1012 {"winehq.org",S_OK,FALSE},
1015 {"winehq.org",S_OK,FALSE},
1016 {"word",S_OK,FALSE},
1020 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
1022 {"test\\:word",S_OK,FALSE},
1023 {"test\\",S_OK,FALSE}
1026 {Uri_HOST_DNS,S_OK,FALSE},
1028 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1029 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1032 /* It normalizes IPv4 addresses correctly. */
1033 { "http://127.000.000.100/", 0, S_OK, FALSE,
1034 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1035 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1036 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1039 {"http://127.0.0.100/",S_OK,FALSE},
1040 {"127.0.0.100",S_OK,FALSE},
1041 {"http://127.0.0.100/",S_OK,FALSE},
1045 {"127.0.0.100",S_OK,FALSE},
1050 {"http://127.000.000.100/",S_OK,FALSE},
1051 {"http",S_OK,FALSE},
1056 {Uri_HOST_IPV4,S_OK,FALSE},
1058 {URL_SCHEME_HTTP,S_OK,FALSE},
1059 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1062 /* Make sure it normalizes partial IPv4 addresses correctly. */
1063 { "http://127.0/", 0, S_OK, FALSE,
1064 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1065 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1066 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1069 {"http://127.0.0.0/",S_OK,FALSE},
1070 {"127.0.0.0",S_OK,FALSE},
1071 {"http://127.0.0.0/",S_OK,FALSE},
1075 {"127.0.0.0",S_OK,FALSE},
1080 {"http://127.0/",S_OK,FALSE},
1081 {"http",S_OK,FALSE},
1086 {Uri_HOST_IPV4,S_OK,FALSE},
1088 {URL_SCHEME_HTTP,S_OK,FALSE},
1089 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1092 /* Make sure it converts implicit IPv4's correctly. */
1093 { "http://123456/", 0, S_OK, FALSE,
1094 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1095 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1096 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1099 {"http://0.1.226.64/",S_OK,FALSE},
1100 {"0.1.226.64",S_OK,FALSE},
1101 {"http://0.1.226.64/",S_OK,FALSE},
1105 {"0.1.226.64",S_OK,FALSE},
1110 {"http://123456/",S_OK,FALSE},
1111 {"http",S_OK,FALSE},
1116 {Uri_HOST_IPV4,S_OK,FALSE},
1118 {URL_SCHEME_HTTP,S_OK,FALSE},
1119 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1123 { "http://4294967295/", 0, S_OK, FALSE,
1124 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1125 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1126 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1129 {"http://255.255.255.255/",S_OK,FALSE},
1130 {"255.255.255.255",S_OK,FALSE},
1131 {"http://255.255.255.255/",S_OK,FALSE},
1135 {"255.255.255.255",S_OK,FALSE},
1140 {"http://4294967295/",S_OK,FALSE},
1141 {"http",S_OK,FALSE},
1146 {Uri_HOST_IPV4,S_OK,FALSE},
1148 {URL_SCHEME_HTTP,S_OK,FALSE},
1149 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1153 { "http://4294967296/", 0, S_OK, FALSE,
1154 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1155 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1156 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1159 {"http://4294967296/",S_OK,FALSE},
1160 {"4294967296",S_OK,FALSE},
1161 {"http://4294967296/",S_OK,FALSE},
1165 {"4294967296",S_OK,FALSE},
1170 {"http://4294967296/",S_OK,FALSE},
1171 {"http",S_OK,FALSE},
1176 {Uri_HOST_DNS,S_OK,FALSE},
1178 {URL_SCHEME_HTTP,S_OK,FALSE},
1179 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1182 /* Window's doesn't normalize IP address for unknown schemes. */
1183 { "1234://4294967295/", 0, S_OK, FALSE,
1184 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1185 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1186 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1189 {"1234://4294967295/",S_OK,FALSE},
1190 {"4294967295",S_OK,FALSE},
1191 {"1234://4294967295/",S_OK,FALSE},
1195 {"4294967295",S_OK,FALSE},
1200 {"1234://4294967295/",S_OK,FALSE},
1201 {"1234",S_OK,FALSE},
1206 {Uri_HOST_IPV4,S_OK,FALSE},
1208 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1209 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1212 /* Window's doesn't normalize IP address for unknown schemes. */
1213 { "1234://127.001/", 0, S_OK, FALSE,
1214 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1215 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1216 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1219 {"1234://127.001/",S_OK,FALSE},
1220 {"127.001",S_OK,FALSE},
1221 {"1234://127.001/",S_OK,FALSE},
1225 {"127.001",S_OK,FALSE},
1230 {"1234://127.001/",S_OK,FALSE},
1231 {"1234",S_OK,FALSE},
1236 {Uri_HOST_IPV4,S_OK,FALSE},
1238 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1239 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1242 { "http://[FEDC:BA98::3210]", 0, S_OK, FALSE,
1243 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1244 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1245 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1248 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1249 {"[fedc:ba98::3210]",S_OK,FALSE},
1250 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1254 {"fedc:ba98::3210",S_OK,FALSE},
1259 {"http://[FEDC:BA98::3210]",S_OK,FALSE},
1260 {"http",S_OK,FALSE},
1265 {Uri_HOST_IPV6,S_OK,FALSE},
1267 {URL_SCHEME_HTTP,S_OK,FALSE},
1268 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1271 { "http://[::]", 0, S_OK, FALSE,
1272 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1273 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1274 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1277 {"http://[::]/",S_OK,FALSE},
1278 {"[::]",S_OK,FALSE},
1279 {"http://[::]/",S_OK,FALSE},
1288 {"http://[::]",S_OK,FALSE},
1289 {"http",S_OK,FALSE},
1294 {Uri_HOST_IPV6,S_OK,FALSE},
1296 {URL_SCHEME_HTTP,S_OK,FALSE},
1297 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1300 { "http://[FEDC:BA98::]", 0, S_OK, FALSE,
1301 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1302 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1303 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1306 {"http://[fedc:ba98::]/",S_OK,FALSE},
1307 {"[fedc:ba98::]",S_OK,FALSE},
1308 {"http://[fedc:ba98::]/",S_OK,FALSE},
1312 {"fedc:ba98::",S_OK,FALSE},
1317 {"http://[FEDC:BA98::]",S_OK,FALSE},
1318 {"http",S_OK,FALSE},
1323 {Uri_HOST_IPV6,S_OK,FALSE},
1325 {URL_SCHEME_HTTP,S_OK,FALSE},
1326 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1329 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1330 { "http://[1::3:4:5:6:7:8]", 0, S_OK, FALSE,
1331 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1332 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1333 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1336 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1337 {"[1:0:3:4:5:6:7:8]",S_OK,FALSE},
1338 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1342 {"1:0:3:4:5:6:7:8",S_OK,FALSE},
1347 {"http://[1::3:4:5:6:7:8]",S_OK,FALSE},
1348 {"http",S_OK,FALSE},
1353 {Uri_HOST_IPV6,S_OK,FALSE},
1355 {URL_SCHEME_HTTP,S_OK,FALSE},
1356 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1359 { "http://[v2.34]/", 0, S_OK, FALSE,
1360 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1361 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1362 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1365 {"http://[v2.34]/",S_OK,FALSE},
1366 {"[v2.34]",S_OK,FALSE},
1367 {"http://[v2.34]/",S_OK,FALSE},
1371 {"[v2.34]",S_OK,FALSE},
1376 {"http://[v2.34]/",S_OK,FALSE},
1377 {"http",S_OK,FALSE},
1382 {Uri_HOST_UNKNOWN,S_OK,FALSE},
1384 {URL_SCHEME_HTTP,S_OK,FALSE},
1385 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1388 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1389 { "http://[xyz:12345.com/test", 0, S_OK, FALSE,
1390 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1391 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1392 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1395 {"http://[xyz:12345.com/test",S_OK,FALSE},
1396 {"[xyz:12345.com",S_OK,FALSE},
1397 {"http://[xyz:12345.com/test",S_OK,FALSE},
1398 {"[xyz:12345.com",S_OK,FALSE},
1401 {"[xyz:12345.com",S_OK,FALSE},
1403 {"/test",S_OK,FALSE},
1404 {"/test",S_OK,FALSE},
1406 {"http://[xyz:12345.com/test",S_OK,FALSE},
1407 {"http",S_OK,FALSE},
1412 {Uri_HOST_DNS,S_OK,FALSE},
1414 {URL_SCHEME_HTTP,S_OK,FALSE},
1415 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1418 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1419 * of the host name (respectively).
1421 { "ftp://www.[works].com/", 0, S_OK, FALSE,
1422 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1423 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1424 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1427 {"ftp://www.[works].com/",S_OK,FALSE},
1428 {"www.[works].com",S_OK,FALSE},
1429 {"ftp://www.[works].com/",S_OK,FALSE},
1430 {"[works].com",S_OK,FALSE},
1433 {"www.[works].com",S_OK,FALSE},
1438 {"ftp://www.[works].com/",S_OK,FALSE},
1444 {Uri_HOST_DNS,S_OK,FALSE},
1446 {URL_SCHEME_FTP,S_OK,FALSE},
1447 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1450 /* Considers ':' a delimiter since it appears after the ']'. */
1451 { "http://www.google.com]:12345/", 0, S_OK, FALSE,
1452 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1453 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1454 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1457 {"http://www.google.com]:12345/",S_OK,FALSE},
1458 {"www.google.com]:12345",S_OK,FALSE},
1459 {"http://www.google.com]:12345/",S_OK,FALSE},
1460 {"google.com]",S_OK,FALSE},
1463 {"www.google.com]",S_OK,FALSE},
1468 {"http://www.google.com]:12345/",S_OK,FALSE},
1469 {"http",S_OK,FALSE},
1474 {Uri_HOST_DNS,S_OK,FALSE},
1476 {URL_SCHEME_HTTP,S_OK,FALSE},
1477 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1480 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1481 { "zip://w%XXw%GEw.google.com/", 0, S_OK, FALSE,
1482 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1483 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1484 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1487 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1488 {"w%XXw%GEw.google.com",S_OK,FALSE},
1489 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1490 {"google.com",S_OK,FALSE},
1493 {"w%XXw%GEw.google.com",S_OK,FALSE},
1498 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1504 {Uri_HOST_DNS,S_OK,FALSE},
1506 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1507 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1510 /* Unknown scheme types hostname doesn't get lower cased. */
1511 { "zip://GOOGLE.com/", 0, S_OK, FALSE,
1512 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1513 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1514 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1517 {"zip://GOOGLE.com/",S_OK,FALSE},
1518 {"GOOGLE.com",S_OK,FALSE},
1519 {"zip://GOOGLE.com/",S_OK,FALSE},
1520 {"GOOGLE.com",S_OK,FALSE},
1523 {"GOOGLE.com",S_OK,FALSE},
1528 {"zip://GOOGLE.com/",S_OK,FALSE},
1534 {Uri_HOST_DNS,S_OK,FALSE},
1536 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1537 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1540 /* Hostname get's lower cased for known scheme types. */
1541 { "http://WWW.GOOGLE.com/", 0, S_OK, FALSE,
1542 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1543 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1544 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1547 {"http://www.google.com/",S_OK,FALSE},
1548 {"www.google.com",S_OK,FALSE},
1549 {"http://www.google.com/",S_OK,FALSE},
1550 {"google.com",S_OK,FALSE},
1553 {"www.google.com",S_OK,FALSE},
1558 {"http://WWW.GOOGLE.com/",S_OK,FALSE},
1559 {"http",S_OK,FALSE},
1564 {Uri_HOST_DNS,S_OK,FALSE},
1566 {URL_SCHEME_HTTP,S_OK,FALSE},
1567 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1570 /* Characters that get % encoded in the hostname also have their percent
1571 * encoded forms lower cased.
1573 { "http://www.%7Cgoogle|.com/", 0, S_OK, FALSE,
1574 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1575 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
1576 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1579 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1580 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1581 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1582 {"%7cgoogle%7c.com",S_OK,FALSE},
1585 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1590 {"http://www.%7Cgoogle|.com/",S_OK,FALSE},
1591 {"http",S_OK,FALSE},
1596 {Uri_HOST_DNS,S_OK,FALSE},
1598 {URL_SCHEME_HTTP,S_OK,FALSE},
1599 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1602 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1603 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK, FALSE,
1604 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1605 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1606 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1609 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1610 {"[1:2:3:4:5:6::]",S_OK,FALSE},
1611 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1615 {"1:2:3:4:5:6::",S_OK,FALSE},
1620 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK,FALSE},
1621 {"http",S_OK,FALSE},
1626 {Uri_HOST_IPV6,S_OK,FALSE},
1628 {URL_SCHEME_HTTP,S_OK,FALSE},
1629 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1632 /* IPv4 addresses get normalized. */
1633 { "http://[::001.002.003.000]", 0, S_OK, FALSE,
1634 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1635 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1636 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1639 {"http://[::1.2.3.0]/",S_OK,FALSE},
1640 {"[::1.2.3.0]",S_OK,FALSE},
1641 {"http://[::1.2.3.0]/",S_OK,FALSE},
1645 {"::1.2.3.0",S_OK,FALSE},
1650 {"http://[::001.002.003.000]",S_OK,FALSE},
1651 {"http",S_OK,FALSE},
1656 {Uri_HOST_IPV6,S_OK,FALSE},
1658 {URL_SCHEME_HTTP,S_OK,FALSE},
1659 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1662 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1663 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK, FALSE,
1664 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1665 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1666 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1669 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1670 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1671 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1675 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK,FALSE},
1680 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1686 {Uri_HOST_IPV6,S_OK,FALSE},
1688 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1689 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1692 /* IPv4 address is converted into 2 h16 components. */
1693 { "http://[ffff::192.222.111.32]", 0, S_OK, FALSE,
1694 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
1695 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1696 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1699 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1700 {"[ffff::c0de:6f20]",S_OK,FALSE},
1701 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1705 {"ffff::c0de:6f20",S_OK,FALSE},
1710 {"http://[ffff::192.222.111.32]",S_OK,FALSE},
1711 {"http",S_OK,FALSE},
1716 {Uri_HOST_IPV6,S_OK,FALSE},
1718 {URL_SCHEME_HTTP,S_OK,FALSE},
1719 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1722 /* Max value for a port. */
1723 { "http://google.com:65535", 0, S_OK, FALSE,
1724 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1725 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1726 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1729 {"http://google.com:65535/",S_OK,FALSE},
1730 {"google.com:65535",S_OK,FALSE},
1731 {"http://google.com:65535/",S_OK,FALSE},
1732 {"google.com",S_OK,FALSE},
1735 {"google.com",S_OK,FALSE},
1740 {"http://google.com:65535",S_OK,FALSE},
1741 {"http",S_OK,FALSE},
1746 {Uri_HOST_DNS,S_OK,FALSE},
1748 {URL_SCHEME_HTTP,S_OK,FALSE},
1749 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1752 { "zip://google.com:65536", 0, S_OK, FALSE,
1753 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1754 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1755 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1758 {"zip://google.com:65536/",S_OK,FALSE},
1759 {"google.com:65536",S_OK,FALSE},
1760 {"zip://google.com:65536/",S_OK,FALSE},
1761 {"google.com:65536",S_OK,FALSE},
1764 {"google.com:65536",S_OK,FALSE},
1769 {"zip://google.com:65536",S_OK,FALSE},
1775 {Uri_HOST_DNS,S_OK,FALSE},
1777 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1778 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1781 { "zip://google.com:65536:25", 0, S_OK, FALSE,
1782 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1783 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1784 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1787 {"zip://google.com:65536:25/",S_OK,FALSE},
1788 {"google.com:65536:25",S_OK,FALSE},
1789 {"zip://google.com:65536:25/",S_OK,FALSE},
1790 {"google.com:65536:25",S_OK,FALSE},
1793 {"google.com:65536:25",S_OK,FALSE},
1798 {"zip://google.com:65536:25",S_OK,FALSE},
1804 {Uri_HOST_DNS,S_OK,FALSE},
1806 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1807 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1810 { "zip://[::ffff]:abcd", 0, S_OK, FALSE,
1811 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|
1812 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1813 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1816 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1817 {"[::ffff]:abcd",S_OK,FALSE},
1818 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1822 {"[::ffff]:abcd",S_OK,FALSE},
1827 {"zip://[::ffff]:abcd",S_OK,FALSE},
1833 {Uri_HOST_DNS,S_OK,FALSE},
1835 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1836 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1839 { "zip://127.0.0.1:abcd", 0, S_OK, FALSE,
1840 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1841 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1842 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
1845 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1846 {"127.0.0.1:abcd",S_OK,FALSE},
1847 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1848 {"0.1:abcd",S_OK,FALSE},
1851 {"127.0.0.1:abcd",S_OK,FALSE},
1856 {"zip://127.0.0.1:abcd",S_OK,FALSE},
1862 {Uri_HOST_DNS,S_OK,FALSE},
1864 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1865 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1868 /* Port is just copied over. */
1869 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1870 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1871 Uri_HAS_HOST|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1874 {"http://google.com:00035",S_OK,FALSE},
1875 {"google.com:00035",S_OK,FALSE},
1876 {"http://google.com:00035",S_OK,FALSE,"http://google.com:35"},
1877 {"google.com",S_OK,FALSE},
1880 {"google.com",S_OK,FALSE},
1885 {"http://google.com:00035",S_OK,FALSE},
1886 {"http",S_OK,FALSE},
1891 {Uri_HOST_DNS,S_OK,FALSE},
1893 {URL_SCHEME_HTTP,S_OK,FALSE},
1894 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1897 /* Default port is copied over. */
1898 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1899 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1900 Uri_HAS_HOST|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1903 {"http://google.com:80",S_OK,FALSE},
1904 {"google.com:80",S_OK,FALSE},
1905 {"http://google.com:80",S_OK,FALSE},
1906 {"google.com",S_OK,FALSE},
1909 {"google.com",S_OK,FALSE},
1914 {"http://google.com:80",S_OK,FALSE},
1915 {"http",S_OK,FALSE},
1920 {Uri_HOST_DNS,S_OK,FALSE},
1922 {URL_SCHEME_HTTP,S_OK,FALSE},
1923 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1926 { "http://google.com.uk", 0, S_OK, FALSE,
1927 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1928 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1929 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1932 {"http://google.com.uk/",S_OK,FALSE},
1933 {"google.com.uk",S_OK,FALSE},
1934 {"http://google.com.uk/",S_OK,FALSE},
1935 {"google.com.uk",S_OK,FALSE},
1938 {"google.com.uk",S_OK,FALSE},
1943 {"http://google.com.uk",S_OK,FALSE},
1944 {"http",S_OK,FALSE},
1949 {Uri_HOST_DNS,S_OK,FALSE},
1951 {URL_SCHEME_HTTP,S_OK,FALSE},
1952 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1955 { "http://google.com.com", 0, S_OK, FALSE,
1956 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1957 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1958 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1961 {"http://google.com.com/",S_OK,FALSE},
1962 {"google.com.com",S_OK,FALSE},
1963 {"http://google.com.com/",S_OK,FALSE},
1964 {"com.com",S_OK,FALSE},
1967 {"google.com.com",S_OK,FALSE},
1972 {"http://google.com.com",S_OK,FALSE},
1973 {"http",S_OK,FALSE},
1978 {Uri_HOST_DNS,S_OK,FALSE},
1980 {URL_SCHEME_HTTP,S_OK,FALSE},
1981 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1984 { "http://google.uk.1", 0, S_OK, FALSE,
1985 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
1986 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
1987 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
1990 {"http://google.uk.1/",S_OK,FALSE},
1991 {"google.uk.1",S_OK,FALSE},
1992 {"http://google.uk.1/",S_OK,FALSE},
1993 {"google.uk.1",S_OK,FALSE},
1996 {"google.uk.1",S_OK,FALSE},
2001 {"http://google.uk.1",S_OK,FALSE},
2002 {"http",S_OK,FALSE},
2007 {Uri_HOST_DNS,S_OK,FALSE},
2009 {URL_SCHEME_HTTP,S_OK,FALSE},
2010 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2013 /* Since foo isn't a recognized 3 character TLD its considered the domain name. */
2014 { "http://google.foo.uk", 0, S_OK, FALSE,
2015 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
2016 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2017 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2020 {"http://google.foo.uk/",S_OK,FALSE},
2021 {"google.foo.uk",S_OK,FALSE},
2022 {"http://google.foo.uk/",S_OK,FALSE},
2023 {"foo.uk",S_OK,FALSE},
2026 {"google.foo.uk",S_OK,FALSE},
2031 {"http://google.foo.uk",S_OK,FALSE},
2032 {"http",S_OK,FALSE},
2037 {Uri_HOST_DNS,S_OK,FALSE},
2039 {URL_SCHEME_HTTP,S_OK,FALSE},
2040 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2043 { "http://.com", 0, S_OK, FALSE,
2044 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
2045 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2046 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2049 {"http://.com/",S_OK,FALSE},
2050 {".com",S_OK,FALSE},
2051 {"http://.com/",S_OK,FALSE},
2052 {".com",S_OK,FALSE},
2055 {".com",S_OK,FALSE},
2060 {"http://.com",S_OK,FALSE},
2061 {"http",S_OK,FALSE},
2066 {Uri_HOST_DNS,S_OK,FALSE},
2068 {URL_SCHEME_HTTP,S_OK,FALSE},
2069 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2072 { "http://.uk", 0, S_OK, FALSE,
2073 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2074 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2075 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2078 {"http://.uk/",S_OK,FALSE},
2080 {"http://.uk/",S_OK,FALSE},
2089 {"http://.uk",S_OK,FALSE},
2090 {"http",S_OK,FALSE},
2095 {Uri_HOST_DNS,S_OK,FALSE},
2097 {URL_SCHEME_HTTP,S_OK,FALSE},
2098 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2101 { "http://www.co.google.com.[]", 0, S_OK, FALSE,
2102 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
2103 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2104 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2107 {"http://www.co.google.com.[]/",S_OK,FALSE},
2108 {"www.co.google.com.[]",S_OK,FALSE},
2109 {"http://www.co.google.com.[]/",S_OK,FALSE},
2110 {"google.com.[]",S_OK,FALSE},
2113 {"www.co.google.com.[]",S_OK,FALSE},
2118 {"http://www.co.google.com.[]",S_OK,FALSE},
2119 {"http",S_OK,FALSE},
2124 {Uri_HOST_DNS,S_OK,FALSE},
2126 {URL_SCHEME_HTTP,S_OK,FALSE},
2127 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2130 { "http://co.uk", 0, S_OK, FALSE,
2131 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2132 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2133 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2136 {"http://co.uk/",S_OK,FALSE},
2137 {"co.uk",S_OK,FALSE},
2138 {"http://co.uk/",S_OK,FALSE},
2142 {"co.uk",S_OK,FALSE},
2147 {"http://co.uk",S_OK,FALSE},
2148 {"http",S_OK,FALSE},
2153 {Uri_HOST_DNS,S_OK,FALSE},
2155 {URL_SCHEME_HTTP,S_OK,FALSE},
2156 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2159 { "http://www.co.google.us.test", 0, S_OK, FALSE,
2160 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
2161 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2162 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2165 {"http://www.co.google.us.test/",S_OK,FALSE},
2166 {"www.co.google.us.test",S_OK,FALSE},
2167 {"http://www.co.google.us.test/",S_OK,FALSE},
2168 {"us.test",S_OK,FALSE},
2171 {"www.co.google.us.test",S_OK,FALSE},
2176 {"http://www.co.google.us.test",S_OK,FALSE},
2177 {"http",S_OK,FALSE},
2182 {Uri_HOST_DNS,S_OK,FALSE},
2184 {URL_SCHEME_HTTP,S_OK,FALSE},
2185 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2188 { "http://gov.uk", 0, S_OK, FALSE,
2189 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2190 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2191 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2194 {"http://gov.uk/",S_OK,FALSE},
2195 {"gov.uk",S_OK,FALSE},
2196 {"http://gov.uk/",S_OK,FALSE},
2200 {"gov.uk",S_OK,FALSE},
2205 {"http://gov.uk",S_OK,FALSE},
2206 {"http",S_OK,FALSE},
2211 {Uri_HOST_DNS,S_OK,FALSE},
2213 {URL_SCHEME_HTTP,S_OK,FALSE},
2214 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2217 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2218 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
2219 Uri_HAS_HOST|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2222 {"zip://www.google.com\\test",S_OK,FALSE},
2223 {"www.google.com\\test",S_OK,FALSE},
2224 {"zip://www.google.com\\test",S_OK,FALSE},
2225 {"google.com\\test",S_OK,FALSE},
2228 {"www.google.com\\test",S_OK,FALSE},
2233 {"zip://www.google.com\\test",S_OK,FALSE},
2239 {Uri_HOST_DNS,S_OK,FALSE},
2241 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2242 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2245 { "urn:excepts:bad:%XY:encoded", 0, S_OK, FALSE,
2246 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2247 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2250 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2252 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2258 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2259 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2261 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2267 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2269 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2270 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2273 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2274 * are decoded and all '%' are encoded.
2276 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK, FALSE,
2277 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
2278 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2281 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2283 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2285 {".mp3",S_OK,FALSE},
2289 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2290 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2292 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK,FALSE},
2293 {"file",S_OK,FALSE},
2298 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2300 {URL_SCHEME_FILE,S_OK,FALSE},
2301 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2304 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2305 * is decoded and only %'s in front of invalid hex digits are encoded.
2307 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK, FALSE,
2308 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
2309 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2312 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2314 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2316 {".mp3",S_OK,FALSE},
2320 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2321 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2323 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK,FALSE},
2324 {"file",S_OK,FALSE},
2329 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2331 {URL_SCHEME_FILE,S_OK,FALSE},
2332 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2335 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2336 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK, FALSE,
2337 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2338 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2339 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2342 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2343 {"[::1.2.3.0]",S_OK,FALSE},
2344 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2348 {"::1.2.3.0",S_OK,FALSE},
2350 {"/%3F%23.T/test",S_OK,FALSE},
2351 {"/%3F%23.T/test",S_OK,FALSE},
2353 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK,FALSE},
2354 {"http",S_OK,FALSE},
2359 {Uri_HOST_IPV6,S_OK,FALSE},
2361 {URL_SCHEME_HTTP,S_OK,FALSE},
2362 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2365 /* Forbidden characters are always encoded for file URIs. */
2366 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2367 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
2368 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2371 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2373 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2375 {".mp3",S_OK,FALSE},
2379 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2380 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2382 {"file:///C:/\"test\"/test.mp3",S_OK,FALSE},
2383 {"file",S_OK,FALSE},
2388 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2390 {URL_SCHEME_FILE,S_OK,FALSE},
2391 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2394 /* Forbidden characters are never encoded for unknown scheme types. */
2395 { "1234://4294967295/<|>\" test<|>", 0, S_OK, FALSE,
2396 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2397 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2398 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2401 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2402 {"4294967295",S_OK,FALSE},
2403 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2407 {"4294967295",S_OK,FALSE},
2409 {"/<|>\" test<|>",S_OK,FALSE},
2410 {"/<|>\" test<|>",S_OK,FALSE},
2412 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2413 {"1234",S_OK,FALSE},
2418 {Uri_HOST_IPV4,S_OK,FALSE},
2420 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2421 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2424 /* Make sure forbidden characters are percent encoded. */
2425 { "http://gov.uk/<|> test<|>", 0, S_OK, FALSE,
2426 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2427 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2428 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2431 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2432 {"gov.uk",S_OK,FALSE},
2433 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2437 {"gov.uk",S_OK,FALSE},
2439 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2440 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2442 {"http://gov.uk/<|> test<|>",S_OK,FALSE},
2443 {"http",S_OK,FALSE},
2448 {Uri_HOST_DNS,S_OK,FALSE},
2450 {URL_SCHEME_HTTP,S_OK,FALSE},
2451 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2454 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK, FALSE,
2455 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2456 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2457 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2460 {"http://gov.uk/",S_OK,FALSE},
2461 {"gov.uk",S_OK,FALSE},
2462 {"http://gov.uk/",S_OK,FALSE},
2466 {"gov.uk",S_OK,FALSE},
2471 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK,FALSE},
2472 {"http",S_OK,FALSE},
2477 {Uri_HOST_DNS,S_OK,FALSE},
2479 {URL_SCHEME_HTTP,S_OK,FALSE},
2480 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2483 { "http://gov.uk/test/test2/../../..", 0, S_OK, FALSE,
2484 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2485 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2486 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2489 {"http://gov.uk/",S_OK,FALSE},
2490 {"gov.uk",S_OK,FALSE},
2491 {"http://gov.uk/",S_OK,FALSE},
2495 {"gov.uk",S_OK,FALSE},
2500 {"http://gov.uk/test/test2/../../..",S_OK,FALSE},
2501 {"http",S_OK,FALSE},
2506 {Uri_HOST_DNS,S_OK,FALSE},
2508 {URL_SCHEME_HTTP,S_OK,FALSE},
2509 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2512 { "http://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2513 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2514 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2515 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2518 {"http://gov.uk/",S_OK,FALSE},
2519 {"gov.uk",S_OK,FALSE},
2520 {"http://gov.uk/",S_OK,FALSE},
2524 {"gov.uk",S_OK,FALSE},
2529 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2530 {"http",S_OK,FALSE},
2535 {Uri_HOST_DNS,S_OK,FALSE},
2537 {URL_SCHEME_HTTP,S_OK,FALSE},
2538 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2541 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK, FALSE,
2542 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
2543 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2546 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2548 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2550 {".mp3",S_OK,FALSE},
2554 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2555 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2557 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK,FALSE},
2558 {"file",S_OK,FALSE},
2563 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2565 {URL_SCHEME_FILE,S_OK,FALSE},
2566 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2569 /* Dot removal happens for unknown scheme types. */
2570 { "zip://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2571 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
2572 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2573 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2576 {"zip://gov.uk/",S_OK,FALSE},
2577 {"gov.uk",S_OK,FALSE},
2578 {"zip://gov.uk/",S_OK,FALSE},
2582 {"gov.uk",S_OK,FALSE},
2587 {"zip://gov.uk/test/test2/../../.",S_OK,FALSE},
2593 {Uri_HOST_DNS,S_OK,FALSE},
2595 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2596 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2599 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2600 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2601 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|
2602 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2603 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
2606 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2607 {"gov.uk",S_OK,FALSE},
2608 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2612 {"gov.uk",S_OK,FALSE},
2614 {"/test/test2/../../.",S_OK,FALSE},
2615 {"/test/test2/../../.",S_OK,FALSE},
2617 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2618 {"http",S_OK,FALSE},
2623 {Uri_HOST_DNS,S_OK,FALSE},
2625 {URL_SCHEME_HTTP,S_OK,FALSE},
2626 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2629 /* Dot removal doesn't happen for wildcard scheme types. */
2630 { "*:gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2631 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|
2632 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
2633 Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2636 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2637 {"gov.uk",S_OK,FALSE},
2638 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2642 {"gov.uk",S_OK,FALSE},
2644 {"/test/test2/../../.",S_OK,FALSE},
2645 {"/test/test2/../../.",S_OK,FALSE},
2647 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2653 {Uri_HOST_DNS,S_OK,FALSE},
2655 {URL_SCHEME_WILDCARD,S_OK,FALSE},
2656 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2659 /* Forbidden characters are encoded for opaque known scheme types. */
2660 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK, FALSE,
2661 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2662 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2665 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2667 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2669 {".com%22",S_OK,FALSE},
2673 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2674 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2676 {"mailto:\"acco<|>unt@example.com\"",S_OK,FALSE},
2677 {"mailto",S_OK,FALSE},
2682 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2684 {URL_SCHEME_MAILTO,S_OK,FALSE},
2685 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2688 { "news:test.tes<|>t.com", 0, S_OK, FALSE,
2689 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2690 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2693 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2695 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2697 {".com",S_OK,FALSE},
2701 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2702 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2704 {"news:test.tes<|>t.com",S_OK,FALSE},
2705 {"news",S_OK,FALSE},
2710 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2712 {URL_SCHEME_NEWS,S_OK,FALSE},
2713 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2716 /* Don't encode forbidden characters. */
2717 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2718 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2719 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2722 {"news:test.tes<|>t.com",S_OK,FALSE},
2724 {"news:test.tes<|>t.com",S_OK,FALSE},
2726 {".com",S_OK,FALSE},
2730 {"test.tes<|>t.com",S_OK,FALSE},
2731 {"test.tes<|>t.com",S_OK,FALSE},
2733 {"news:test.tes<|>t.com",S_OK,FALSE},
2734 {"news",S_OK,FALSE},
2739 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2741 {URL_SCHEME_NEWS,S_OK,FALSE},
2742 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2745 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2746 { "urn:test.tes<|>t.com", 0, S_OK, FALSE,
2747 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2748 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2751 {"urn:test.tes<|>t.com",S_OK,FALSE},
2753 {"urn:test.tes<|>t.com",S_OK,FALSE},
2755 {".com",S_OK,FALSE},
2759 {"test.tes<|>t.com",S_OK,FALSE},
2760 {"test.tes<|>t.com",S_OK,FALSE},
2762 {"urn:test.tes<|>t.com",S_OK,FALSE},
2768 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2770 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2771 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2774 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2775 { "news:test.%74%65%73%74.com", 0, S_OK, FALSE,
2776 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2777 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2780 {"news:test.test.com",S_OK,FALSE},
2782 {"news:test.test.com",S_OK,FALSE},
2784 {".com",S_OK,FALSE},
2788 {"test.test.com",S_OK,FALSE},
2789 {"test.test.com",S_OK,FALSE},
2791 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2792 {"news",S_OK,FALSE},
2797 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2799 {URL_SCHEME_NEWS,S_OK,FALSE},
2800 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2803 /* Percent encoded characters are still decoded for known scheme types. */
2804 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2805 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2806 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2809 {"news:test.test.com",S_OK,FALSE},
2811 {"news:test.test.com",S_OK,FALSE},
2813 {".com",S_OK,FALSE},
2817 {"test.test.com",S_OK,FALSE},
2818 {"test.test.com",S_OK,FALSE},
2820 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2821 {"news",S_OK,FALSE},
2826 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2828 {URL_SCHEME_NEWS,S_OK,FALSE},
2829 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2832 /* Percent encoded characters aren't decoded for unknown scheme types. */
2833 { "urn:test.%74%65%73%74.com", 0, S_OK, FALSE,
2834 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
2835 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2838 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2840 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2842 {".com",S_OK,FALSE},
2846 {"test.%74%65%73%74.com",S_OK,FALSE},
2847 {"test.%74%65%73%74.com",S_OK,FALSE},
2849 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2855 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2857 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2858 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2861 /* Unknown scheme types can have invalid % encoded data in query string. */
2862 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK, FALSE,
2863 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
2864 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
2865 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2868 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2869 {"www.winehq.org",S_OK,FALSE},
2870 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2871 {"winehq.org",S_OK,FALSE},
2874 {"www.winehq.org",S_OK,FALSE},
2877 {"/?query=%xx&return=y",S_OK,FALSE},
2878 {"?query=%xx&return=y",S_OK,FALSE},
2879 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2885 {Uri_HOST_DNS,S_OK,FALSE},
2887 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2888 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2891 /* Known scheme types can have invalid % encoded data with the right flags. */
2892 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2893 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
2894 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
2895 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2898 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2899 {"www.winehq.org",S_OK,FALSE},
2900 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2901 {"winehq.org",S_OK,FALSE},
2904 {"www.winehq.org",S_OK,FALSE},
2907 {"/?query=%xx&return=y",S_OK,FALSE},
2908 {"?query=%xx&return=y",S_OK,FALSE},
2909 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2910 {"http",S_OK,FALSE},
2915 {Uri_HOST_DNS,S_OK,FALSE},
2917 {URL_SCHEME_HTTP,S_OK,FALSE},
2918 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2921 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2922 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2923 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
2924 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
2925 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2928 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2929 {"www.winehq.org",S_OK,FALSE},
2930 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2931 {"winehq.org",S_OK,FALSE},
2934 {"www.winehq.org",S_OK,FALSE},
2937 {"/?query=<|>&return=y",S_OK,FALSE},
2938 {"?query=<|>&return=y",S_OK,FALSE},
2939 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2940 {"http",S_OK,FALSE},
2945 {Uri_HOST_DNS,S_OK,FALSE},
2947 {URL_SCHEME_HTTP,S_OK,FALSE},
2948 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2951 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2952 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2953 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
2954 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
2955 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2958 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2959 {"www.winehq.org",S_OK,FALSE},
2960 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2961 {"winehq.org",S_OK,FALSE},
2964 {"www.winehq.org",S_OK,FALSE},
2967 {"/?query=<|>&return=y",S_OK,FALSE},
2968 {"?query=<|>&return=y",S_OK,FALSE},
2969 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2970 {"http",S_OK,FALSE},
2975 {Uri_HOST_DNS,S_OK,FALSE},
2977 {URL_SCHEME_HTTP,S_OK,FALSE},
2978 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2981 /* Forbidden characters are encoded for known scheme types. */
2982 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
2983 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
2984 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
2985 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
2988 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2989 {"www.winehq.org",S_OK,FALSE},
2990 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2991 {"winehq.org",S_OK,FALSE},
2994 {"www.winehq.org",S_OK,FALSE},
2997 {"/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2998 {"?query=%3C%7C%3E&return=y",S_OK,FALSE},
2999 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
3000 {"http",S_OK,FALSE},
3005 {Uri_HOST_DNS,S_OK,FALSE},
3007 {URL_SCHEME_HTTP,S_OK,FALSE},
3008 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3011 /* Forbidden characters are not encoded for unknown scheme types. */
3012 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
3013 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
3014 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
3015 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3018 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
3019 {"www.winehq.org",S_OK,FALSE},
3020 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
3021 {"winehq.org",S_OK,FALSE},
3024 {"www.winehq.org",S_OK,FALSE},
3027 {"/?query=<|>&return=y",S_OK,FALSE},
3028 {"?query=<|>&return=y",S_OK,FALSE},
3029 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
3035 {Uri_HOST_DNS,S_OK,FALSE},
3037 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3038 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3041 /* Percent encoded, unreserved characters are decoded for known scheme types. */
3042 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
3043 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
3044 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
3045 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3048 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
3049 {"www.winehq.org",S_OK,FALSE},
3050 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
3051 {"winehq.org",S_OK,FALSE},
3054 {"www.winehq.org",S_OK,FALSE},
3057 {"/?query=01&return=y",S_OK,FALSE},
3058 {"?query=01&return=y",S_OK,FALSE},
3059 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3060 {"http",S_OK,FALSE},
3065 {Uri_HOST_DNS,S_OK,FALSE},
3067 {URL_SCHEME_HTTP,S_OK,FALSE},
3068 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3071 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
3072 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
3073 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
3074 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
3075 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3078 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3079 {"www.winehq.org",S_OK,FALSE},
3080 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3081 {"winehq.org",S_OK,FALSE},
3084 {"www.winehq.org",S_OK,FALSE},
3087 {"/?query=%30%31&return=y",S_OK,FALSE},
3088 {"?query=%30%31&return=y",S_OK,FALSE},
3089 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3095 {Uri_HOST_DNS,S_OK,FALSE},
3097 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3098 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3101 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
3102 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
3103 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
3104 Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
3105 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3108 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3109 {"www.winehq.org",S_OK,FALSE},
3110 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
3111 {"winehq.org",S_OK,FALSE},
3114 {"www.winehq.org",S_OK,FALSE},
3117 {"/?query=%30%31&return=y",S_OK,FALSE},
3118 {"?query=%30%31&return=y",S_OK,FALSE},
3119 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
3120 {"http",S_OK,FALSE},
3125 {Uri_HOST_DNS,S_OK,FALSE},
3127 {URL_SCHEME_HTTP,S_OK,FALSE},
3128 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3131 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
3132 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
3133 Uri_HAS_DOMAIN|Uri_HAS_PATH_AND_QUERY|Uri_HAS_PORT|Uri_HAS_QUERY|Uri_HAS_RAW_URI|
3134 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3137 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3138 {"www.winehq.org",S_OK,FALSE},
3139 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3140 {"winehq.org",S_OK,FALSE},
3143 {"www.winehq.org",S_OK,FALSE},
3146 {"?query=12&return=y",S_OK,FALSE},
3147 {"?query=12&return=y",S_OK,FALSE},
3148 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
3149 {"http",S_OK,FALSE},
3154 {Uri_HOST_DNS,S_OK,FALSE},
3156 {URL_SCHEME_HTTP,S_OK,FALSE},
3157 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3160 /* Unknown scheme types can have invalid % encoded data in fragments. */
3161 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK, FALSE,
3162 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3163 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3164 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3167 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3168 {"www.winehq.org",S_OK,FALSE},
3169 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3170 {"winehq.org",S_OK,FALSE},
3172 {"#Te%xx",S_OK,FALSE},
3173 {"www.winehq.org",S_OK,FALSE},
3175 {"/tests/",S_OK,FALSE},
3176 {"/tests/",S_OK,FALSE},
3178 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
3184 {Uri_HOST_DNS,S_OK,FALSE},
3186 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3187 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3190 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
3191 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE,
3192 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3193 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3194 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3197 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3198 {"www.winehq.org",S_OK,FALSE},
3199 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3200 {"winehq.org",S_OK,FALSE},
3202 {"#Te<|>",S_OK,FALSE},
3203 {"www.winehq.org",S_OK,FALSE},
3205 {"/tests/",S_OK,FALSE},
3206 {"/tests/",S_OK,FALSE},
3208 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3214 {Uri_HOST_DNS,S_OK,FALSE},
3216 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3217 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3220 /* Forbidden characters in the fragment are percent encoded for known schemes. */
3221 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE,
3222 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3223 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3224 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3227 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
3228 {"www.winehq.org",S_OK,FALSE},
3229 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
3230 {"winehq.org",S_OK,FALSE},
3232 {"#Te%3C%7C%3E",S_OK,FALSE},
3233 {"www.winehq.org",S_OK,FALSE},
3235 {"/tests/",S_OK,FALSE},
3236 {"/tests/",S_OK,FALSE},
3238 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3239 {"http",S_OK,FALSE},
3244 {Uri_HOST_DNS,S_OK,FALSE},
3246 {URL_SCHEME_HTTP,S_OK,FALSE},
3247 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3250 /* Forbidden characters aren't encoded in the fragment with this flag. */
3251 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
3252 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3253 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3254 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3257 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3258 {"www.winehq.org",S_OK,FALSE},
3259 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3260 {"winehq.org",S_OK,FALSE},
3262 {"#Te<|>",S_OK,FALSE},
3263 {"www.winehq.org",S_OK,FALSE},
3265 {"/tests/",S_OK,FALSE},
3266 {"/tests/",S_OK,FALSE},
3268 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3269 {"http",S_OK,FALSE},
3274 {Uri_HOST_DNS,S_OK,FALSE},
3276 {URL_SCHEME_HTTP,S_OK,FALSE},
3277 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3280 /* Forbidden characters aren't encoded in the fragment with this flag. */
3281 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
3282 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3283 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3284 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3287 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3288 {"www.winehq.org",S_OK,FALSE},
3289 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3290 {"winehq.org",S_OK,FALSE},
3292 {"#Te<|>",S_OK,FALSE},
3293 {"www.winehq.org",S_OK,FALSE},
3295 {"/tests/",S_OK,FALSE},
3296 {"/tests/",S_OK,FALSE},
3298 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
3299 {"http",S_OK,FALSE},
3304 {Uri_HOST_DNS,S_OK,FALSE},
3306 {URL_SCHEME_HTTP,S_OK,FALSE},
3307 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3310 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3311 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE,
3312 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3313 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3314 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3317 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3318 {"www.winehq.org",S_OK,FALSE},
3319 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3320 {"winehq.org",S_OK,FALSE},
3322 {"#Te%30%31%32",S_OK,FALSE},
3323 {"www.winehq.org",S_OK,FALSE},
3325 {"/tests/",S_OK,FALSE},
3326 {"/tests/",S_OK,FALSE},
3328 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3334 {Uri_HOST_DNS,S_OK,FALSE},
3336 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3337 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3340 /* Percent encoded, unreserved characters are decoded for known schemes. */
3341 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE,
3342 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3343 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3344 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3347 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3348 {"www.winehq.org",S_OK,FALSE},
3349 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3350 {"winehq.org",S_OK,FALSE},
3352 {"#Te012",S_OK,FALSE},
3353 {"www.winehq.org",S_OK,FALSE},
3355 {"/tests/",S_OK,FALSE},
3356 {"/tests/",S_OK,FALSE},
3358 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3359 {"http",S_OK,FALSE},
3364 {Uri_HOST_DNS,S_OK,FALSE},
3366 {URL_SCHEME_HTTP,S_OK,FALSE},
3367 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3370 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3371 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
3372 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3373 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3374 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3377 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3378 {"www.winehq.org",S_OK,FALSE},
3379 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3380 {"winehq.org",S_OK,FALSE},
3382 {"#Te012",S_OK,FALSE},
3383 {"www.winehq.org",S_OK,FALSE},
3385 {"/tests/",S_OK,FALSE},
3386 {"/tests/",S_OK,FALSE},
3388 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3389 {"http",S_OK,FALSE},
3394 {Uri_HOST_DNS,S_OK,FALSE},
3396 {URL_SCHEME_HTTP,S_OK,FALSE},
3397 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3400 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3401 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
3402 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_FRAGMENT|
3403 Uri_HAS_HOST|Uri_HAS_DOMAIN|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3404 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3407 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3408 {"www.winehq.org",S_OK,FALSE},
3409 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3410 {"winehq.org",S_OK,FALSE},
3412 {"#Te%30%31%32",S_OK,FALSE},
3413 {"www.winehq.org",S_OK,FALSE},
3415 {"/tests/",S_OK,FALSE},
3416 {"/tests/",S_OK,FALSE},
3418 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3419 {"http",S_OK,FALSE},
3424 {Uri_HOST_DNS,S_OK,FALSE},
3426 {URL_SCHEME_HTTP,S_OK,FALSE},
3427 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3430 /* Leading/Trailing whitespace is removed. */
3431 { " http://google.com/ ", 0, S_OK, FALSE,
3432 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
3433 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3434 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3437 {"http://google.com/",S_OK,FALSE},
3438 {"google.com",S_OK,FALSE},
3439 {"http://google.com/",S_OK,FALSE},
3440 {"google.com",S_OK,FALSE},
3443 {"google.com",S_OK,FALSE},
3448 {"http://google.com/",S_OK,FALSE},
3449 {"http",S_OK,FALSE},
3454 {Uri_HOST_DNS,S_OK,FALSE},
3456 {URL_SCHEME_HTTP,S_OK,FALSE},
3457 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3460 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK, FALSE,
3461 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
3462 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3463 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3466 {"http://google.com/",S_OK,FALSE},
3467 {"google.com",S_OK,FALSE},
3468 {"http://google.com/",S_OK,FALSE},
3469 {"google.com",S_OK,FALSE},
3472 {"google.com",S_OK,FALSE},
3477 {"http://google.com/",S_OK,FALSE},
3478 {"http",S_OK,FALSE},
3483 {Uri_HOST_DNS,S_OK,FALSE},
3485 {URL_SCHEME_HTTP,S_OK,FALSE},
3486 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3489 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE,
3490 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
3491 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3492 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3495 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3496 {"g%0aoogle.co%0dm",S_OK,FALSE},
3497 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3498 {"g%0aoogle.co%0dm",S_OK,FALSE},
3501 {"g%0aoogle.co%0dm",S_OK,FALSE},
3503 {"/%0A%0A%0A",S_OK,FALSE},
3504 {"/%0A%0A%0A",S_OK,FALSE},
3506 {"http://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3507 {"http",S_OK,FALSE},
3512 {Uri_HOST_DNS,S_OK,FALSE},
3514 {URL_SCHEME_HTTP,S_OK,FALSE},
3515 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3518 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE,
3519 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
3520 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
3521 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3524 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3525 {"g\noogle.co\rm",S_OK,FALSE},
3526 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3527 {"g\noogle.co\rm",S_OK,FALSE},
3530 {"g\noogle.co\rm",S_OK,FALSE},
3532 {"/\n\n\n",S_OK,FALSE},
3533 {"/\n\n\n",S_OK,FALSE},
3535 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3541 {Uri_HOST_DNS,S_OK,FALSE},
3543 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3544 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3547 /* Since file URLs are usually hierarchical, it returns an empty string
3548 * for the absolute URI property since it was declared as an opaque URI.
3550 { "file:index.html", 0, S_OK, FALSE,
3551 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
3552 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE,
3556 {"file:index.html",S_OK,FALSE},
3558 {".html",S_OK,FALSE},
3562 {"index.html",S_OK,FALSE},
3563 {"index.html",S_OK,FALSE},
3565 {"file:index.html",S_OK,FALSE},
3566 {"file",S_OK,FALSE},
3573 {URL_SCHEME_FILE,S_OK,FALSE},
3574 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3577 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3578 { "http:test.com/index.html", 0, S_OK, FALSE,
3579 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
3580 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME, FALSE,
3584 {"http:test.com/index.html",S_OK,FALSE},
3586 {".html",S_OK,FALSE},
3590 {"test.com/index.html",S_OK,FALSE},
3591 {"test.com/index.html",S_OK,FALSE},
3593 {"http:test.com/index.html",S_OK,FALSE},
3594 {"http",S_OK,FALSE},
3599 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3601 {URL_SCHEME_HTTP,S_OK,FALSE},
3602 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3605 { "ftp:test.com/index.html", 0, S_OK, FALSE,
3606 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
3607 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME, FALSE,
3611 {"ftp:test.com/index.html",S_OK,FALSE},
3613 {".html",S_OK,FALSE},
3617 {"test.com/index.html",S_OK,FALSE},
3618 {"test.com/index.html",S_OK,FALSE},
3620 {"ftp:test.com/index.html",S_OK,FALSE},
3626 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3628 {URL_SCHEME_FTP,S_OK,FALSE},
3629 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3632 { "file://C|/test.mp3", 0, S_OK, FALSE,
3633 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
3634 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3637 {"file:///C:/test.mp3",S_OK,FALSE},
3639 {"file:///C:/test.mp3",S_OK,FALSE},
3641 {".mp3",S_OK,FALSE},
3645 {"/C:/test.mp3",S_OK,FALSE},
3646 {"/C:/test.mp3",S_OK,FALSE},
3648 {"file://C|/test.mp3",S_OK,FALSE},
3649 {"file",S_OK,FALSE},
3654 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3656 {URL_SCHEME_FILE,S_OK,FALSE},
3657 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3660 { "file:///C|/test.mp3", 0, S_OK, FALSE,
3661 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
3662 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
3665 {"file:///C:/test.mp3",S_OK,FALSE},
3667 {"file:///C:/test.mp3",S_OK,FALSE},
3669 {".mp3",S_OK,FALSE},
3673 {"/C:/test.mp3",S_OK,FALSE},
3674 {"/C:/test.mp3",S_OK,FALSE},
3676 {"file:///C|/test.mp3",S_OK,FALSE},
3677 {"file",S_OK,FALSE},
3682 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3684 {URL_SCHEME_FILE,S_OK,FALSE},
3685 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3688 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3691 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3692 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3693 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3694 |Uri_HAS_SCHEME, FALSE,
3696 {"file://c:\\dir\\index.html",S_OK,FALSE},
3698 {"file://c:\\dir\\index.html",S_OK,FALSE},
3700 {".html",S_OK,FALSE},
3704 {"c:\\dir\\index.html",S_OK,FALSE},
3705 {"c:\\dir\\index.html",S_OK,FALSE},
3707 {"file://c:/dir/index.html",S_OK,FALSE},
3708 {"file",S_OK,FALSE},
3715 {URL_SCHEME_FILE,S_OK,FALSE},
3716 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3719 /* Extra '/' after "file://" is removed. */
3720 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3721 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3722 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3723 |Uri_HAS_SCHEME, FALSE,
3725 {"file://c:\\dir\\index.html",S_OK,FALSE},
3727 {"file://c:\\dir\\index.html",S_OK,FALSE},
3729 {".html",S_OK,FALSE},
3733 {"c:\\dir\\index.html",S_OK,FALSE},
3734 {"c:\\dir\\index.html",S_OK,FALSE},
3736 {"file:///c:/dir/index.html",S_OK,FALSE},
3737 {"file",S_OK,FALSE},
3744 {URL_SCHEME_FILE,S_OK,FALSE},
3745 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3748 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3749 { "file:///c:/dir\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3750 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3751 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3752 |Uri_HAS_SCHEME, FALSE,
3754 {"file://c:\\dir\%a _name\\file*.html",S_OK,FALSE},
3756 {"file://c:\\dir\%a _name\\file*.html",S_OK,FALSE},
3758 {".html",S_OK,FALSE},
3762 {"c:\\dir\%a _name\\file*.html",S_OK,FALSE},
3763 {"c:\\dir\%a _name\\file*.html",S_OK,FALSE},
3765 {"file:///c:/dir\%%61%20%5Fname/file%2A.html",S_OK,FALSE},
3766 {"file",S_OK,FALSE},
3773 {URL_SCHEME_FILE,S_OK,FALSE},
3774 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3777 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3778 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3779 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3780 |Uri_HAS_SCHEME, FALSE,
3782 {"file://c:\\dir\\index.html",S_OK,FALSE},
3784 {"file://c:\\dir\\index.html",S_OK,FALSE},
3786 {".html",S_OK,FALSE},
3790 {"c:\\dir\\index.html",S_OK,FALSE},
3791 {"c:\\dir\\index.html",S_OK,FALSE},
3793 {"file://c|/dir\\index.html",S_OK,FALSE},
3794 {"file",S_OK,FALSE},
3801 {URL_SCHEME_FILE,S_OK,FALSE},
3802 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3805 /* The backslashes after the scheme name are converted to forward slashes. */
3806 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3807 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3808 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3809 |Uri_HAS_SCHEME, FALSE,
3811 {"file://c:\\dir\\index.html",S_OK,FALSE},
3813 {"file://c:\\dir\\index.html",S_OK,FALSE},
3815 {".html",S_OK,FALSE},
3819 {"c:\\dir\\index.html",S_OK,FALSE},
3820 {"c:\\dir\\index.html",S_OK,FALSE},
3822 {"file:\\\\c:\\dir\\index.html",S_OK,FALSE},
3823 {"file",S_OK,FALSE},
3830 {URL_SCHEME_FILE,S_OK,FALSE},
3831 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3834 { "file:\\\\c:/dir/index.html", 0, S_OK, FALSE,
3835 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3836 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3837 |Uri_HAS_SCHEME, FALSE,
3839 {"file:///c:/dir/index.html",S_OK,FALSE},
3841 {"file:///c:/dir/index.html",S_OK,FALSE},
3843 {".html",S_OK,FALSE},
3847 {"/c:/dir/index.html",S_OK,FALSE},
3848 {"/c:/dir/index.html",S_OK,FALSE},
3850 {"file:\\\\c:/dir/index.html",S_OK,FALSE},
3851 {"file",S_OK,FALSE},
3858 {URL_SCHEME_FILE,S_OK,FALSE},
3859 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3862 { "http:\\\\google.com", 0, S_OK, FALSE,
3863 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
3864 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
3865 Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
3868 {"http://google.com/",S_OK,FALSE},
3869 {"google.com",S_OK,FALSE},
3870 {"http://google.com/",S_OK,FALSE},
3871 {"google.com",S_OK,FALSE},
3874 {"google.com",S_OK,FALSE},
3879 {"http:\\\\google.com",S_OK,FALSE},
3880 {"http",S_OK,FALSE},
3885 {Uri_HOST_DNS,S_OK,FALSE},
3887 {URL_SCHEME_HTTP,S_OK,FALSE},
3888 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3891 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3892 { "zip:\\\\google.com", 0, S_OK, FALSE,
3893 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|
3894 Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_SCHEME|
3898 {"zip:\\\\google.com",S_OK,FALSE},
3900 {"zip:\\\\google.com",S_OK,FALSE},
3902 {".com",S_OK,FALSE},
3906 {"\\\\google.com",S_OK,FALSE},
3907 {"\\\\google.com",S_OK,FALSE},
3909 {"zip:\\\\google.com",S_OK,FALSE},
3915 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3917 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3918 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3921 /* Dot segments aren't removed. */
3922 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3923 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3924 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3925 |Uri_HAS_SCHEME, FALSE,
3927 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3929 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3931 {".html",S_OK,FALSE},
3935 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3936 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3938 {"file://c:\\dir\\../..\\./index.html",S_OK,FALSE},
3939 {"file",S_OK,FALSE},
3946 {URL_SCHEME_FILE,S_OK,FALSE},
3947 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3950 /* Forbidden characters aren't percent encoded. */
3951 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3952 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH
3953 |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE
3954 |Uri_HAS_SCHEME, FALSE,
3956 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3958 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3960 {".html",S_OK,FALSE},
3964 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3965 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3967 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3968 {"file",S_OK,FALSE},
3975 {URL_SCHEME_FILE,S_OK,FALSE},
3976 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3979 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3980 { "file:c:\\dir\\../..\\index.html", 0, S_OK, FALSE,
3981 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
3982 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE,
3986 {"file:c:/dir/../../index.html",S_OK,FALSE},
3988 {".html",S_OK,FALSE},
3992 {"c:/dir/../../index.html",S_OK,FALSE},
3993 {"c:/dir/../../index.html",S_OK,FALSE},
3995 {"file:c:\\dir\\../..\\index.html",S_OK,FALSE},
3996 {"file",S_OK,FALSE},
4003 {URL_SCHEME_FILE,S_OK,FALSE},
4004 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4007 /* '/' are still converted to '\' even though it's an opaque URI. */
4008 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
4009 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
4010 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE,
4014 {"file:c:\\dir\\..\\..\\index.html",S_OK,FALSE},
4016 {".html",S_OK,FALSE},
4020 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
4021 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
4023 {"file:c:/dir\\../..\\index.html",S_OK,FALSE},
4024 {"file",S_OK,FALSE},
4031 {URL_SCHEME_FILE,S_OK,FALSE},
4032 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4035 /* Forbidden characters aren't percent encoded. */
4036 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
4037 Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY
4038 |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE,
4042 {"file:c:\\in^|dex.html",S_OK,FALSE},
4044 {".html",S_OK,FALSE},
4048 {"c:\\in^|dex.html",S_OK,FALSE},
4049 {"c:\\in^|dex.html",S_OK,FALSE},
4051 {"file:c:\\in^|dex.html",S_OK,FALSE},
4052 {"file",S_OK,FALSE},
4059 {URL_SCHEME_FILE,S_OK,FALSE},
4060 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4063 /* Doesn't have a UserName since the ':' appears at the beginning of the
4066 { "http://:password@gov.uk", 0, S_OK, FALSE,
4067 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
4068 Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
4069 Uri_HAS_USER_INFO|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
4072 {"http://:password@gov.uk/",S_OK,FALSE},
4073 {":password@gov.uk",S_OK,FALSE},
4074 {"http://gov.uk/",S_OK,FALSE},
4078 {"gov.uk",S_OK,FALSE},
4079 {"password",S_OK,FALSE},
4083 {"http://:password@gov.uk",S_OK,FALSE},
4084 {"http",S_OK,FALSE},
4085 {":password",S_OK,FALSE},
4089 {Uri_HOST_DNS,S_OK,FALSE},
4091 {URL_SCHEME_HTTP,S_OK,FALSE},
4092 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4095 /* Has a UserName since the userinfo section doesn't contain a password. */
4096 { "http://@gov.uk", 0, S_OK, FALSE,
4097 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
4098 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
4099 Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
4102 {"http://gov.uk/",S_OK,FALSE,"http://@gov.uk/"},
4103 {"@gov.uk",S_OK,FALSE},
4104 {"http://gov.uk/",S_OK,FALSE},
4108 {"gov.uk",S_OK,FALSE},
4113 {"http://@gov.uk",S_OK,FALSE},
4114 {"http",S_OK,FALSE},
4119 {Uri_HOST_DNS,S_OK,FALSE},
4121 {URL_SCHEME_HTTP,S_OK,FALSE},
4122 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4125 /* ":@" not included in the absolute URI. */
4126 { "http://:@gov.uk", 0, S_OK, FALSE,
4127 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
4128 Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
4129 Uri_HAS_USER_INFO|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
4132 {"http://gov.uk/",S_OK,FALSE,"http://:@gov.uk/"},
4133 {":@gov.uk",S_OK,FALSE},
4134 {"http://gov.uk/",S_OK,FALSE},
4138 {"gov.uk",S_OK,FALSE},
4143 {"http://:@gov.uk",S_OK,FALSE},
4144 {"http",S_OK,FALSE},
4149 {Uri_HOST_DNS,S_OK,FALSE},
4151 {URL_SCHEME_HTTP,S_OK,FALSE},
4152 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4155 /* '@' is included because it's an unknown scheme type. */
4156 { "zip://@gov.uk", 0, S_OK, FALSE,
4157 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
4158 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
4159 Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
4162 {"zip://@gov.uk/",S_OK,FALSE},
4163 {"@gov.uk",S_OK,FALSE},
4164 {"zip://@gov.uk/",S_OK,FALSE},
4168 {"gov.uk",S_OK,FALSE},
4173 {"zip://@gov.uk",S_OK,FALSE},
4179 {Uri_HOST_DNS,S_OK,FALSE},
4181 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
4182 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4185 /* ":@" are included because it's an unknown scheme type. */
4186 { "zip://:@gov.uk", 0, S_OK, FALSE,
4187 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
4188 Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
4189 Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
4192 {"zip://:@gov.uk/",S_OK,FALSE},
4193 {":@gov.uk",S_OK,FALSE},
4194 {"zip://:@gov.uk/",S_OK,FALSE},
4198 {"gov.uk",S_OK,FALSE},
4203 {"zip://:@gov.uk",S_OK,FALSE},
4209 {Uri_HOST_DNS,S_OK,FALSE},
4211 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
4212 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4215 { "about:blank", 0, S_OK, FALSE,
4216 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
4217 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
4220 {"about:blank",S_OK,FALSE},
4222 {"about:blank",S_OK,FALSE},
4228 {"blank",S_OK,FALSE},
4229 {"blank",S_OK,FALSE},
4231 {"about:blank",S_OK,FALSE},
4232 {"about",S_OK,FALSE},
4239 {URL_SCHEME_ABOUT,S_OK,FALSE},
4240 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4243 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK,FALSE,
4244 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
4245 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
4248 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4250 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4252 {".htm",S_OK,FALSE},
4256 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4257 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4259 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
4265 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4267 {URL_SCHEME_MK,S_OK,FALSE},
4268 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4271 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK,FALSE,
4272 Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|
4273 Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
4276 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4278 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4280 {".htm",S_OK,FALSE},
4284 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4285 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4287 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
4293 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4295 {URL_SCHEME_MK,S_OK,FALSE},
4296 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4299 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
4300 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
4301 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_HOST|
4302 Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|
4303 Uri_HAS_SCHEME, FALSE,
4305 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
4306 {"server",S_OK,FALSE},
4307 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
4309 {".html",S_OK,FALSE},
4311 {"server",S_OK,FALSE},
4313 {"\\dir\\index.html",S_OK,FALSE},
4314 {"\\dir\\index.html",S_OK,FALSE},
4316 {"file://server/dir/index.html",S_OK,FALSE},
4317 {"file",S_OK,FALSE},
4322 {Uri_HOST_DNS,S_OK,FALSE},
4324 {URL_SCHEME_FILE,S_OK,FALSE},
4325 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4328 /* When CreateUri generates an IUri, it still displays the default port in the
4331 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
4332 Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
4333 Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
4334 Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
4337 {"http://google.com:80/",S_OK,FALSE},
4338 {"google.com:80",S_OK,FALSE},
4339 {"http://google.com:80/",S_OK,FALSE},
4340 {"google.com",S_OK,FALSE},
4343 {"google.com",S_OK,FALSE},
4348 {"http://google.com:80/",S_OK,FALSE},
4349 {"http",S_OK,FALSE},
4354 {Uri_HOST_DNS,S_OK,FALSE},
4356 {URL_SCHEME_HTTP,S_OK,FALSE},
4357 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4362 typedef struct _invalid_uri {
4368 static const invalid_uri invalid_uri_tests[] = {
4369 /* Has to have a scheme name. */
4370 {"://www.winehq.org",0,FALSE},
4371 /* Window's doesn't like URI's which are implicitly file paths without the
4372 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4374 {"C:/test/test.mp3",0,FALSE},
4375 {"\\\\Server/test/test.mp3",0,FALSE},
4376 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME,FALSE},
4377 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE,FALSE},
4378 /* Invalid schemes. */
4379 {"*abcd://not.valid.com",0,FALSE},
4380 {"*a*b*c*d://not.valid.com",0,FALSE},
4381 /* Not allowed to have invalid % encoded data. */
4382 {"ftp://google.co%XX/",0,FALSE},
4383 /* To many h16 components. */
4384 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE},
4385 /* Not enough room for IPv4 address. */
4386 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE},
4387 /* Not enough h16 components. */
4388 {"http://[1:2:3:4]",0,FALSE},
4389 /* Not enough components including IPv4. */
4390 {"http://[1:192.0.1.0]",0,FALSE},
4391 /* Not allowed to have partial IPv4 in IPv6. */
4392 {"http://[::192.0]",0,FALSE},
4393 /* Can't have elision of 1 h16 at beginning of address. */
4394 {"http://[::2:3:4:5:6:7:8]",0,FALSE},
4395 /* Can't have elision of 1 h16 at end of address. */
4396 {"http://[1:2:3:4:5:6:7::]",0,FALSE},
4397 /* Expects a valid IP Literal. */
4398 {"ftp://[not.valid.uri]/",0,FALSE},
4399 /* Expects valid port for a known scheme type. */
4400 {"ftp://www.winehq.org:123fgh",0,FALSE},
4401 /* Port exceeds USHORT_MAX for known scheme type. */
4402 {"ftp://www.winehq.org:65536",0,FALSE},
4403 /* Invalid port with IPv4 address. */
4404 {"http://www.winehq.org:1abcd",0,FALSE},
4405 /* Invalid port with IPv6 address. */
4406 {"http://[::ffff]:32xy",0,FALSE},
4407 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4408 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE},
4409 /* Not allowed to have invalid % encoded data in opaque URI path. */
4410 {"news:test%XX",0,FALSE},
4411 {"mailto:wine@winehq%G8.com",0,FALSE},
4412 /* Known scheme types can't have invalid % encoded data in query string. */
4413 {"http://google.com/?query=te%xx",0,FALSE},
4414 /* Invalid % encoded data in fragment of know scheme type. */
4415 {"ftp://google.com/#Test%xx",0,FALSE},
4416 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
4417 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
4418 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4419 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4420 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4421 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4422 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4423 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}
4426 typedef struct _uri_equality {
4428 DWORD create_flags_a;
4431 DWORD create_flags_b;
4437 static const uri_equality equality_tests[] = {
4439 "HTTP://www.winehq.org/test dir/./",0,FALSE,
4440 "http://www.winehq.org/test dir/../test dir/",0,FALSE,
4444 /* http://www.winehq.org/test%20dir */
4445 "http://%77%77%77%2E%77%69%6E%65%68%71%2E%6F%72%67/%74%65%73%74%20%64%69%72",0,FALSE,
4446 "http://www.winehq.org/test dir",0,FALSE,
4450 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,FALSE,
4451 "file:///c:/test.mp3",0,FALSE,
4455 "ftp://ftp.winehq.org/",0,FALSE,
4456 "ftp://ftp.winehq.org",0,FALSE,
4460 "ftp://ftp.winehq.org/test/test2/../../testB/",0,FALSE,
4461 "ftp://ftp.winehq.org/t%45stB/",0,FALSE,
4465 "http://google.com/TEST",0,FALSE,
4466 "http://google.com/test",0,FALSE,
4470 "http://GOOGLE.com/",0,FALSE,
4471 "http://google.com/",0,FALSE,
4474 /* Performs case insensitive compare of host names (for known scheme types). */
4476 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE,FALSE,
4477 "ftp://google.com/",0,FALSE,
4481 "zip://GOOGLE.com/",0,FALSE,
4482 "zip://google.com/",0,FALSE,
4486 "file:///c:/TEST/TeST/",0,FALSE,
4487 "file:///c:/test/test/",0,FALSE,
4491 "file:///server/TEST",0,FALSE,
4492 "file:///SERVER/TEST",0,FALSE,
4496 "http://google.com",Uri_CREATE_NO_CANONICALIZE,FALSE,
4497 "http://google.com/",0,FALSE,
4501 "ftp://google.com:21/",0,FALSE,
4502 "ftp://google.com/",0,FALSE,
4506 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE,FALSE,
4507 "http://google.com/",0,FALSE,
4511 "http://google.com:70/",0,FALSE,
4512 "http://google.com:71/",0,FALSE,
4517 typedef struct _uri_with_fragment {
4519 const char* fragment;
4521 HRESULT create_expected;
4524 const char* expected_uri;
4526 } uri_with_fragment;
4528 static const uri_with_fragment uri_fragment_tests[] = {
4530 "http://google.com/","#fragment",0,S_OK,FALSE,
4531 "http://google.com/#fragment",FALSE
4534 "http://google.com/","fragment",0,S_OK,FALSE,
4535 "http://google.com/#fragment",FALSE
4538 "zip://test.com/","?test",0,S_OK,FALSE,
4539 "zip://test.com/#?test",FALSE
4541 /* The fragment can be empty. */
4543 "ftp://ftp.google.com/","",0,S_OK,FALSE,
4544 "ftp://ftp.google.com/#",FALSE
4548 typedef struct _uri_builder_property {
4551 const char *expected_value;
4552 Uri_PROPERTY property;
4555 } uri_builder_property;
4557 typedef struct _uri_builder_port {
4565 typedef struct _uri_builder_str_property {
4566 const char* expected;
4569 } uri_builder_str_property;
4571 typedef struct _uri_builder_dword_property {
4575 } uri_builder_dword_property;
4577 typedef struct _uri_builder_test {
4580 HRESULT create_builder_expected;
4581 BOOL create_builder_todo;
4583 uri_builder_property properties[URI_BUILDER_STR_PROPERTY_COUNT];
4585 uri_builder_port port_prop;
4591 DWORD uri_simple_encode_flags;
4592 HRESULT uri_simple_hres;
4593 BOOL uri_simple_todo;
4595 DWORD uri_with_flags;
4596 DWORD uri_with_builder_flags;
4597 DWORD uri_with_encode_flags;
4598 HRESULT uri_with_hres;
4601 uri_builder_str_property expected_str_props[URI_STR_PROPERTY_COUNT];
4602 uri_builder_dword_property expected_dword_props[URI_DWORD_PROPERTY_COUNT];
4605 static const uri_builder_test uri_builder_tests[] = {
4606 { "http://google.com/",0,S_OK,FALSE,
4608 {TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
4609 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE},
4610 {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE},
4611 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
4618 {"http://username:password@google.com/?query=x#fragment",S_OK},
4619 {"username:password@google.com",S_OK},
4620 {"http://google.com/?query=x#fragment",S_OK},
4621 {"google.com",S_OK},
4624 {"google.com",S_OK},
4629 {"http://username:password@google.com/?query=x#fragment",S_OK},
4631 {"username:password",S_OK},
4635 {Uri_HOST_DNS,S_OK},
4637 {URL_SCHEME_HTTP,S_OK},
4638 {URLZONE_INVALID,E_NOTIMPL}
4641 { "http://google.com/",0,S_OK,FALSE,
4643 {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
4645 {TRUE,TRUE,120,S_OK,FALSE},
4650 {"test://google.com:120/",S_OK},
4651 {"google.com:120",S_OK},
4652 {"test://google.com:120/",S_OK},
4653 {"google.com",S_OK},
4656 {"google.com",S_OK},
4661 {"test://google.com:120/",S_OK},
4667 {Uri_HOST_DNS,S_OK},
4669 {URL_SCHEME_UNKNOWN,S_OK},
4670 {URLZONE_INVALID,E_NOTIMPL}
4673 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4675 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
4676 {TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
4677 {TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
4684 {"http://[::192.2.3.4]/",S_OK},
4685 {"[::192.2.3.4]",S_OK},
4686 {"http://[::192.2.3.4]/",S_OK},
4690 {"::192.2.3.4",S_OK},
4695 {"http://[::192.2.3.4]/",S_OK},
4701 {Uri_HOST_IPV6,S_OK},
4703 {URL_SCHEME_HTTP,S_OK},
4704 {URLZONE_INVALID,E_NOTIMPL}
4707 { "http://google.com/",0,S_OK,FALSE,
4709 {TRUE,"Frag","#Frag",Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
4716 {"http://google.com/#Frag",S_OK},
4717 {"google.com",S_OK},
4718 {"http://google.com/#Frag",S_OK},
4719 {"google.com",S_OK},
4722 {"google.com",S_OK},
4727 {"http://google.com/#Frag",S_OK},
4733 {Uri_HOST_DNS,S_OK},
4735 {URL_SCHEME_HTTP,S_OK},
4736 {URLZONE_INVALID,E_NOTIMPL}
4739 { "http://google.com/",0,S_OK,FALSE,
4741 {TRUE,"","#",Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
4748 {"http://google.com/#",S_OK},
4749 {"google.com",S_OK},
4750 {"http://google.com/#",S_OK},
4751 {"google.com",S_OK},
4754 {"google.com",S_OK},
4759 {"http://google.com/#",S_OK},
4765 {Uri_HOST_DNS,S_OK},
4767 {URL_SCHEME_HTTP,S_OK},
4768 {URLZONE_INVALID,E_NOTIMPL}
4771 { "http://google.com/",0,S_OK,FALSE,
4773 {TRUE,":password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
4780 {"http://::password@google.com/",S_OK},
4781 {"::password@google.com",S_OK},
4782 {"http://google.com/",S_OK},
4783 {"google.com",S_OK},
4786 {"google.com",S_OK},
4791 {"http://::password@google.com/",S_OK},
4793 {"::password",S_OK},
4797 {Uri_HOST_DNS,S_OK},
4799 {URL_SCHEME_HTTP,S_OK},
4800 {URLZONE_INVALID,E_NOTIMPL}
4803 { "test/test",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4805 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
4808 Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4810 Uri_CREATE_ALLOW_RELATIVE,0,0,S_OK,FALSE,
4812 {":password@test/test",S_OK},
4813 {":password@",S_OK},
4814 {":password@test/test",S_OK},
4823 {":password@test/test",S_OK},
4829 {Uri_HOST_UNKNOWN,S_OK},
4831 {URL_SCHEME_UNKNOWN,S_OK},
4832 {URLZONE_INVALID,E_NOTIMPL}
4835 { "http://google.com/",0,S_OK,FALSE,
4837 {TRUE,"test/test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
4844 {"http://google.com/test/test",S_OK},
4845 {"google.com",S_OK},
4846 {"http://google.com/test/test",S_OK},
4847 {"google.com",S_OK},
4850 {"google.com",S_OK},
4852 {"/test/test",S_OK},
4853 {"/test/test",S_OK},
4855 {"http://google.com/test/test",S_OK},
4861 {Uri_HOST_DNS,S_OK},
4863 {URL_SCHEME_HTTP,S_OK},
4864 {URLZONE_INVALID,E_NOTIMPL}
4867 { "zip:testing/test",0,S_OK,FALSE,
4869 {TRUE,"test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
4893 {Uri_HOST_UNKNOWN,S_OK},
4895 {URL_SCHEME_UNKNOWN,S_OK},
4896 {URLZONE_INVALID,E_NOTIMPL}
4899 { "http://google.com/",0,S_OK,FALSE,
4903 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
4904 {TRUE,FALSE,555,S_OK,FALSE},
4909 {"http://google.com/",S_OK},
4910 {"google.com",S_OK},
4911 {"http://google.com/",S_OK},
4912 {"google.com",S_OK},
4915 {"google.com",S_OK},
4920 {"http://google.com/",S_OK},
4926 {Uri_HOST_DNS,S_OK},
4927 /* Still returns 80, even though earlier the port was disabled. */
4929 {URL_SCHEME_HTTP,S_OK},
4930 {URLZONE_INVALID,E_NOTIMPL}
4933 { "http://google.com/",0,S_OK,FALSE,
4937 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
4938 * you'll get 122345 instead.
4940 {TRUE,122345,222,S_OK,FALSE},
4945 {"http://google.com:222/",S_OK},
4946 {"google.com:222",S_OK},
4947 {"http://google.com:222/",S_OK},
4948 {"google.com",S_OK},
4951 {"google.com",S_OK},
4956 {"http://google.com:222/",S_OK},
4962 {Uri_HOST_DNS,S_OK},
4964 {URL_SCHEME_HTTP,S_OK},
4965 {URLZONE_INVALID,E_NOTIMPL}
4968 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
4969 { "http://google.com/",0,S_OK,FALSE,
4973 {TRUE,TRUE,999999,S_OK,FALSE},
4978 {"http://google.com:999999/",S_OK},
4979 {"google.com:999999",S_OK},
4980 {"http://google.com:999999/",S_OK},
4981 {"google.com",S_OK},
4984 {"google.com",S_OK},
4989 {"http://google.com:999999/",S_OK},
4995 {Uri_HOST_DNS,S_OK},
4997 {URL_SCHEME_HTTP,S_OK},
4998 {URLZONE_INVALID,E_NOTIMPL}
5001 { "http://google.com/",0,S_OK,FALSE,
5003 {TRUE,"test","?test",Uri_PROPERTY_QUERY,S_OK,FALSE},
5011 {"http://google.com/?test",S_OK},
5012 {"google.com",S_OK},
5013 {"http://google.com/?test",S_OK},
5014 {"google.com",S_OK},
5017 {"google.com",S_OK},
5022 {"http://google.com/?test",S_OK},
5028 {Uri_HOST_DNS,S_OK},
5030 {URL_SCHEME_HTTP,S_OK},
5031 {URLZONE_INVALID,E_NOTIMPL}
5034 { "http://:password@google.com/",0,S_OK,FALSE,
5043 {"http://:password@google.com/",S_OK},
5044 {":password@google.com",S_OK},
5045 {"http://google.com/",S_OK},
5046 {"google.com",S_OK},
5049 {"google.com",S_OK},
5054 {"http://:password@google.com/",S_OK},
5060 {Uri_HOST_DNS,S_OK},
5062 {URL_SCHEME_HTTP,S_OK},
5063 {URLZONE_INVALID,E_NOTIMPL}
5066 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5067 { NULL,0,S_OK,FALSE,
5069 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
5070 {TRUE,"google.com",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5077 {"http://google.com/",S_OK},
5078 {"google.com",S_OK},
5079 {"http://google.com/",S_OK},
5080 {"google.com",S_OK},
5083 {"google.com",S_OK},
5088 {"http://google.com/",S_OK},
5094 {Uri_HOST_DNS,S_OK},
5096 {URL_SCHEME_HTTP,S_OK},
5097 {URLZONE_INVALID,E_NOTIMPL}
5100 /* Can't set the scheme name to NULL. */
5101 { "zip://google.com/",0,S_OK,FALSE,
5103 {TRUE,NULL,"zip",Uri_PROPERTY_SCHEME_NAME,E_INVALIDARG,FALSE}
5110 {"zip://google.com/",S_OK},
5111 {"google.com",S_OK},
5112 {"zip://google.com/",S_OK},
5113 {"google.com",S_OK},
5116 {"google.com",S_OK},
5121 {"zip://google.com/",S_OK},
5127 {Uri_HOST_DNS,S_OK},
5129 {URL_SCHEME_UNKNOWN,S_OK},
5130 {URLZONE_INVALID,E_NOTIMPL}
5133 /* Can't set the scheme name to an empty string. */
5134 { "zip://google.com/",0,S_OK,FALSE,
5136 {TRUE,"","zip",Uri_PROPERTY_SCHEME_NAME,E_INVALIDARG,FALSE}
5143 {"zip://google.com/",S_OK},
5144 {"google.com",S_OK},
5145 {"zip://google.com/",S_OK},
5146 {"google.com",S_OK},
5149 {"google.com",S_OK},
5154 {"zip://google.com/",S_OK},
5160 {Uri_HOST_DNS,S_OK},
5162 {URL_SCHEME_UNKNOWN,S_OK},
5163 {URLZONE_INVALID,E_NOTIMPL}
5166 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5167 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5169 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE,S_OK,FALSE,
5174 0,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5176 {"http://google.com/../../",S_OK},
5177 {"google.com",S_OK},
5178 {"http://google.com/../../",S_OK},
5179 {"google.com",S_OK},
5182 {"google.com",S_OK},
5187 {"http://google.com/../../",S_OK},
5193 {Uri_HOST_DNS,S_OK},
5195 {URL_SCHEME_HTTP,S_OK},
5196 {URLZONE_INVALID,E_NOTIMPL}
5199 { "http://google.com/",0,S_OK,FALSE,
5201 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5206 Uri_CREATE_NO_DECODE_EXTRA_INFO,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5208 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5209 {"google.com",S_OK},
5210 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5211 {"google.com",S_OK},
5213 {"#Fr%3C%7C%3Eg",S_OK},
5214 {"google.com",S_OK},
5219 {"http://google.com/#Fr<|>g",S_OK},
5225 {Uri_HOST_DNS,S_OK},
5227 {URL_SCHEME_HTTP,S_OK},
5228 {URLZONE_INVALID,E_NOTIMPL}
5231 { "http://google.com/",0,S_OK,FALSE,
5233 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5236 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,E_INVALIDARG,FALSE,
5238 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5240 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5241 {"google.com",S_OK},
5242 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5243 {"google.com",S_OK},
5245 {"#Fr%3C%7C%3Eg",S_OK},
5246 {"google.com",S_OK},
5251 {"http://google.com/#Fr<|>g",S_OK},
5257 {Uri_HOST_DNS,S_OK},
5259 {URL_SCHEME_HTTP,S_OK},
5260 {URLZONE_INVALID,E_NOTIMPL}
5263 { NULL,0,S_OK,FALSE,
5265 {TRUE,"/test/test/",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
5266 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5269 0,INET_E_INVALID_URL,FALSE,
5270 0,INET_E_INVALID_URL,FALSE,
5271 0,0,0,INET_E_INVALID_URL,FALSE
5273 { "http://google.com/",0,S_OK,FALSE,
5275 {TRUE,"ht%xxtp",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
5278 0,INET_E_INVALID_URL,FALSE,
5279 0,INET_E_INVALID_URL,FALSE,
5280 0,0,0,INET_E_INVALID_URL,FALSE
5282 /* File scheme's can't have a username set. */
5283 { "file://google.com/",0,S_OK,FALSE,
5285 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5288 0,INET_E_INVALID_URL,FALSE,
5289 0,INET_E_INVALID_URL,FALSE,
5290 0,0,0,INET_E_INVALID_URL,FALSE
5292 /* File schemes can't have a password set. */
5293 { "file://google.com/",0,S_OK,FALSE,
5295 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5298 0,INET_E_INVALID_URL,FALSE,
5299 0,INET_E_INVALID_URL,FALSE,
5300 0,0,0,INET_E_INVALID_URL,FALSE
5302 /* UserName can't contain any character that is a delimeter for another
5303 * component that appears after it in a normal URI.
5305 { "http://google.com/",0,S_OK,FALSE,
5307 {TRUE,"user:pass",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5310 0,INET_E_INVALID_URL,FALSE,
5311 0,INET_E_INVALID_URL,FALSE,
5312 0,0,0,INET_E_INVALID_URL,FALSE
5314 { "http://google.com/",0,S_OK,FALSE,
5316 {TRUE,"user@google.com",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5319 0,INET_E_INVALID_URL,FALSE,
5320 0,INET_E_INVALID_URL,FALSE,
5321 0,0,0,INET_E_INVALID_URL,FALSE
5323 { "http://google.com/",0,S_OK,FALSE,
5325 {TRUE,"user/path",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5328 0,INET_E_INVALID_URL,FALSE,
5329 0,INET_E_INVALID_URL,FALSE,
5330 0,0,0,INET_E_INVALID_URL,FALSE
5332 { "http://google.com/",0,S_OK,FALSE,
5334 {TRUE,"user?Query",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5337 0,INET_E_INVALID_URL,FALSE,
5338 0,INET_E_INVALID_URL,FALSE,
5339 0,0,0,INET_E_INVALID_URL,FALSE
5341 { "http://google.com/",0,S_OK,FALSE,
5343 {TRUE,"user#Frag",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5346 0,INET_E_INVALID_URL,FALSE,
5347 0,INET_E_INVALID_URL,FALSE,
5348 0,0,0,INET_E_INVALID_URL,FALSE
5350 { "http://google.com/",0,S_OK,FALSE,
5352 {TRUE,"pass@google.com",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5355 0,INET_E_INVALID_URL,FALSE,
5356 0,INET_E_INVALID_URL,FALSE,
5357 0,0,0,INET_E_INVALID_URL,FALSE
5359 { "http://google.com/",0,S_OK,FALSE,
5361 {TRUE,"pass/path",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5364 0,INET_E_INVALID_URL,FALSE,
5365 0,INET_E_INVALID_URL,FALSE,
5366 0,0,0,INET_E_INVALID_URL,FALSE
5368 { "http://google.com/",0,S_OK,FALSE,
5370 {TRUE,"pass?query",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5373 0,INET_E_INVALID_URL,FALSE,
5374 0,INET_E_INVALID_URL,FALSE,
5375 0,0,0,INET_E_INVALID_URL,FALSE
5377 { "http://google.com/",0,S_OK,FALSE,
5379 {TRUE,"pass#frag",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5382 0,INET_E_INVALID_URL,FALSE,
5383 0,INET_E_INVALID_URL,FALSE,
5384 0,0,0,INET_E_INVALID_URL,FALSE
5386 { "http://google.com/",0,S_OK,FALSE,
5388 {TRUE,"winehq.org/test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5391 0,INET_E_INVALID_URL,FALSE,
5392 0,INET_E_INVALID_URL,FALSE,
5393 0,0,0,INET_E_INVALID_URL,FALSE
5395 { "http://google.com/",0,S_OK,FALSE,
5397 {TRUE,"winehq.org?test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5400 0,INET_E_INVALID_URL,FALSE,
5401 0,INET_E_INVALID_URL,FALSE,
5402 0,0,0,INET_E_INVALID_URL,FALSE
5404 { "http://google.com/",0,S_OK,FALSE,
5406 {TRUE,"winehq.org#test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5409 0,INET_E_INVALID_URL,FALSE,
5410 0,INET_E_INVALID_URL,FALSE,
5411 0,0,0,INET_E_INVALID_URL,FALSE
5413 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5414 { "http://google.com/",0,S_OK,FALSE,
5416 {TRUE,"winehq.org:test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
5423 {"http://winehq.org:test/",S_OK},
5424 {"winehq.org:test",S_OK},
5425 {"http://winehq.org:test/",S_OK},
5426 {"winehq.org:test",S_OK},
5429 {"winehq.org:test",S_OK},
5434 {"http://winehq.org:test/",S_OK},
5440 {Uri_HOST_DNS,S_OK},
5442 {URL_SCHEME_HTTP,S_OK},
5443 {URLZONE_INVALID,E_NOTIMPL}
5446 /* Can't set the host name to NULL. */
5447 { "http://google.com/",0,S_OK,FALSE,
5449 {TRUE,NULL,"google.com",Uri_PROPERTY_HOST,E_INVALIDARG,FALSE}
5456 {"http://google.com/",S_OK},
5457 {"google.com",S_OK},
5458 {"http://google.com/",S_OK},
5459 {"google.com",S_OK},
5462 {"google.com",S_OK},
5467 {"http://google.com/",S_OK},
5473 {Uri_HOST_DNS,S_OK},
5475 {URL_SCHEME_HTTP,S_OK},
5476 {URLZONE_INVALID,E_NOTIMPL}
5479 /* Can set the host name to an empty string. */
5480 { "http://google.com/",0,S_OK,FALSE,
5482 {TRUE,"",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5506 {Uri_HOST_UNKNOWN,S_OK},
5508 {URL_SCHEME_HTTP,S_OK},
5509 {URLZONE_INVALID,E_NOTIMPL}
5512 { "http://google.com/",0,S_OK,FALSE,
5514 {TRUE,"/path?query",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
5517 0,INET_E_INVALID_URL,FALSE,
5518 0,INET_E_INVALID_URL,FALSE,
5519 0,0,0,INET_E_INVALID_URL,FALSE
5521 { "http://google.com/",0,S_OK,FALSE,
5523 {TRUE,"/path#test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
5526 0,INET_E_INVALID_URL,FALSE,
5527 0,INET_E_INVALID_URL,FALSE,
5528 0,0,0,INET_E_INVALID_URL,FALSE
5530 { "http://google.com/",0,S_OK,FALSE,
5532 {TRUE,"?path#test",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE}
5535 0,INET_E_INVALID_URL,FALSE,
5536 0,INET_E_INVALID_URL,FALSE,
5537 0,0,0,INET_E_INVALID_URL,FALSE
5541 typedef struct _uri_builder_remove_test {
5544 HRESULT create_builder_expected;
5545 BOOL create_builder_todo;
5547 DWORD remove_properties;
5548 HRESULT remove_expected;
5551 const char *expected_uri;
5552 DWORD expected_flags;
5553 HRESULT expected_hres;
5555 } uri_builder_remove_test;
5557 static const uri_builder_remove_test uri_builder_remove_tests[] = {
5558 { "http://google.com/test?test=y#Frag",0,S_OK,FALSE,
5559 Uri_HAS_FRAGMENT|Uri_HAS_PATH|Uri_HAS_QUERY,S_OK,FALSE,
5560 "http://google.com/",0,S_OK,FALSE
5562 { "http://user:pass@winehq.org/",0,S_OK,FALSE,
5563 Uri_HAS_USER_NAME|Uri_HAS_PASSWORD,S_OK,FALSE,
5564 "http://winehq.org/",0,S_OK,FALSE
5566 { "zip://google.com?Test=x",0,S_OK,FALSE,
5567 Uri_HAS_HOST,S_OK,FALSE,
5568 "zip:/?Test=x",0,S_OK,FALSE
5570 /* Doesn't remove the whole userinfo component. */
5571 { "http://username:pass@google.com/",0,S_OK,FALSE,
5572 Uri_HAS_USER_INFO,S_OK,FALSE,
5573 "http://username:pass@google.com/",0,S_OK,FALSE
5575 /* Doesn't remove the domain. */
5576 { "http://google.com/",0,S_OK,FALSE,
5577 Uri_HAS_DOMAIN,S_OK,FALSE,
5578 "http://google.com/",0,S_OK,FALSE
5580 { "http://google.com:120/",0,S_OK,FALSE,
5581 Uri_HAS_AUTHORITY,S_OK,FALSE,
5582 "http://google.com:120/",0,S_OK,FALSE
5584 { "http://google.com/test.com/",0,S_OK,FALSE,
5585 Uri_HAS_EXTENSION,S_OK,FALSE,
5586 "http://google.com/test.com/",0,S_OK,FALSE
5588 { "http://google.com/?test=x",0,S_OK,FALSE,
5589 Uri_HAS_PATH_AND_QUERY,S_OK,FALSE,
5590 "http://google.com/?test=x",0,S_OK,FALSE
5592 /* Can't remove the scheme name. */
5593 { "http://google.com/?test=x",0,S_OK,FALSE,
5594 Uri_HAS_SCHEME_NAME|Uri_HAS_QUERY,E_INVALIDARG,FALSE,
5595 "http://google.com/?test=x",0,S_OK,FALSE
5599 typedef struct _uri_combine_test {
5600 const char *base_uri;
5601 DWORD base_create_flags;
5602 const char *relative_uri;
5603 DWORD relative_create_flags;
5604 DWORD combine_flags;
5608 uri_str_property str_props[URI_STR_PROPERTY_COUNT];
5609 uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT];
5612 static const uri_combine_test uri_combine_tests[] = {
5613 { "http://google.com/fun/stuff",0,
5614 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE,
5617 {"http://google.com/not/fun/stuff",S_OK},
5618 {"google.com",S_OK},
5619 {"http://google.com/not/fun/stuff",S_OK},
5620 {"google.com",S_OK},
5623 {"google.com",S_OK},
5625 {"/not/fun/stuff",S_OK},
5626 {"/not/fun/stuff",S_OK},
5628 {"http://google.com/not/fun/stuff",S_OK},
5634 {Uri_HOST_DNS,S_OK},
5636 {URL_SCHEME_HTTP,S_OK},
5637 {URLZONE_INVALID,E_NOTIMPL}
5640 { "http://google.com/test",0,
5641 "zip://test.com/cool",0,
5644 {"zip://test.com/cool",S_OK},
5646 {"zip://test.com/cool",S_OK},
5655 {"zip://test.com/cool",S_OK},
5661 {Uri_HOST_DNS,S_OK},
5663 {URL_SCHEME_UNKNOWN,S_OK},
5664 {URLZONE_INVALID,E_NOTIMPL}
5667 { "http://google.com/use/base/path",0,
5668 "?relative",Uri_CREATE_ALLOW_RELATIVE,
5671 {"http://google.com/use/base/path?relative",S_OK},
5672 {"google.com",S_OK},
5673 {"http://google.com/use/base/path?relative",S_OK},
5674 {"google.com",S_OK},
5677 {"google.com",S_OK},
5679 {"/use/base/path",S_OK},
5680 {"/use/base/path?relative",S_OK},
5682 {"http://google.com/use/base/path?relative",S_OK},
5688 {Uri_HOST_DNS,S_OK},
5690 {URL_SCHEME_HTTP,S_OK},
5691 {URLZONE_INVALID,E_NOTIMPL}
5694 { "http://google.com/path",0,
5695 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
5698 {"http://google.com/testing",S_OK},
5699 {"google.com",S_OK},
5700 {"http://google.com/testing",S_OK},
5701 {"google.com",S_OK},
5704 {"google.com",S_OK},
5709 {"http://google.com/testing",S_OK},
5715 {Uri_HOST_DNS,S_OK},
5717 {URL_SCHEME_HTTP,S_OK},
5718 {URLZONE_INVALID,E_NOTIMPL}
5721 { "http://google.com/path",0,
5722 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
5723 URL_DONT_SIMPLIFY,S_OK,TRUE,
5725 {"http://google.com:80/test/../test/.././testing",S_OK},
5726 {"google.com",S_OK},
5727 {"http://google.com:80/test/../test/.././testing",S_OK},
5728 {"google.com",S_OK},
5731 {"google.com",S_OK},
5733 {"/test/../test/.././testing",S_OK},
5734 {"/test/../test/.././testing",S_OK},
5736 {"http://google.com:80/test/../test/.././testing",S_OK},
5742 {Uri_HOST_DNS,S_OK},
5744 {URL_SCHEME_HTTP,S_OK},
5745 {URLZONE_INVALID,E_NOTIMPL}
5748 { "http://winehq.org/test/abc",0,
5749 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
5752 {"http://winehq.org/test/testing/test",S_OK},
5753 {"winehq.org",S_OK},
5754 {"http://winehq.org/test/testing/test",S_OK},
5755 {"winehq.org",S_OK},
5758 {"winehq.org",S_OK},
5760 {"/test/testing/test",S_OK},
5761 {"/test/testing/test",S_OK},
5763 {"http://winehq.org/test/testing/test",S_OK},
5769 {Uri_HOST_DNS,S_OK},
5771 {URL_SCHEME_HTTP,S_OK},
5772 {URLZONE_INVALID,E_NOTIMPL}
5775 { "http://winehq.org/test/abc",0,
5776 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
5777 URL_DONT_SIMPLIFY,S_OK,TRUE,
5779 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5780 /* Default port is hidden in the authority. */
5781 {"winehq.org",S_OK},
5782 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5783 {"winehq.org",S_OK},
5786 {"winehq.org",S_OK},
5788 {"/test/testing/abc/../test",S_OK},
5789 {"/test/testing/abc/../test",S_OK},
5791 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5797 {Uri_HOST_DNS,S_OK},
5799 {URL_SCHEME_HTTP,S_OK},
5800 {URLZONE_INVALID,E_NOTIMPL}
5803 { "http://winehq.org/test?query",0,
5804 "testing",Uri_CREATE_ALLOW_RELATIVE,
5807 {"http://winehq.org/testing",S_OK},
5808 {"winehq.org",S_OK},
5809 {"http://winehq.org/testing",S_OK},
5810 {"winehq.org",S_OK},
5813 {"winehq.org",S_OK},
5818 {"http://winehq.org/testing",S_OK},
5824 {Uri_HOST_DNS,S_OK},
5826 {URL_SCHEME_HTTP,S_OK},
5827 {URLZONE_INVALID,E_NOTIMPL}
5830 { "http://winehq.org/test#frag",0,
5831 "testing",Uri_CREATE_ALLOW_RELATIVE,
5834 {"http://winehq.org/testing",S_OK},
5835 {"winehq.org",S_OK},
5836 {"http://winehq.org/testing",S_OK},
5837 {"winehq.org",S_OK},
5840 {"winehq.org",S_OK},
5845 {"http://winehq.org/testing",S_OK},
5851 {Uri_HOST_DNS,S_OK},
5853 {URL_SCHEME_HTTP,S_OK},
5854 {URLZONE_INVALID,E_NOTIMPL}
5857 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE,
5858 "test",Uri_CREATE_ALLOW_RELATIVE,
5878 {Uri_HOST_UNKNOWN,S_OK},
5880 {URL_SCHEME_UNKNOWN,S_OK},
5881 {URLZONE_INVALID,E_NOTIMPL}
5884 { "file:///c:/test/test",0,
5885 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5886 URL_FILE_USE_PATHURL,S_OK,TRUE,
5888 {"file://c:\\testing.mp3",S_OK},
5890 {"file://c:\\testing.mp3",S_OK},
5896 {"c:\\testing.mp3",S_OK},
5897 {"c:\\testing.mp3",S_OK},
5899 {"file://c:\\testing.mp3",S_OK},
5905 {Uri_HOST_UNKNOWN,S_OK},
5907 {URL_SCHEME_FILE,S_OK},
5908 {URLZONE_INVALID,E_NOTIMPL}
5911 { "file:///c:/test/test",0,
5912 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5915 {"file:///c:/testing.mp3",S_OK},
5917 {"file:///c:/testing.mp3",S_OK},
5923 {"/c:/testing.mp3",S_OK},
5924 {"/c:/testing.mp3",S_OK},
5926 {"file:///c:/testing.mp3",S_OK},
5932 {Uri_HOST_UNKNOWN,S_OK},
5934 {URL_SCHEME_FILE,S_OK},
5935 {URLZONE_INVALID,E_NOTIMPL}
5938 { "file://test.com/test/test",0,
5939 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5940 URL_FILE_USE_PATHURL,S_OK,TRUE,
5942 {"file://\\\\test.com\\testing.mp3",S_OK},
5944 {"file://\\\\test.com\\testing.mp3",S_OK},
5950 {"\\testing.mp3",S_OK},
5951 {"\\testing.mp3",S_OK},
5953 {"file://\\\\test.com\\testing.mp3",S_OK},
5959 {Uri_HOST_DNS,S_OK},
5961 {URL_SCHEME_FILE,S_OK},
5962 {URLZONE_INVALID,E_NOTIMPL}
5965 /* URL_DONT_SIMPLIFY has no effect. */
5966 { "http://google.com/test",0,
5967 "zip://test.com/cool/../cool/test",0,
5968 URL_DONT_SIMPLIFY,S_OK,FALSE,
5970 {"zip://test.com/cool/test",S_OK},
5972 {"zip://test.com/cool/test",S_OK},
5978 {"/cool/test",S_OK},
5979 {"/cool/test",S_OK},
5981 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
5982 * On IE 7 it reduces the path in the Raw URI.
5984 {"zip://test.com/cool/../cool/test",S_OK,FALSE,"zip://test.com/cool/test"},
5990 {Uri_HOST_DNS,S_OK},
5992 {URL_SCHEME_UNKNOWN,S_OK},
5993 {URLZONE_INVALID,E_NOTIMPL}
5996 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
5997 * resulting URI is converted into a dos path.
5999 { "http://google.com/test",0,
6000 "file:///c:/test/",0,
6001 URL_FILE_USE_PATHURL,S_OK,FALSE,
6003 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
6005 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
6011 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
6012 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
6014 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
6020 {Uri_HOST_UNKNOWN,S_OK},
6022 {URL_SCHEME_FILE,S_OK},
6023 {URLZONE_INVALID,E_NOTIMPL}
6026 { "http://google.com/test",0,
6027 "http://test.com/test#%30test",0,
6028 URL_DONT_UNESCAPE_EXTRA_INFO,S_OK,FALSE,
6030 {"http://test.com/test#0test",S_OK},
6032 {"http://test.com/test#0test",S_OK},
6041 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6042 {"http://test.com/test#%30test",S_OK,FALSE,"http://test.com/test#0test"},
6048 {Uri_HOST_DNS,S_OK},
6050 {URL_SCHEME_HTTP,S_OK},
6051 {URLZONE_INVALID,E_NOTIMPL}
6054 /* Windows validates the path component from the relative Uri. */
6055 { "http://google.com/test",0,
6056 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE,
6059 /* Windows doesn't validate the query from the relative Uri. */
6060 { "http://google.com/test",0,
6061 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
6064 {"http://google.com/test?Tes%XXt",S_OK},
6065 {"google.com",S_OK},
6066 {"http://google.com/test?Tes%XXt",S_OK},
6067 {"google.com",S_OK},
6070 {"google.com",S_OK},
6073 {"/test?Tes%XXt",S_OK},
6075 {"http://google.com/test?Tes%XXt",S_OK},
6081 {Uri_HOST_DNS,S_OK},
6083 {URL_SCHEME_HTTP,S_OK},
6084 {URLZONE_INVALID,E_NOTIMPL}
6087 /* Windows doesn't validate the fragment from the relative Uri. */
6088 { "http://google.com/test",0,
6089 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
6092 {"http://google.com/test#Tes%XXt",S_OK},
6093 {"google.com",S_OK},
6094 {"http://google.com/test#Tes%XXt",S_OK},
6095 {"google.com",S_OK},
6098 {"google.com",S_OK},
6103 {"http://google.com/test#Tes%XXt",S_OK},
6109 {Uri_HOST_DNS,S_OK},
6111 {URL_SCHEME_HTTP,S_OK},
6112 {URLZONE_INVALID,E_NOTIMPL}
6115 /* Creates an IUri which contains an invalid dos path char. */
6116 { "file:///c:/test",0,
6117 "/test<ing",Uri_CREATE_ALLOW_RELATIVE,
6118 URL_FILE_USE_PATHURL,S_OK,TRUE,
6120 {"file://c:\\test<ing",S_OK},
6122 {"file://c:\\test<ing",S_OK},
6128 {"c:\\test<ing",S_OK},
6129 {"c:\\test<ing",S_OK},
6131 {"file://c:\\test<ing",S_OK},
6137 {Uri_HOST_UNKNOWN,S_OK},
6139 {URL_SCHEME_FILE,S_OK},
6140 {URLZONE_INVALID,E_NOTIMPL}
6143 /* Appends the path after the drive letter (if any). */
6144 { "file:///c:/test",0,
6145 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE,
6148 {"file:///c:/c:/testing",S_OK},
6150 {"file:///c:/c:/testing",S_OK},
6156 {"/c:/c:/testing",S_OK},
6157 {"/c:/c:/testing",S_OK},
6159 {"file:///c:/c:/testing",S_OK},
6165 {Uri_HOST_UNKNOWN,S_OK},
6167 {URL_SCHEME_FILE,S_OK},
6168 {URLZONE_INVALID,E_NOTIMPL}
6171 /* A '/' is added if the base URI doesn't have a path and the
6172 * relative URI doesn't contain a path (since the base URI is
6175 { "http://google.com",Uri_CREATE_NO_CANONICALIZE,
6176 "?test",Uri_CREATE_ALLOW_RELATIVE,
6179 {"http://google.com/?test",S_OK},
6180 {"google.com",S_OK},
6181 {"http://google.com/?test",S_OK},
6182 {"google.com",S_OK},
6185 {"google.com",S_OK},
6190 {"http://google.com/?test",S_OK},
6196 {Uri_HOST_DNS,S_OK},
6198 {URL_SCHEME_HTTP,S_OK},
6199 {URLZONE_INVALID,E_NOTIMPL}
6202 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE,
6203 "?test",Uri_CREATE_ALLOW_RELATIVE,
6206 {"zip://google.com/?test",S_OK},
6207 {"google.com",S_OK},
6208 {"zip://google.com/?test",S_OK},
6209 {"google.com",S_OK},
6212 {"google.com",S_OK},
6217 {"zip://google.com/?test",S_OK},
6223 {Uri_HOST_DNS,S_OK},
6225 {URL_SCHEME_UNKNOWN,S_OK},
6226 {URLZONE_INVALID,E_NOTIMPL}
6229 /* No path is appended since the base URI is opaque. */
6231 "?test",Uri_CREATE_ALLOW_RELATIVE,
6251 {Uri_HOST_UNKNOWN,S_OK},
6253 {URL_SCHEME_UNKNOWN,S_OK},
6254 {URLZONE_INVALID,E_NOTIMPL}
6259 static inline LPWSTR a2w(LPCSTR str) {
6263 DWORD len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
6264 ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
6265 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
6271 static inline BOOL heap_free(void* mem) {
6272 return HeapFree(GetProcessHeap(), 0, mem);
6275 static inline DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB) {
6276 LPWSTR strAW = a2w(strA);
6277 DWORD ret = lstrcmpW(strAW, strB);
6282 static inline ULONG get_refcnt(IUri *uri) {
6284 return IUri_Release(uri);
6287 static void change_property(IUriBuilder *builder, const uri_builder_property *prop,
6292 valueW = a2w(prop->value);
6293 switch(prop->property) {
6294 case Uri_PROPERTY_FRAGMENT:
6295 hr = IUriBuilder_SetFragment(builder, valueW);
6298 ok(hr == prop->expected,
6299 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6300 hr, prop->expected, test_index);
6303 ok(hr == prop->expected,
6304 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6305 hr, prop->expected, test_index);
6308 case Uri_PROPERTY_HOST:
6309 hr = IUriBuilder_SetHost(builder, valueW);
6312 ok(hr == prop->expected,
6313 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6314 hr, prop->expected, test_index);
6317 ok(hr == prop->expected,
6318 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6319 hr, prop->expected, test_index);
6322 case Uri_PROPERTY_PASSWORD:
6323 hr = IUriBuilder_SetPassword(builder, valueW);
6326 ok(hr == prop->expected,
6327 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6328 hr, prop->expected, test_index);
6331 ok(hr == prop->expected,
6332 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6333 hr, prop->expected, test_index);
6336 case Uri_PROPERTY_PATH:
6337 hr = IUriBuilder_SetPath(builder, valueW);
6340 ok(hr == prop->expected,
6341 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6342 hr, prop->expected, test_index);
6345 ok(hr == prop->expected,
6346 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6347 hr, prop->expected, test_index);
6350 case Uri_PROPERTY_QUERY:
6351 hr = IUriBuilder_SetQuery(builder, valueW);
6354 ok(hr == prop->expected,
6355 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6356 hr, prop->expected, test_index);
6359 ok(hr == prop->expected,
6360 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6361 hr, prop->expected, test_index);
6364 case Uri_PROPERTY_SCHEME_NAME:
6365 hr = IUriBuilder_SetSchemeName(builder, valueW);
6368 ok(hr == prop->expected,
6369 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6370 hr, prop->expected, test_index);
6373 ok(hr == prop->expected,
6374 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6375 hr, prop->expected, test_index);
6378 case Uri_PROPERTY_USER_NAME:
6379 hr = IUriBuilder_SetUserName(builder, valueW);
6382 ok(hr == prop->expected,
6383 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6384 hr, prop->expected, test_index);
6387 ok(hr == prop->expected,
6388 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6389 hr, prop->expected, test_index);
6393 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop->property, test_index);
6400 * Simple tests to make sure the CreateUri function handles invalid flag combinations
6403 static void test_CreateUri_InvalidFlags(void) {
6406 for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
6408 IUri *uri = (void*) 0xdeadbeef;
6410 hr = pCreateUri(http_urlW, invalid_flag_tests[i].flags, 0, &uri);
6411 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
6412 hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
6413 ok(uri == NULL, "Error: expected the IUri to be NULL, but it was %p instead\n", uri);
6417 static void test_CreateUri_InvalidArgs(void) {
6419 IUri *uri = (void*) 0xdeadbeef;
6421 const WCHAR invalidW[] = {'i','n','v','a','l','i','d',0};
6422 static const WCHAR emptyW[] = {0};
6424 hr = pCreateUri(http_urlW, 0, 0, NULL);
6425 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
6427 hr = pCreateUri(NULL, 0, 0, &uri);
6428 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
6429 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6431 uri = (void*) 0xdeadbeef;
6432 hr = pCreateUri(invalidW, 0, 0, &uri);
6433 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6434 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6436 uri = (void*) 0xdeadbeef;
6437 hr = pCreateUri(emptyW, 0, 0, &uri);
6438 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6439 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6442 static void test_CreateUri_InvalidUri(void) {
6445 for(i = 0; i < sizeof(invalid_uri_tests)/sizeof(invalid_uri_tests[0]); ++i) {
6446 invalid_uri test = invalid_uri_tests[i];
6451 uriW = a2w(test.uri);
6452 hr = pCreateUri(uriW, test.flags, 0, &uri);
6455 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6456 hr, E_INVALIDARG, i);
6459 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6460 hr, E_INVALIDARG, i);
6462 if(uri) IUri_Release(uri);
6468 static void test_IUri_GetPropertyBSTR(void) {
6473 /* Make sure GetPropertyBSTR handles invalid args correctly. */
6474 hr = pCreateUri(http_urlW, 0, 0, &uri);
6475 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6477 BSTR received = NULL;
6479 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_RAW_URI, NULL, 0);
6480 ok(hr == E_POINTER, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6482 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
6483 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_PORT, &received, 0);
6484 ok(hr == S_OK, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6485 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
6486 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
6487 SysFreeString(received);
6489 /* Make sure it handles the ZONE property correctly. */
6491 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_ZONE, &received, 0);
6492 ok(hr == S_FALSE, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, S_FALSE);
6493 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
6494 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
6495 SysFreeString(received);
6497 if(uri) IUri_Release(uri);
6499 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6500 uri_properties test = uri_tests[i];
6504 uriW = a2w(test.uri);
6505 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6506 if(test.create_todo) {
6508 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6509 hr, test.create_expected, i);
6512 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6513 hr, test.create_expected, i);
6519 /* Checks all the string properties of the uri. */
6520 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
6521 BSTR received = NULL;
6522 uri_str_property prop = test.str_props[j];
6524 hr = IUri_GetPropertyBSTR(uri, j, &received, 0);
6527 ok(hr == prop.expected, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6528 hr, prop.expected, i, j);
6531 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6532 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6533 prop.value, wine_dbgstr_w(received), i, j);
6536 ok(hr == prop.expected, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6537 hr, prop.expected, i, j);
6538 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6539 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6540 prop.value, wine_dbgstr_w(received), i, j);
6543 SysFreeString(received);
6547 if(uri) IUri_Release(uri);
6553 static void test_IUri_GetPropertyDWORD(void) {
6558 hr = pCreateUri(http_urlW, 0, 0, &uri);
6559 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6561 DWORD received = 0xdeadbeef;
6563 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_DWORD_START, NULL, 0);
6564 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6566 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_ABSOLUTE_URI, &received, 0);
6567 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6568 ok(received == 0, "Error: Expected received=%d but instead received=%d.\n", 0, received);
6570 if(uri) IUri_Release(uri);
6572 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6573 uri_properties test = uri_tests[i];
6577 uriW = a2w(test.uri);
6578 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6579 if(test.create_todo) {
6581 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6582 hr, test.create_expected, i);
6585 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6586 hr, test.create_expected, i);
6592 /* Checks all the DWORD properties of the uri. */
6593 for(j = 0; j < sizeof(test.dword_props)/sizeof(test.dword_props[0]); ++j) {
6595 uri_dword_property prop = test.dword_props[j];
6597 hr = IUri_GetPropertyDWORD(uri, j+Uri_PROPERTY_DWORD_START, &received, 0);
6600 ok(hr == prop.expected, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6601 hr, prop.expected, i, j);
6604 ok(prop.value == received, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6605 prop.value, received, i, j);
6608 ok(hr == prop.expected, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6609 hr, prop.expected, i, j);
6610 ok(prop.value == received, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6611 prop.value, received, i, j);
6616 if(uri) IUri_Release(uri);
6622 /* Tests all the 'Get*' property functions which deal with strings. */
6623 static void test_IUri_GetStrProperties(void) {
6628 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
6629 hr = pCreateUri(http_urlW, 0, 0, &uri);
6630 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6632 hr = IUri_GetAbsoluteUri(uri, NULL);
6633 ok(hr == E_POINTER, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6635 hr = IUri_GetAuthority(uri, NULL);
6636 ok(hr == E_POINTER, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6638 hr = IUri_GetDisplayUri(uri, NULL);
6639 ok(hr == E_POINTER, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6641 hr = IUri_GetDomain(uri, NULL);
6642 ok(hr == E_POINTER, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6644 hr = IUri_GetExtension(uri, NULL);
6645 ok(hr == E_POINTER, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6647 hr = IUri_GetFragment(uri, NULL);
6648 ok(hr == E_POINTER, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6650 hr = IUri_GetHost(uri, NULL);
6651 ok(hr == E_POINTER, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6653 hr = IUri_GetPassword(uri, NULL);
6654 ok(hr == E_POINTER, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6656 hr = IUri_GetPath(uri, NULL);
6657 ok(hr == E_POINTER, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6659 hr = IUri_GetPathAndQuery(uri, NULL);
6660 ok(hr == E_POINTER, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6662 hr = IUri_GetQuery(uri, NULL);
6663 ok(hr == E_POINTER, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6665 hr = IUri_GetRawUri(uri, NULL);
6666 ok(hr == E_POINTER, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6668 hr = IUri_GetSchemeName(uri, NULL);
6669 ok(hr == E_POINTER, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6671 hr = IUri_GetUserInfo(uri, NULL);
6672 ok(hr == E_POINTER, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6674 hr = IUri_GetUserName(uri, NULL);
6675 ok(hr == E_POINTER, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6677 if(uri) IUri_Release(uri);
6679 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6680 uri_properties test = uri_tests[i];
6684 uriW = a2w(test.uri);
6685 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6686 if(test.create_todo) {
6688 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6689 hr, test.create_expected, i);
6692 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6693 hr, test.create_expected, i);
6697 uri_str_property prop;
6698 BSTR received = NULL;
6700 /* GetAbsoluteUri() tests. */
6701 prop = test.str_props[Uri_PROPERTY_ABSOLUTE_URI];
6702 hr = IUri_GetAbsoluteUri(uri, &received);
6705 ok(hr == prop.expected, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6706 hr, prop.expected, i);
6709 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6710 "Error: Expected %s but got %s on uri_tests[%d].\n",
6711 prop.value, wine_dbgstr_w(received), i);
6714 ok(hr == prop.expected, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6715 hr, prop.expected, i);
6716 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6717 "Error: Expected %s but got %s on uri_tests[%d].\n",
6718 prop.value, wine_dbgstr_w(received), i);
6720 SysFreeString(received);
6723 /* GetAuthority() tests. */
6724 prop = test.str_props[Uri_PROPERTY_AUTHORITY];
6725 hr = IUri_GetAuthority(uri, &received);
6728 ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6729 hr, prop.expected, i);
6732 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6733 prop.value, wine_dbgstr_w(received), i);
6736 ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6737 hr, prop.expected, i);
6738 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6739 prop.value, wine_dbgstr_w(received), i);
6741 SysFreeString(received);
6744 /* GetDisplayUri() tests. */
6745 prop = test.str_props[Uri_PROPERTY_DISPLAY_URI];
6746 hr = IUri_GetDisplayUri(uri, &received);
6749 ok(hr == prop.expected, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6750 hr, prop.expected, i);
6753 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6754 "Error: Expected %s but got %s on uri_test[%d].\n",
6755 prop.value, wine_dbgstr_w(received), i);
6758 ok(hr == prop.expected, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6759 hr, prop.expected, i);
6760 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6761 "Error: Expected %s but got %s on uri_tests[%d].\n",
6762 prop.value, wine_dbgstr_w(received), i);
6764 SysFreeString(received);
6767 /* GetDomain() tests. */
6768 prop = test.str_props[Uri_PROPERTY_DOMAIN];
6769 hr = IUri_GetDomain(uri, &received);
6772 ok(hr == prop.expected, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6773 hr, prop.expected, i);
6776 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6777 prop.value, wine_dbgstr_w(received), i);
6780 ok(hr == prop.expected, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6781 hr, prop.expected, i);
6782 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6783 prop.value, wine_dbgstr_w(received), i);
6785 SysFreeString(received);
6788 /* GetExtension() tests. */
6789 prop = test.str_props[Uri_PROPERTY_EXTENSION];
6790 hr = IUri_GetExtension(uri, &received);
6793 ok(hr == prop.expected, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6794 hr, prop.expected, i);
6797 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6798 prop.value, wine_dbgstr_w(received), i);
6801 ok(hr == prop.expected, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6802 hr, prop.expected, i);
6803 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6804 prop.value, wine_dbgstr_w(received), i);
6806 SysFreeString(received);
6809 /* GetFragment() tests. */
6810 prop = test.str_props[Uri_PROPERTY_FRAGMENT];
6811 hr = IUri_GetFragment(uri, &received);
6814 ok(hr == prop.expected, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6815 hr, prop.expected, i);
6818 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6819 prop.value, wine_dbgstr_w(received), i);
6822 ok(hr == prop.expected, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6823 hr, prop.expected, i);
6824 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6825 prop.value, wine_dbgstr_w(received), i);
6827 SysFreeString(received);
6830 /* GetHost() tests. */
6831 prop = test.str_props[Uri_PROPERTY_HOST];
6832 hr = IUri_GetHost(uri, &received);
6835 ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6836 hr, prop.expected, i);
6839 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6840 prop.value, wine_dbgstr_w(received), i);
6843 ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6844 hr, prop.expected, i);
6845 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6846 prop.value, wine_dbgstr_w(received), i);
6848 SysFreeString(received);
6851 /* GetPassword() tests. */
6852 prop = test.str_props[Uri_PROPERTY_PASSWORD];
6853 hr = IUri_GetPassword(uri, &received);
6856 ok(hr == prop.expected, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6857 hr, prop.expected, i);
6860 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6861 prop.value, wine_dbgstr_w(received), i);
6864 ok(hr == prop.expected, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6865 hr, prop.expected, i);
6866 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6867 prop.value, wine_dbgstr_w(received), i);
6869 SysFreeString(received);
6872 /* GetPath() tests. */
6873 prop = test.str_props[Uri_PROPERTY_PATH];
6874 hr = IUri_GetPath(uri, &received);
6877 ok(hr == prop.expected, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6878 hr, prop.expected, i);
6881 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6882 prop.value, wine_dbgstr_w(received), i);
6885 ok(hr == prop.expected, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6886 hr, prop.expected, i);
6887 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6888 prop.value, wine_dbgstr_w(received), i);
6890 SysFreeString(received);
6893 /* GetPathAndQuery() tests. */
6894 prop = test.str_props[Uri_PROPERTY_PATH_AND_QUERY];
6895 hr = IUri_GetPathAndQuery(uri, &received);
6898 ok(hr == prop.expected, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6899 hr, prop.expected, i);
6902 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6903 prop.value, wine_dbgstr_w(received), i);
6906 ok(hr == prop.expected, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6907 hr, prop.expected, i);
6908 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6909 prop.value, wine_dbgstr_w(received), i);
6911 SysFreeString(received);
6914 /* GetQuery() tests. */
6915 prop = test.str_props[Uri_PROPERTY_QUERY];
6916 hr = IUri_GetQuery(uri, &received);
6919 ok(hr == prop.expected, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6920 hr, prop.expected, i);
6923 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6924 prop.value, wine_dbgstr_w(received), i);
6927 ok(hr == prop.expected, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6928 hr, prop.expected, i);
6929 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6930 prop.value, wine_dbgstr_w(received), i);
6932 SysFreeString(received);
6935 /* GetRawUri() tests. */
6936 prop = test.str_props[Uri_PROPERTY_RAW_URI];
6937 hr = IUri_GetRawUri(uri, &received);
6940 ok(hr == prop.expected, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6941 hr, prop.expected, i);
6944 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6945 prop.value, wine_dbgstr_w(received), i);
6948 ok(hr == prop.expected, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6949 hr, prop.expected, i);
6950 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6951 prop.value, wine_dbgstr_w(received), i);
6953 SysFreeString(received);
6956 /* GetSchemeName() tests. */
6957 prop = test.str_props[Uri_PROPERTY_SCHEME_NAME];
6958 hr = IUri_GetSchemeName(uri, &received);
6961 ok(hr == prop.expected, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6962 hr, prop.expected, i);
6965 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6966 prop.value, wine_dbgstr_w(received), i);
6969 ok(hr == prop.expected, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6970 hr, prop.expected, i);
6971 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6972 prop.value, wine_dbgstr_w(received), i);
6974 SysFreeString(received);
6977 /* GetUserInfo() tests. */
6978 prop = test.str_props[Uri_PROPERTY_USER_INFO];
6979 hr = IUri_GetUserInfo(uri, &received);
6982 ok(hr == prop.expected, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6983 hr, prop.expected, i);
6986 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6987 prop.value, wine_dbgstr_w(received), i);
6990 ok(hr == prop.expected, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6991 hr, prop.expected, i);
6992 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6993 prop.value, wine_dbgstr_w(received), i);
6995 SysFreeString(received);
6998 /* GetUserName() tests. */
6999 prop = test.str_props[Uri_PROPERTY_USER_NAME];
7000 hr = IUri_GetUserName(uri, &received);
7003 ok(hr == prop.expected, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7004 hr, prop.expected, i);
7007 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7008 prop.value, wine_dbgstr_w(received), i);
7011 ok(hr == prop.expected, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7012 hr, prop.expected, i);
7013 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7014 prop.value, wine_dbgstr_w(received), i);
7016 SysFreeString(received);
7019 if(uri) IUri_Release(uri);
7025 static void test_IUri_GetDwordProperties(void) {
7030 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
7031 hr = pCreateUri(http_urlW, 0, 0, &uri);
7032 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7034 hr = IUri_GetHostType(uri, NULL);
7035 ok(hr == E_INVALIDARG, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7037 hr = IUri_GetPort(uri, NULL);
7038 ok(hr == E_INVALIDARG, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7040 hr = IUri_GetScheme(uri, NULL);
7041 ok(hr == E_INVALIDARG, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7043 hr = IUri_GetZone(uri, NULL);
7044 ok(hr == E_INVALIDARG, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7046 if(uri) IUri_Release(uri);
7048 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7049 uri_properties test = uri_tests[i];
7053 uriW = a2w(test.uri);
7054 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7055 if(test.create_todo) {
7057 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7058 hr, test.create_expected, i);
7061 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7062 hr, test.create_expected, i);
7066 uri_dword_property prop;
7069 /* Assign an insane value so tests don't accidentally pass when
7072 received = -9999999;
7074 /* GetHostType() tests. */
7075 prop = test.dword_props[Uri_PROPERTY_HOST_TYPE-Uri_PROPERTY_DWORD_START];
7076 hr = IUri_GetHostType(uri, &received);
7079 ok(hr == prop.expected, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7080 hr, prop.expected, i);
7083 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7086 ok(hr == prop.expected, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7087 hr, prop.expected, i);
7088 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7090 received = -9999999;
7092 /* GetPort() tests. */
7093 prop = test.dword_props[Uri_PROPERTY_PORT-Uri_PROPERTY_DWORD_START];
7094 hr = IUri_GetPort(uri, &received);
7097 ok(hr == prop.expected, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7098 hr, prop.expected, i);
7101 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7104 ok(hr == prop.expected, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7105 hr, prop.expected, i);
7106 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7108 received = -9999999;
7110 /* GetScheme() tests. */
7111 prop = test.dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START];
7112 hr = IUri_GetScheme(uri, &received);
7115 ok(hr == prop.expected, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7116 hr, prop.expected, i);
7119 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7122 ok(hr == prop.expected, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7123 hr, prop.expected, i);
7124 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7126 received = -9999999;
7128 /* GetZone() tests. */
7129 prop = test.dword_props[Uri_PROPERTY_ZONE-Uri_PROPERTY_DWORD_START];
7130 hr = IUri_GetZone(uri, &received);
7133 ok(hr == prop.expected, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7134 hr, prop.expected, i);
7137 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7140 ok(hr == prop.expected, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7141 hr, prop.expected, i);
7142 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7146 if(uri) IUri_Release(uri);
7152 static void test_IUri_GetPropertyLength(void) {
7157 /* Make sure it handles invalid args correctly. */
7158 hr = pCreateUri(http_urlW, 0, 0, &uri);
7159 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7161 DWORD received = 0xdeadbeef;
7163 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_STRING_START, NULL, 0);
7164 ok(hr == E_INVALIDARG, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7166 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_DWORD_START, &received, 0);
7167 ok(hr == E_INVALIDARG, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7168 ok(received == 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received);
7170 if(uri) IUri_Release(uri);
7172 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7173 uri_properties test = uri_tests[i];
7177 uriW = a2w(test.uri);
7178 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7179 if(test.create_todo) {
7181 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7182 hr, test.create_expected, i);
7185 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
7186 hr, test.create_expected, i);
7192 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
7193 DWORD expectedLen, brokenLen, receivedLen;
7194 uri_str_property prop = test.str_props[j];
7196 expectedLen = lstrlen(prop.value);
7197 brokenLen = lstrlen(prop.broken_value);
7199 /* This won't be necessary once GetPropertyLength is implemented. */
7202 hr = IUri_GetPropertyLength(uri, j, &receivedLen, 0);
7205 ok(hr == prop.expected, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7206 hr, prop.expected, i, j);
7209 ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
7210 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7211 expectedLen, receivedLen, i, j);
7214 ok(hr == prop.expected, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7215 hr, prop.expected, i, j);
7216 ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
7217 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7218 expectedLen, receivedLen, i, j);
7223 if(uri) IUri_Release(uri);
7229 static void test_IUri_GetProperties(void) {
7234 hr = pCreateUri(http_urlW, 0, 0, &uri);
7235 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7237 hr = IUri_GetProperties(uri, NULL);
7238 ok(hr == E_INVALIDARG, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7240 if(uri) IUri_Release(uri);
7242 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7243 uri_properties test = uri_tests[i];
7247 uriW = a2w(test.uri);
7248 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7249 if(test.create_todo) {
7251 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7254 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7261 hr = IUri_GetProperties(uri, &received);
7262 if(test.props_todo) {
7264 ok(hr == S_OK, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7267 ok(hr == S_OK, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7270 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
7271 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
7272 if(test.props & (1 << j)) {
7273 if(test.props_todo) {
7275 ok(received & (1 << j), "Error: Expected flag for property %d on uri_tests[%d].\n", j, i);
7278 ok(received & (1 << j), "Error: Expected flag for property %d on uri_tests[%d].\n", j, i);
7281 /* NOTE: Since received is initialized to 0, this test will always pass while
7282 * GetProperties is unimplemented.
7284 ok(!(received & (1 << j)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j, i);
7289 if(uri) IUri_Release(uri);
7295 static void test_IUri_HasProperty(void) {
7300 hr = pCreateUri(http_urlW, 0, 0, &uri);
7301 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7303 hr = IUri_HasProperty(uri, Uri_PROPERTY_RAW_URI, NULL);
7304 ok(hr == E_INVALIDARG, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7306 if(uri) IUri_Release(uri);
7308 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7309 uri_properties test = uri_tests[i];
7313 uriW = a2w(test.uri);
7315 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7316 if(test.create_todo) {
7318 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7321 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7327 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
7328 /* Assign -1, then explicitly test for TRUE or FALSE later. */
7331 hr = IUri_HasProperty(uri, j, &received);
7332 if(test.props_todo) {
7334 ok(hr == S_OK, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
7338 /* Check if the property should be true. */
7339 if(test.props & (1 << j)) {
7341 ok(received == TRUE, "Error: Expected to have property %d on uri_tests[%d].\n", j, i);
7345 ok(received == FALSE, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j, i);
7349 ok(hr == S_OK, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
7352 if(test.props & (1 << j)) {
7353 ok(received == TRUE, "Error: Expected to have property %d on uri_tests[%d].\n", j, i);
7355 ok(received == FALSE, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j, i);
7361 if(uri) IUri_Release(uri);
7367 static void test_IUri_IsEqual(void) {
7374 /* Make sure IsEqual handles invalid args correctly. */
7375 hrA = pCreateUri(http_urlW, 0, 0, &uriA);
7376 hrB = pCreateUri(http_urlW, 0, 0, &uriB);
7377 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrA, S_OK);
7378 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrB, S_OK);
7379 if(SUCCEEDED(hrA) && SUCCEEDED(hrB)) {
7381 hrA = IUri_IsEqual(uriA, NULL, &equal);
7382 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA, S_OK);
7383 ok(equal == FALSE, "Error: Expected equal to be FALSE, but was %d instead.\n", equal);
7385 hrA = IUri_IsEqual(uriA, uriB, NULL);
7386 ok(hrA == E_POINTER, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA, E_POINTER);
7388 if(uriA) IUri_Release(uriA);
7389 if(uriB) IUri_Release(uriB);
7391 for(i = 0; i < sizeof(equality_tests)/sizeof(equality_tests[0]); ++i) {
7392 uri_equality test = equality_tests[i];
7393 LPWSTR uriA_W, uriB_W;
7397 uriA_W = a2w(test.a);
7398 uriB_W = a2w(test.b);
7400 hrA = pCreateUri(uriA_W, test.create_flags_a, 0, &uriA);
7401 if(test.create_todo_a) {
7403 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7407 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7411 hrB = pCreateUri(uriB_W, test.create_flags_b, 0, &uriB);
7412 if(test.create_todo_b) {
7414 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7418 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7422 if(SUCCEEDED(hrA) && SUCCEEDED(hrB)) {
7425 hrA = IUri_IsEqual(uriA, uriB, &equal);
7428 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n",
7432 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test.equal, i);
7435 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hrA, S_OK, i);
7436 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test.equal, i);
7439 if(uriA) IUri_Release(uriA);
7440 if(uriB) IUri_Release(uriB);
7447 static void test_CreateUriWithFragment_InvalidArgs(void) {
7449 IUri *uri = (void*) 0xdeadbeef;
7450 const WCHAR fragmentW[] = {'#','f','r','a','g','m','e','n','t',0};
7452 hr = pCreateUriWithFragment(NULL, fragmentW, 0, 0, &uri);
7453 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7454 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7456 hr = pCreateUriWithFragment(http_urlW, fragmentW, 0, 0, NULL);
7457 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7459 /* Original URI can't already contain a fragment component. */
7460 uri = (void*) 0xdeadbeef;
7461 hr = pCreateUriWithFragment(http_url_fragW, fragmentW, 0, 0, &uri);
7462 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7463 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7466 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
7467 static void test_CreateUriWithFragment_InvalidFlags(void) {
7470 for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
7472 IUri *uri = (void*) 0xdeadbeef;
7474 hr = pCreateUriWithFragment(http_urlW, NULL, invalid_flag_tests[i].flags, 0, &uri);
7475 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
7476 hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
7477 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7481 static void test_CreateUriWithFragment(void) {
7484 for(i = 0; i < sizeof(uri_fragment_tests)/sizeof(uri_fragment_tests[0]); ++i) {
7488 uri_with_fragment test = uri_fragment_tests[i];
7490 uriW = a2w(test.uri);
7491 fragW = a2w(test.fragment);
7493 hr = pCreateUriWithFragment(uriW, fragW, test.create_flags, 0, &uri);
7494 if(test.expected_todo) {
7496 ok(hr == test.create_expected,
7497 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7498 hr, test.create_expected, i);
7501 ok(hr == test.create_expected,
7502 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7503 hr, test.create_expected, i);
7506 BSTR received = NULL;
7508 hr = IUri_GetAbsoluteUri(uri, &received);
7509 if(test.expected_todo) {
7512 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7516 ok(!strcmp_aw(test.expected_uri, received),
7517 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7518 test.expected_uri, wine_dbgstr_w(received), i);
7521 ok(hr == S_OK, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7523 ok(!strcmp_aw(test.expected_uri, received), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7524 test.expected_uri, wine_dbgstr_w(received), i);
7527 SysFreeString(received);
7530 if(uri) IUri_Release(uri);
7535 static void test_CreateIUriBuilder(void) {
7537 IUriBuilder *builder = NULL;
7540 hr = pCreateIUriBuilder(NULL, 0, 0, NULL);
7541 ok(hr == E_POINTER, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
7544 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
7545 hr = pCreateUri(http_urlW, 0, 0, &uri);
7546 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7548 ULONG cur_count, orig_count;
7550 orig_count = get_refcnt(uri);
7551 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
7552 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7553 ok(builder != NULL, "Error: Expecting builder not to be NULL\n");
7555 cur_count = get_refcnt(uri);
7556 ok(cur_count == orig_count+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count+1, cur_count);
7558 if(builder) IUriBuilder_Release(builder);
7559 cur_count = get_refcnt(uri);
7560 ok(cur_count == orig_count, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count, cur_count);
7562 if(uri) IUri_Release(uri);
7565 static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_test *test,
7570 hr = IUriBuilder_CreateUri(builder, test->uri_flags, 0, 0, &uri);
7571 if(test->uri_todo) {
7573 ok(hr == test->uri_hres,
7574 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7575 hr, test->uri_hres, test_index);
7578 ok(hr == test->uri_hres,
7579 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7580 hr, test->uri_hres, test_index);
7586 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7587 uri_builder_str_property prop = test->expected_str_props[i];
7588 BSTR received = NULL;
7590 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7593 ok(hr == prop.result,
7594 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7595 hr, prop.result, test_index, i);
7598 ok(hr == prop.result,
7599 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7600 hr, prop.result, test_index, i);
7605 ok(!strcmp_aw(prop.expected, received),
7606 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7607 prop.expected, wine_dbgstr_w(received), test_index, i);
7610 ok(!strcmp_aw(prop.expected, received),
7611 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7612 prop.expected, wine_dbgstr_w(received), test_index, i);
7615 SysFreeString(received);
7618 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7619 uri_builder_dword_property prop = test->expected_dword_props[i];
7620 DWORD received = -2;
7622 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7625 ok(hr == prop.result,
7626 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7627 hr, prop.result, test_index, i);
7630 ok(hr == prop.result,
7631 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7632 hr, prop.result, test_index, i);
7637 ok(received == prop.expected,
7638 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7639 prop.expected, received, test_index, i);
7642 ok(received == prop.expected,
7643 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7644 prop.expected, received, test_index, i);
7649 if(uri) IUri_Release(uri);
7652 static void test_IUriBuilder_CreateUriSimple(IUriBuilder *builder, const uri_builder_test *test,
7657 hr = IUriBuilder_CreateUriSimple(builder, test->uri_simple_encode_flags, 0, &uri);
7658 if(test->uri_simple_todo) {
7660 ok(hr == test->uri_simple_hres,
7661 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7662 hr, test->uri_simple_hres, test_index);
7665 ok(hr == test->uri_simple_hres,
7666 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7667 hr, test->uri_simple_hres, test_index);
7673 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7674 uri_builder_str_property prop = test->expected_str_props[i];
7675 BSTR received = NULL;
7677 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7680 ok(hr == prop.result,
7681 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7682 hr, prop.result, test_index, i);
7685 ok(hr == prop.result,
7686 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7687 hr, prop.result, test_index, i);
7692 ok(!strcmp_aw(prop.expected, received),
7693 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7694 prop.expected, wine_dbgstr_w(received), test_index, i);
7697 ok(!strcmp_aw(prop.expected, received),
7698 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7699 prop.expected, wine_dbgstr_w(received), test_index, i);
7702 SysFreeString(received);
7705 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7706 uri_builder_dword_property prop = test->expected_dword_props[i];
7707 DWORD received = -2;
7709 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7712 ok(hr == prop.result,
7713 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7714 hr, prop.result, test_index, i);
7717 ok(hr == prop.result,
7718 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7719 hr, prop.result, test_index, i);
7724 ok(received == prop.expected,
7725 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7726 prop.expected, received, test_index, i);
7729 ok(received == prop.expected,
7730 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7731 prop.expected, received, test_index, i);
7736 if(uri) IUri_Release(uri);
7739 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder *builder, const uri_builder_test *test,
7744 hr = IUriBuilder_CreateUriWithFlags(builder, test->uri_with_flags, test->uri_with_builder_flags,
7745 test->uri_with_encode_flags, 0, &uri);
7746 if(test->uri_with_todo) {
7748 ok(hr == test->uri_with_hres,
7749 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7750 hr, test->uri_with_hres, test_index);
7753 ok(hr == test->uri_with_hres,
7754 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7755 hr, test->uri_with_hres, test_index);
7761 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7762 uri_builder_str_property prop = test->expected_str_props[i];
7763 BSTR received = NULL;
7765 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7768 ok(hr == prop.result,
7769 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7770 hr, prop.result, test_index, i);
7773 ok(hr == prop.result,
7774 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7775 hr, prop.result, test_index, i);
7780 ok(!strcmp_aw(prop.expected, received),
7781 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7782 prop.expected, wine_dbgstr_w(received), test_index, i);
7785 ok(!strcmp_aw(prop.expected, received),
7786 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7787 prop.expected, wine_dbgstr_w(received), test_index, i);
7790 SysFreeString(received);
7793 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7794 uri_builder_dword_property prop = test->expected_dword_props[i];
7795 DWORD received = -2;
7797 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7800 ok(hr == prop.result,
7801 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7802 hr, prop.result, test_index, i);
7805 ok(hr == prop.result,
7806 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7807 hr, prop.result, test_index, i);
7812 ok(received == prop.expected,
7813 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7814 prop.expected, received, test_index, i);
7817 ok(received == prop.expected,
7818 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7819 prop.expected, received, test_index, i);
7824 if(uri) IUri_Release(uri);
7827 static void test_IUriBuilder_CreateInvalidArgs(void) {
7828 IUriBuilder *builder;
7831 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
7832 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7834 IUri *test = NULL, *uri = (void*) 0xdeadbeef;
7836 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
7837 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, NULL);
7838 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
7840 uri = (void*) 0xdeadbeef;
7841 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
7842 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_NOTIMPL);
7843 ok(uri == NULL, "Error: expected uri to be NULL, but was %p instead.\n", uri);
7845 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, NULL);
7846 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7849 uri = (void*) 0xdeadbeef;
7850 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
7851 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7853 ok(!uri, "Error: Expected uri to NULL, but was %p instead.\n", uri);
7855 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, NULL);
7856 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7859 uri = (void*) 0xdeadbeef;
7860 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
7861 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7863 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7865 hr = pCreateUri(http_urlW, 0, 0, &test);
7866 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7868 hr = IUriBuilder_SetIUri(builder, test);
7869 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7871 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
7873 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
7874 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7875 ok(uri != NULL, "Error: The uri was NULL.\n");
7876 if(uri) IUri_Release(uri);
7879 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
7880 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7882 ok(uri != NULL, "Error: uri was NULL.\n");
7883 if(uri) IUri_Release(uri);
7886 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &uri);
7887 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7889 ok(uri != NULL, "Error: uri was NULL.\n");
7890 if(uri) IUri_Release(uri);
7892 hr = IUriBuilder_SetFragment(builder, NULL);
7893 ok(hr == S_OK, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7895 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
7896 uri = (void*) 0xdeadbeef;
7897 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
7898 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7899 ok(!uri, "Error: Expected uri to be NULL but was %p instead.\n", uri);
7901 uri = (void*) 0xdeadbeef;
7902 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
7903 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7905 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7907 uri = (void*) 0xdeadbeef;
7908 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
7909 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7911 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7913 if(test) IUri_Release(test);
7915 if(builder) IUriBuilder_Release(builder);
7918 /* Tests invalid args to the "Get*" functions. */
7919 static void test_IUriBuilder_GetInvalidArgs(void) {
7920 IUriBuilder *builder = NULL;
7923 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
7924 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7926 LPCWSTR received = (void*) 0xdeadbeef;
7927 DWORD len = -1, port = -1;
7930 hr = IUriBuilder_GetFragment(builder, NULL, NULL);
7931 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
7933 hr = IUriBuilder_GetFragment(builder, NULL, &received);
7934 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
7936 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
7937 hr = IUriBuilder_GetFragment(builder, &len, NULL);
7938 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
7940 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
7942 hr = IUriBuilder_GetHost(builder, NULL, NULL);
7943 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
7945 received = (void*) 0xdeadbeef;
7946 hr = IUriBuilder_GetHost(builder, NULL, &received);
7947 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
7949 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
7951 hr = IUriBuilder_GetHost(builder, &len, NULL);
7952 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
7954 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
7956 hr = IUriBuilder_GetPassword(builder, NULL, NULL);
7957 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
7959 received = (void*) 0xdeadbeef;
7960 hr = IUriBuilder_GetPassword(builder, NULL, &received);
7961 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
7963 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
7965 hr = IUriBuilder_GetPassword(builder, &len, NULL);
7966 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
7968 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
7970 hr = IUriBuilder_GetPath(builder, NULL, NULL);
7971 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
7973 received = (void*) 0xdeadbeef;
7974 hr = IUriBuilder_GetPath(builder, NULL, &received);
7975 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
7977 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
7979 hr = IUriBuilder_GetPath(builder, &len, NULL);
7980 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
7982 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
7984 hr = IUriBuilder_GetPort(builder, NULL, NULL);
7985 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
7987 hr = IUriBuilder_GetPort(builder, NULL, &port);
7988 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
7990 ok(!port, "Error: Expected port to be 0, but was %d instead.\n", port);
7991 hr = IUriBuilder_GetPort(builder, &set, NULL);
7992 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
7994 ok(!set, "Error: Expected set to be FALSE, but was %d instead.\n", set);
7996 hr = IUriBuilder_GetQuery(builder, NULL, NULL);
7997 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
7999 received = (void*) 0xdeadbeef;
8000 hr = IUriBuilder_GetQuery(builder, NULL, &received);
8001 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8003 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8005 hr = IUriBuilder_GetQuery(builder, &len, NULL);
8006 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8008 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8010 hr = IUriBuilder_GetSchemeName(builder, NULL, NULL);
8011 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8013 received = (void*) 0xdeadbeef;
8014 hr = IUriBuilder_GetSchemeName(builder, NULL, &received);
8015 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8017 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8019 hr = IUriBuilder_GetSchemeName(builder, &len, NULL);
8020 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8022 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8024 hr = IUriBuilder_GetUserName(builder, NULL, NULL);
8025 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8027 received = (void*) 0xdeadbeef;
8028 hr = IUriBuilder_GetUserName(builder, NULL, &received);
8029 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8031 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8033 hr = IUriBuilder_GetUserName(builder, &len, NULL);
8034 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8036 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8038 if(builder) IUriBuilder_Release(builder);
8041 static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder_test *test,
8045 LPCWSTR received = NULL;
8047 const uri_builder_property *prop = NULL;
8049 /* Check if the property was set earlier. */
8050 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8051 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_FRAGMENT)
8052 prop = &(test->properties[i]);
8056 /* Use expected_value unless it's NULL, then use value. */
8057 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8058 hr = IUriBuilder_GetFragment(builder, &len, &received);
8061 ok(hr == (expected ? S_OK : S_FALSE),
8062 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8063 hr, (expected ? S_OK : S_FALSE), test_index);
8067 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8068 expected, wine_dbgstr_w(received), test_index);
8071 ok(lstrlen(expected) == len,
8072 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8073 lstrlen(expected), len, test_index);
8077 ok(hr == (expected ? S_OK : S_FALSE),
8078 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8079 hr, (expected ? S_OK : S_FALSE), test_index);
8080 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8081 expected, wine_dbgstr_w(received), test_index);
8082 ok(lstrlen(expected) == len,
8083 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8084 lstrlen(expected), len, test_index);
8087 /* The property wasn't set earlier, so it should return whatever
8088 * the base IUri contains (if anything).
8091 hr = IUriBuilder_GetIUri(builder, &uri);
8093 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8094 hr, S_OK, test_index);
8097 received = (void*) 0xdeadbeef;
8100 hr = IUriBuilder_GetFragment(builder, &len, &received);
8102 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8103 hr, S_FALSE, test_index);
8105 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8107 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8108 received, test_index);
8111 BOOL has_prop = FALSE;
8112 BSTR expected = NULL;
8114 hr = IUri_GetFragment(uri, &expected);
8116 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8118 has_prop = hr == S_OK;
8120 hr = IUriBuilder_GetFragment(builder, &len, &received);
8123 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8124 hr, S_OK, test_index);
8126 ok(!lstrcmpW(expected, received),
8127 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8128 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8129 ok(lstrlenW(expected) == len,
8130 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8131 lstrlenW(expected), len, test_index);
8135 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8136 hr, S_FALSE, test_index);
8138 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8139 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8143 SysFreeString(expected);
8146 if(uri) IUri_Release(uri);
8150 static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_test *test,
8154 LPCWSTR received = NULL;
8156 const uri_builder_property *prop = NULL;
8158 /* Check if the property was set earlier. */
8159 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8160 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_HOST)
8161 prop = &(test->properties[i]);
8165 /* Use expected_value unless it's NULL, then use value. */
8166 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8167 hr = IUriBuilder_GetHost(builder, &len, &received);
8170 ok(hr == (expected ? S_OK : S_FALSE),
8171 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8172 hr, (expected ? S_OK : S_FALSE), test_index);
8176 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8177 expected, wine_dbgstr_w(received), test_index);
8180 ok(lstrlen(expected) == len,
8181 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8182 lstrlen(expected), len, test_index);
8186 ok(hr == (expected ? S_OK : S_FALSE),
8187 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8188 hr, (expected ? S_OK : S_FALSE), test_index);
8189 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8190 expected, wine_dbgstr_w(received), test_index);
8191 ok(lstrlen(expected) == len,
8192 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8193 lstrlen(expected), len, test_index);
8196 /* The property wasn't set earlier, so it should return whatever
8197 * the base IUri contains (if anything).
8200 hr = IUriBuilder_GetIUri(builder, &uri);
8202 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8203 hr, S_OK, test_index);
8206 received = (void*) 0xdeadbeef;
8209 hr = IUriBuilder_GetHost(builder, &len, &received);
8211 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8212 hr, S_FALSE, test_index);
8214 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8216 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8217 received, test_index);
8220 BOOL has_prop = FALSE;
8221 BSTR expected = NULL;
8223 hr = IUri_GetHost(uri, &expected);
8225 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8227 has_prop = hr == S_OK;
8229 hr = IUriBuilder_GetHost(builder, &len, &received);
8232 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8233 hr, S_OK, test_index);
8235 ok(!lstrcmpW(expected, received),
8236 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8237 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8238 ok(lstrlenW(expected) == len,
8239 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8240 lstrlenW(expected), len, test_index);
8244 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8245 hr, S_FALSE, test_index);
8247 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8248 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8252 SysFreeString(expected);
8255 if(uri) IUri_Release(uri);
8259 static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder_test *test,
8263 LPCWSTR received = NULL;
8265 const uri_builder_property *prop = NULL;
8267 /* Check if the property was set earlier. */
8268 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8269 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PASSWORD)
8270 prop = &(test->properties[i]);
8274 /* Use expected_value unless it's NULL, then use value. */
8275 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8276 hr = IUriBuilder_GetPassword(builder, &len, &received);
8279 ok(hr == (expected ? S_OK : S_FALSE),
8280 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8281 hr, (expected ? S_OK : S_FALSE), test_index);
8285 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8286 expected, wine_dbgstr_w(received), test_index);
8289 ok(lstrlen(expected) == len,
8290 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8291 lstrlen(expected), len, test_index);
8295 ok(hr == (expected ? S_OK : S_FALSE),
8296 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8297 hr, (expected ? S_OK : S_FALSE), test_index);
8298 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8299 expected, wine_dbgstr_w(received), test_index);
8300 ok(lstrlen(expected) == len,
8301 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8302 lstrlen(expected), len, test_index);
8305 /* The property wasn't set earlier, so it should return whatever
8306 * the base IUri contains (if anything).
8309 hr = IUriBuilder_GetIUri(builder, &uri);
8311 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8312 hr, S_OK, test_index);
8315 received = (void*) 0xdeadbeef;
8318 hr = IUriBuilder_GetPassword(builder, &len, &received);
8320 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8321 hr, S_FALSE, test_index);
8323 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8325 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8326 received, test_index);
8329 BOOL has_prop = FALSE;
8330 BSTR expected = NULL;
8332 hr = IUri_GetPassword(uri, &expected);
8334 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8336 has_prop = hr == S_OK;
8338 hr = IUriBuilder_GetPassword(builder, &len, &received);
8341 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8342 hr, S_OK, test_index);
8344 ok(!lstrcmpW(expected, received),
8345 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8346 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8347 ok(lstrlenW(expected) == len,
8348 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8349 lstrlenW(expected), len, test_index);
8353 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8354 hr, S_FALSE, test_index);
8356 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8357 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8361 SysFreeString(expected);
8364 if(uri) IUri_Release(uri);
8368 static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_test *test,
8372 LPCWSTR received = NULL;
8374 const uri_builder_property *prop = NULL;
8376 /* Check if the property was set earlier. */
8377 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8378 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PATH)
8379 prop = &(test->properties[i]);
8383 /* Use expected_value unless it's NULL, then use value. */
8384 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8385 hr = IUriBuilder_GetPath(builder, &len, &received);
8388 ok(hr == (expected ? S_OK : S_FALSE),
8389 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8390 hr, (expected ? S_OK : S_FALSE), test_index);
8394 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8395 expected, wine_dbgstr_w(received), test_index);
8398 ok(lstrlen(expected) == len,
8399 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8400 lstrlen(expected), len, test_index);
8404 ok(hr == (expected ? S_OK : S_FALSE),
8405 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8406 hr, (expected ? S_OK : S_FALSE), test_index);
8407 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8408 expected, wine_dbgstr_w(received), test_index);
8409 ok(lstrlen(expected) == len,
8410 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8411 lstrlen(expected), len, test_index);
8414 /* The property wasn't set earlier, so it should return whatever
8415 * the base IUri contains (if anything).
8418 hr = IUriBuilder_GetIUri(builder, &uri);
8420 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8421 hr, S_OK, test_index);
8424 received = (void*) 0xdeadbeef;
8427 hr = IUriBuilder_GetPath(builder, &len, &received);
8429 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8430 hr, S_FALSE, test_index);
8432 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8434 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8435 received, test_index);
8438 BOOL has_prop = FALSE;
8439 BSTR expected = NULL;
8441 hr = IUri_GetPath(uri, &expected);
8443 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8445 has_prop = hr == S_OK;
8447 hr = IUriBuilder_GetPath(builder, &len, &received);
8450 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8451 hr, S_OK, test_index);
8453 ok(!lstrcmpW(expected, received),
8454 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8455 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8456 ok(lstrlenW(expected) == len,
8457 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8458 lstrlenW(expected), len, test_index);
8462 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8463 hr, S_FALSE, test_index);
8465 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8466 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8470 SysFreeString(expected);
8473 if(uri) IUri_Release(uri);
8477 static void test_IUriBuilder_GetPort(IUriBuilder *builder, const uri_builder_test *test,
8480 BOOL has_port = FALSE;
8481 DWORD received = -1;
8483 if(test->port_prop.change) {
8484 DWORD expected = test->port_prop.value;
8486 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8487 if(test->port_prop.todo) {
8490 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8491 hr, S_OK, test_index);
8495 ok(has_port == test->port_prop.set,
8496 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
8497 test->port_prop.set, has_port, test_index);
8500 ok(received == expected,
8501 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8502 expected, received, test_index);
8507 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8508 hr, S_OK, test_index);
8509 ok(has_port == test->port_prop.set,
8510 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8511 test->port_prop.set, has_port, test_index);
8512 ok(received == test->port_prop.value,
8513 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8514 test->port_prop.value, received, test_index);
8519 hr = IUriBuilder_GetIUri(builder, &uri);
8521 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8522 hr, S_OK, test_index);
8525 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8527 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8528 hr, S_OK, test_index);
8530 ok(has_port == FALSE,
8531 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
8532 has_port, test_index);
8533 ok(!received, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
8534 received, test_index);
8539 hr = IUri_GetPort(uri, &expected);
8541 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8544 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8546 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8547 hr, S_OK, test_index);
8550 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
8552 ok(received == expected,
8553 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8554 expected, received, test_index);
8558 if(uri) IUri_Release(uri);
8562 static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_test *test,
8566 LPCWSTR received = NULL;
8568 const uri_builder_property *prop = NULL;
8570 /* Check if the property was set earlier. */
8571 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8572 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_QUERY)
8573 prop = &(test->properties[i]);
8577 /* Use expected_value unless it's NULL, then use value. */
8578 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8579 hr = IUriBuilder_GetQuery(builder, &len, &received);
8582 ok(hr == (expected ? S_OK : S_FALSE),
8583 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8584 hr, (expected ? S_OK : S_FALSE), test_index);
8588 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8589 expected, wine_dbgstr_w(received), test_index);
8592 ok(lstrlen(expected) == len,
8593 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8594 lstrlen(expected), len, test_index);
8598 ok(hr == (expected ? S_OK : S_FALSE),
8599 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8600 hr, (expected ? S_OK : S_FALSE), test_index);
8601 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8602 expected, wine_dbgstr_w(received), test_index);
8603 ok(lstrlen(expected) == len,
8604 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8605 lstrlen(expected), len, test_index);
8608 /* The property wasn't set earlier, so it should return whatever
8609 * the base IUri contains (if anything).
8612 hr = IUriBuilder_GetIUri(builder, &uri);
8614 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8615 hr, S_OK, test_index);
8618 received = (void*) 0xdeadbeef;
8621 hr = IUriBuilder_GetQuery(builder, &len, &received);
8623 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8624 hr, S_FALSE, test_index);
8626 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8628 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8629 received, test_index);
8632 BOOL has_prop = FALSE;
8633 BSTR expected = NULL;
8635 hr = IUri_GetQuery(uri, &expected);
8637 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8639 has_prop = hr == S_OK;
8641 hr = IUriBuilder_GetQuery(builder, &len, &received);
8644 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8645 hr, S_OK, test_index);
8647 ok(!lstrcmpW(expected, received),
8648 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8649 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8650 ok(lstrlenW(expected) == len,
8651 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8652 lstrlenW(expected), len, test_index);
8656 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8657 hr, S_FALSE, test_index);
8659 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8660 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8664 SysFreeString(expected);
8667 if(uri) IUri_Release(uri);
8671 static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_builder_test *test,
8675 LPCWSTR received = NULL;
8677 const uri_builder_property *prop = NULL;
8679 /* Check if the property was set earlier. */
8680 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8681 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_SCHEME_NAME)
8682 prop = &(test->properties[i]);
8686 /* Use expected_value unless it's NULL, then use value. */
8687 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8688 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8691 ok(hr == (expected ? S_OK : S_FALSE),
8692 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8693 hr, (expected ? S_OK : S_FALSE), test_index);
8697 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8698 expected, wine_dbgstr_w(received), test_index);
8701 ok(lstrlen(expected) == len,
8702 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8703 lstrlen(expected), len, test_index);
8707 ok(hr == (expected ? S_OK : S_FALSE),
8708 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8709 hr, (expected ? S_OK : S_FALSE), test_index);
8710 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8711 expected, wine_dbgstr_w(received), test_index);
8712 ok(lstrlen(expected) == len,
8713 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8714 lstrlen(expected), len, test_index);
8717 /* The property wasn't set earlier, so it should return whatever
8718 * the base IUri contains (if anything).
8721 hr = IUriBuilder_GetIUri(builder, &uri);
8723 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8724 hr, S_OK, test_index);
8727 received = (void*) 0xdeadbeef;
8730 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8732 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8733 hr, S_FALSE, test_index);
8735 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8737 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8738 received, test_index);
8741 BOOL has_prop = FALSE;
8742 BSTR expected = NULL;
8744 hr = IUri_GetSchemeName(uri, &expected);
8746 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8748 has_prop = hr == S_OK;
8750 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8753 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8754 hr, S_OK, test_index);
8756 ok(!lstrcmpW(expected, received),
8757 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8758 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8759 ok(lstrlenW(expected) == len,
8760 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8761 lstrlenW(expected), len, test_index);
8765 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8766 hr, S_FALSE, test_index);
8768 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8769 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8773 SysFreeString(expected);
8776 if(uri) IUri_Release(uri);
8780 static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder_test *test,
8784 LPCWSTR received = NULL;
8786 const uri_builder_property *prop = NULL;
8788 /* Check if the property was set earlier. */
8789 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8790 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_USER_NAME)
8791 prop = &(test->properties[i]);
8794 if(prop && prop->value && *prop->value) {
8795 /* Use expected_value unless it's NULL, then use value. */
8796 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8797 hr = IUriBuilder_GetUserName(builder, &len, &received);
8800 ok(hr == (expected ? S_OK : S_FALSE),
8801 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8802 hr, (expected ? S_OK : S_FALSE), test_index);
8806 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8807 expected, wine_dbgstr_w(received), test_index);
8810 ok(lstrlen(expected) == len,
8811 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8812 lstrlen(expected), len, test_index);
8816 ok(hr == (expected ? S_OK : S_FALSE),
8817 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8818 hr, (expected ? S_OK : S_FALSE), test_index);
8819 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8820 expected, wine_dbgstr_w(received), test_index);
8821 ok(lstrlen(expected) == len,
8822 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8823 lstrlen(expected), len, test_index);
8826 /* The property wasn't set earlier, so it should return whatever
8827 * the base IUri contains (if anything).
8830 hr = IUriBuilder_GetIUri(builder, &uri);
8832 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8833 hr, S_OK, test_index);
8836 received = (void*) 0xdeadbeef;
8839 hr = IUriBuilder_GetUserName(builder, &len, &received);
8841 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8842 hr, S_FALSE, test_index);
8844 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8846 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8847 received, test_index);
8850 BSTR expected = NULL;
8851 BOOL has_prop = FALSE;
8853 hr = IUri_GetUserName(uri, &expected);
8855 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8857 has_prop = hr == S_OK;
8859 hr = IUriBuilder_GetUserName(builder, &len, &received);
8862 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8863 hr, S_OK, test_index);
8865 ok(!lstrcmpW(expected, received),
8866 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8867 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8868 ok(lstrlenW(expected) == len,
8869 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8870 lstrlenW(expected), len, test_index);
8874 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8875 hr, S_FALSE, test_index);
8877 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8878 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8882 SysFreeString(expected);
8885 if(uri) IUri_Release(uri);
8889 /* Tests IUriBuilder functions. */
8890 static void test_IUriBuilder(void) {
8892 IUriBuilder *builder;
8895 for(i = 0; i < sizeof(uri_builder_tests)/sizeof(uri_builder_tests[0]); ++i) {
8897 uri_builder_test test = uri_builder_tests[i];
8901 uriW = a2w(test.uri);
8902 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
8903 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8905 if(FAILED(hr)) continue;
8907 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
8908 if(test.create_builder_todo) {
8910 ok(hr == test.create_builder_expected,
8911 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8912 hr, test.create_builder_expected, i);
8915 ok(hr == test.create_builder_expected,
8916 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8917 hr, test.create_builder_expected, i);
8921 BOOL modified = FALSE, received = FALSE;
8923 /* Perform all the string property changes. */
8924 for(j = 0; j < URI_BUILDER_STR_PROPERTY_COUNT; ++j) {
8925 uri_builder_property prop = test.properties[j];
8927 change_property(builder, &prop, i);
8928 if(prop.property != Uri_PROPERTY_SCHEME_NAME &&
8929 prop.property != Uri_PROPERTY_HOST)
8931 else if(prop.value && *prop.value)
8933 else if(prop.value && !*prop.value && prop.property == Uri_PROPERTY_HOST)
8934 /* Host name property can't be NULL, but it can be empty. */
8939 if(test.port_prop.change) {
8940 hr = IUriBuilder_SetPort(builder, test.port_prop.set, test.port_prop.value);
8942 if(test.port_prop.todo) {
8944 ok(hr == test.port_prop.expected,
8945 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8946 hr, test.port_prop.expected, i);
8949 ok(hr == test.port_prop.expected,
8950 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8951 hr, test.port_prop.expected, i);
8955 hr = IUriBuilder_HasBeenModified(builder, &received);
8957 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8960 ok(received == modified,
8961 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
8962 modified, received, i);
8964 /* Test the "Get*" functions. */
8965 test_IUriBuilder_GetFragment(builder, &test, i);
8966 test_IUriBuilder_GetHost(builder, &test, i);
8967 test_IUriBuilder_GetPassword(builder, &test, i);
8968 test_IUriBuilder_GetPath(builder, &test, i);
8969 test_IUriBuilder_GetPort(builder, &test, i);
8970 test_IUriBuilder_GetQuery(builder, &test, i);
8971 test_IUriBuilder_GetSchemeName(builder, &test, i);
8972 test_IUriBuilder_GetUserName(builder, &test, i);
8974 test_IUriBuilder_CreateUri(builder, &test, i);
8975 test_IUriBuilder_CreateUriSimple(builder, &test, i);
8976 test_IUriBuilder_CreateUriWithFlags(builder, &test, i);
8978 if(builder) IUriBuilder_Release(builder);
8979 if(uri) IUri_Release(uri);
8984 static void test_IUriBuilder_HasBeenModified(void) {
8986 IUriBuilder *builder = NULL;
8988 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
8989 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8991 static const WCHAR hostW[] = {'g','o','o','g','l','e','.','c','o','m',0};
8995 hr = IUriBuilder_HasBeenModified(builder, NULL);
8996 ok(hr == E_POINTER, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
8999 hr = IUriBuilder_SetHost(builder, hostW);
9000 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
9003 hr = IUriBuilder_HasBeenModified(builder, &received);
9004 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9007 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9009 hr = pCreateUri(http_urlW, 0, 0, &uri);
9010 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9015 hr = IUriBuilder_SetIUri(builder, uri);
9016 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
9019 hr = IUriBuilder_HasBeenModified(builder, &received);
9020 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9023 ok(received == FALSE, "Error: Expected received to be FALSE.\n");
9025 /* Test what happens with you call SetIUri with the same IUri again. */
9026 hr = IUriBuilder_SetHost(builder, hostW);
9027 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9029 hr = IUriBuilder_HasBeenModified(builder, &received);
9030 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9033 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9035 hr = IUriBuilder_SetIUri(builder, uri);
9036 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9038 /* IUriBuilder already had 'uri' as it's IUri property and so Windows doesn't
9039 * reset any of the changes that were made to the IUriBuilder.
9041 hr = IUriBuilder_HasBeenModified(builder, &received);
9042 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9044 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9046 hr = IUriBuilder_GetHost(builder, &len, &prop);
9047 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9049 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
9050 wine_dbgstr_w(hostW), wine_dbgstr_w(prop));
9051 ok(len == lstrlenW(hostW), "Error: Expected len to be %d, but was %d instead.\n",
9052 lstrlenW(hostW), len);
9055 hr = IUriBuilder_SetIUri(builder, NULL);
9056 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9058 hr = IUriBuilder_SetHost(builder, hostW);
9059 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9060 hr = IUriBuilder_HasBeenModified(builder, &received);
9061 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9064 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9066 hr = IUriBuilder_SetIUri(builder, NULL);
9067 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr, S_OK);
9069 hr = IUriBuilder_HasBeenModified(builder, &received);
9070 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9073 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9075 hr = IUriBuilder_GetHost(builder, &len, &prop);
9076 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9078 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
9079 wine_dbgstr_w(hostW), wine_dbgstr_w(prop));
9080 ok(len == lstrlenW(hostW), "Error: Expected len to %d, but was %d instead.\n",
9081 lstrlenW(hostW), len);
9084 if(uri) IUri_Release(uri);
9086 if(builder) IUriBuilder_Release(builder);
9089 /* Test IUriBuilder {Get,Set}IUri functions. */
9090 static void test_IUriBuilder_IUriProperty(void) {
9091 IUriBuilder *builder = NULL;
9094 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9095 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9099 hr = IUriBuilder_GetIUri(builder, NULL);
9100 ok(hr == E_POINTER, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
9103 hr = pCreateUri(http_urlW, 0, 0, &uri);
9106 ULONG cur_count, orig_count;
9108 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
9109 orig_count = get_refcnt(uri);
9110 hr = IUriBuilder_SetIUri(builder, uri);
9111 cur_count = get_refcnt(uri);
9113 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9114 orig_count+1, cur_count);
9116 hr = IUriBuilder_SetIUri(builder, NULL);
9117 cur_count = get_refcnt(uri);
9119 ok(cur_count == orig_count, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9120 orig_count, cur_count);
9122 /* CreateUri* functions will return back the same IUri if nothing has changed. */
9123 hr = IUriBuilder_SetIUri(builder, uri);
9124 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9125 orig_count = get_refcnt(uri);
9127 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, &test);
9128 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9130 cur_count = get_refcnt(uri);
9131 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9132 orig_count+1, cur_count);
9133 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n",
9136 if(test) IUri_Release(test);
9139 hr = IUriBuilder_CreateUri(builder, -1, 0, 0, &test);
9140 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9142 cur_count = get_refcnt(uri);
9143 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9144 orig_count+1, cur_count);
9145 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9147 if(test) IUri_Release(test);
9149 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9153 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, &test);
9154 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9156 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
9158 if(test) IUri_Release(test);
9160 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9161 * explicitly set (because it's a default flags).
9164 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_CANONICALIZE, 0, 0, &test);
9165 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9167 cur_count = get_refcnt(uri);
9168 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9169 orig_count+1, cur_count);
9170 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
9172 if(test) IUri_Release(test);
9175 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test);
9176 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9178 cur_count = get_refcnt(uri);
9179 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9180 orig_count+1, cur_count);
9181 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9183 if(test) IUri_Release(test);
9186 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &test);
9187 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9190 cur_count = get_refcnt(uri);
9191 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9192 orig_count+1, cur_count);
9193 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9195 if(test) IUri_Release(test);
9197 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9201 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, 0, &test);
9202 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9204 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
9206 if(test) IUri_Release(test);
9208 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9209 * explicitly set (because it's a default flags).
9212 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_CANONICALIZE, 0, 0, 0, &test);
9213 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9215 cur_count = get_refcnt(uri);
9216 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9217 orig_count+1, cur_count);
9218 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
9220 if(test) IUri_Release(test);
9222 if(uri) IUri_Release(uri);
9224 if(builder) IUriBuilder_Release(builder);
9227 static void test_IUriBuilder_RemoveProperties(void) {
9228 IUriBuilder *builder = NULL;
9232 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9233 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9235 /* Properties that can't be removed. */
9236 const DWORD invalid = Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_RAW_URI|Uri_HAS_HOST_TYPE|
9237 Uri_HAS_SCHEME|Uri_HAS_ZONE;
9239 for(i = Uri_PROPERTY_STRING_START; i <= Uri_PROPERTY_DWORD_LAST; ++i) {
9240 hr = IUriBuilder_RemoveProperties(builder, i << 1);
9241 if((i << 1) & invalid) {
9242 ok(hr == E_INVALIDARG,
9243 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9244 hr, E_INVALIDARG, i);
9247 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9252 /* Also doesn't accept anything that's outside the range of the
9255 hr = IUriBuilder_RemoveProperties(builder, (Uri_PROPERTY_DWORD_LAST+1) << 1);
9256 ok(hr == E_INVALIDARG, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
9259 if(builder) IUriBuilder_Release(builder);
9261 for(i = 0; i < sizeof(uri_builder_remove_tests)/sizeof(uri_builder_remove_tests[0]); ++i) {
9262 uri_builder_remove_test test = uri_builder_remove_tests[i];
9266 uriW = a2w(test.uri);
9267 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
9271 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9272 if(test.create_builder_todo) {
9274 ok(hr == test.create_builder_expected,
9275 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9276 hr, test.create_builder_expected, i);
9279 ok(hr == test.create_builder_expected,
9280 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9281 hr, test.create_builder_expected, i);
9284 hr = IUriBuilder_RemoveProperties(builder, test.remove_properties);
9285 if(test.remove_todo) {
9287 ok(hr == test.remove_expected,
9288 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
9289 hr, test.remove_expected, i);
9292 ok(hr == test.remove_expected,
9293 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9294 hr, test.remove_expected, i);
9297 IUri *result = NULL;
9299 hr = IUriBuilder_CreateUri(builder, test.expected_flags, 0, 0, &result);
9300 if(test.expected_todo) {
9302 ok(hr == test.expected_hres,
9303 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9304 hr, test.expected_hres, i);
9307 ok(hr == test.expected_hres,
9308 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9309 hr, test.expected_hres, i);
9312 BSTR received = NULL;
9314 hr = IUri_GetAbsoluteUri(result, &received);
9315 ok(!strcmp_aw(test.expected_uri, received),
9316 "Error: Expected %s but got %s instead on test %d.\n",
9317 test.expected_uri, wine_dbgstr_w(received), i);
9318 SysFreeString(received);
9320 if(result) IUri_Release(result);
9323 if(builder) IUriBuilder_Release(builder);
9325 if(uri) IUri_Release(uri);
9330 static void test_IUriBuilder_Misc(void) {
9334 hr = pCreateUri(http_urlW, 0, 0, &uri);
9336 IUriBuilder *builder;
9338 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9339 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9344 hr = IUriBuilder_GetPort(builder, &has, &port);
9345 ok(hr == S_OK, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9347 /* 'has' will be set to FALSE, even though uri had a port. */
9348 ok(has == FALSE, "Error: Expected 'has' to be FALSE, was %d instead.\n", has);
9349 /* Still sets 'port' to 80. */
9350 ok(port == 80, "Error: Expected the port to be 80, but, was %d instead.\n", port);
9353 if(builder) IUriBuilder_Release(builder);
9355 if(uri) IUri_Release(uri);
9358 static void test_CoInternetCombineIUri(void) {
9360 IUri *base, *relative, *result;
9364 hr = pCreateUri(http_urlW, 0, 0, &base);
9365 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr);
9367 result = (void*) 0xdeadbeef;
9368 hr = pCoInternetCombineIUri(base, NULL, 0, &result, 0);
9369 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9370 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
9374 hr = pCreateUri(http_urlW, 0, 0, &relative);
9375 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr);
9377 result = (void*) 0xdeadbeef;
9378 hr = pCoInternetCombineIUri(NULL, relative, 0, &result, 0);
9379 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9380 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
9383 hr = pCoInternetCombineIUri(base, relative, 0, NULL, 0);
9384 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9386 if(base) IUri_Release(base);
9387 if(relative) IUri_Release(relative);
9389 for(i = 0; i < sizeof(uri_combine_tests)/sizeof(uri_combine_tests[0]); ++i) {
9390 LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
9392 hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
9393 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr, i);
9395 LPWSTR relativeW = a2w(uri_combine_tests[i].relative_uri);
9397 hr = pCreateUri(relativeW, uri_combine_tests[i].relative_create_flags, 0, &relative);
9398 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr, i);
9402 hr = pCoInternetCombineIUri(base, relative, uri_combine_tests[i].combine_flags, &result, 0);
9403 if(uri_combine_tests[i].todo) {
9405 ok(hr == uri_combine_tests[i].expected,
9406 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9407 hr, uri_combine_tests[i].expected, i);
9410 ok(hr == uri_combine_tests[i].expected,
9411 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9412 hr, uri_combine_tests[i]. expected, i);
9417 for(j = 0; j < sizeof(uri_combine_tests[i].str_props)/sizeof(uri_combine_tests[i].str_props[0]); ++j) {
9418 uri_str_property prop = uri_combine_tests[i].str_props[j];
9421 hr = IUri_GetPropertyBSTR(result, j, &received, 0);
9424 ok(hr == prop.expected,
9425 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9426 hr, prop.expected, i, j);
9429 ok(!strcmp_aw(prop.value, received) ||
9430 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9431 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9432 prop.value, wine_dbgstr_w(received), i, j);
9435 ok(hr == prop.expected,
9436 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9437 hr, prop.expected, i, j);
9438 ok(!strcmp_aw(prop.value, received) ||
9439 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9440 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9441 prop.value, wine_dbgstr_w(received), i, j);
9443 SysFreeString(received);
9446 for(j = 0; j < sizeof(uri_combine_tests[i].dword_props)/sizeof(uri_combine_tests[i].dword_props[0]); ++j) {
9447 uri_dword_property prop = uri_combine_tests[i].dword_props[j];
9450 hr = IUri_GetPropertyDWORD(result, j+Uri_PROPERTY_DWORD_START, &received, 0);
9453 ok(hr == prop.expected,
9454 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9455 hr, prop.expected, i, j);
9458 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9459 prop.value, received, i, j);
9462 ok(hr == prop.expected,
9463 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9464 hr, prop.expected, i, j);
9465 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9466 prop.value, received, i, j);
9470 if(result) IUri_Release(result);
9472 if(relative) IUri_Release(relative);
9473 heap_free(relativeW);
9475 if(base) IUri_Release(base);
9483 hurlmon = GetModuleHandle("urlmon.dll");
9484 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
9485 pCreateUriWithFragment = (void*) GetProcAddress(hurlmon, "CreateUriWithFragment");
9486 pCreateIUriBuilder = (void*) GetProcAddress(hurlmon, "CreateIUriBuilder");
9487 pCoInternetCombineIUri = (void*) GetProcAddress(hurlmon, "CoInternetCombineIUri");
9490 win_skip("CreateUri is not present, skipping tests.\n");
9494 trace("test CreateUri invalid flags...\n");
9495 test_CreateUri_InvalidFlags();
9497 trace("test CreateUri invalid args...\n");
9498 test_CreateUri_InvalidArgs();
9500 trace("test CreateUri invalid URIs...\n");
9501 test_CreateUri_InvalidUri();
9503 trace("test IUri_GetPropertyBSTR...\n");
9504 test_IUri_GetPropertyBSTR();
9506 trace("test IUri_GetPropertyDWORD...\n");
9507 test_IUri_GetPropertyDWORD();
9509 trace("test IUri_GetStrProperties...\n");
9510 test_IUri_GetStrProperties();
9512 trace("test IUri_GetDwordProperties...\n");
9513 test_IUri_GetDwordProperties();
9515 trace("test IUri_GetPropertyLength...\n");
9516 test_IUri_GetPropertyLength();
9518 trace("test IUri_GetProperties...\n");
9519 test_IUri_GetProperties();
9521 trace("test IUri_HasProperty...\n");
9522 test_IUri_HasProperty();
9524 trace("test IUri_IsEqual...\n");
9525 test_IUri_IsEqual();
9527 trace("test CreateUriWithFragment invalid args...\n");
9528 test_CreateUriWithFragment_InvalidArgs();
9530 trace("test CreateUriWithFragment invalid flags...\n");
9531 test_CreateUriWithFragment_InvalidFlags();
9533 trace("test CreateUriWithFragment...\n");
9534 test_CreateUriWithFragment();
9536 trace("test CreateIUriBuilder...\n");
9537 test_CreateIUriBuilder();
9539 trace("test IUriBuilder_CreateInvalidArgs...\n");
9540 test_IUriBuilder_CreateInvalidArgs();
9542 trace("test IUriBuilder...\n");
9545 trace("test IUriBuilder_GetInvalidArgs...\n");
9546 test_IUriBuilder_GetInvalidArgs();
9548 trace("test IUriBuilder_HasBeenModified...\n");
9549 test_IUriBuilder_HasBeenModified();
9551 trace("test IUriBuilder_IUriProperty...\n");
9552 test_IUriBuilder_IUriProperty();
9554 trace("test IUriBuilder_RemoveProperties...\n");
9555 test_IUriBuilder_RemoveProperties();
9557 trace("test IUriBuilder miscellaneous...\n");
9558 test_IUriBuilder_Misc();
9560 trace("test CoInternetCombineIUri...\n");
9561 test_CoInternetCombineIUri();