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>
35 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
36 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
37 #define URI_BUILDER_STR_PROPERTY_COUNT 7
39 #define DEFINE_EXPECT(func) \
40 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
42 #define SET_EXPECT(func) \
43 expect_ ## func = TRUE
45 #define CHECK_EXPECT(func) \
47 ok(expect_ ##func, "unexpected call " #func "\n"); \
48 expect_ ## func = FALSE; \
49 called_ ## func = TRUE; \
52 #define CHECK_EXPECT2(func) \
54 ok(expect_ ##func, "unexpected call " #func "\n"); \
55 called_ ## func = TRUE; \
58 #define CHECK_CALLED(func) \
60 ok(called_ ## func, "expected " #func "\n"); \
61 expect_ ## func = called_ ## func = FALSE; \
64 DEFINE_EXPECT(CombineUrl);
65 DEFINE_EXPECT(ParseUrl);
67 static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
68 static HRESULT (WINAPI *pCreateUriWithFragment)(LPCWSTR, LPCWSTR, DWORD, DWORD_PTR, IUri**);
69 static HRESULT (WINAPI *pCreateIUriBuilder)(IUri*, DWORD, DWORD_PTR, IUriBuilder**);
70 static HRESULT (WINAPI *pCoInternetCombineIUri)(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);
71 static HRESULT (WINAPI *pCoInternetGetSession)(DWORD,IInternetSession**,DWORD);
72 static HRESULT (WINAPI *pCoInternetCombineUrlEx)(IUri*,LPCWSTR,DWORD,IUri**,DWORD_PTR);
73 static HRESULT (WINAPI *pCoInternetParseIUri)(IUri*,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD_PTR);
74 static HRESULT (WINAPI *pCreateURLMonikerEx)(IMoniker*,LPCWSTR,IMoniker**,DWORD);
75 static HRESULT (WINAPI *pCreateURLMonikerEx2)(IMoniker*,IUri*,IMoniker**,DWORD);
77 static const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
78 '.','o','r','g','/',0};
79 static const WCHAR http_url_fragW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
80 '.','o','r','g','/','#','F','r','a','g',0};
82 static const WCHAR combine_baseW[] = {'w','i','n','e','t','e','s','t',':','?','t',
83 'e','s','t','i','n','g',0};
84 static const WCHAR combine_relativeW[] = {'?','t','e','s','t',0};
85 static const WCHAR combine_resultW[] = {'z','i','p',':','t','e','s','t',0};
87 static const WCHAR winetestW[] = {'w','i','n','e','t','e','s','t',0};
89 static const WCHAR parse_urlW[] = {'w','i','n','e','t','e','s','t',':','t','e','s','t',0};
90 static const WCHAR parse_resultW[] = {'z','i','p',':','t','e','s','t',0};
92 static PARSEACTION parse_action;
93 static DWORD parse_flags;
95 typedef struct _uri_create_flag_test {
98 } uri_create_flag_test;
100 static const uri_create_flag_test invalid_flag_tests[] = {
101 /* Set of invalid flag combinations to test for. */
102 {Uri_CREATE_DECODE_EXTRA_INFO | Uri_CREATE_NO_DECODE_EXTRA_INFO, E_INVALIDARG},
103 {Uri_CREATE_CANONICALIZE | Uri_CREATE_NO_CANONICALIZE, E_INVALIDARG},
104 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES | Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, E_INVALIDARG},
105 {Uri_CREATE_PRE_PROCESS_HTML_URI | Uri_CREATE_NO_PRE_PROCESS_HTML_URI, E_INVALIDARG},
106 {Uri_CREATE_IE_SETTINGS | Uri_CREATE_NO_IE_SETTINGS, E_INVALIDARG}
109 typedef struct _uri_str_property {
113 const char* broken_value;
116 typedef struct _uri_dword_property {
120 } uri_dword_property;
122 typedef struct _uri_properties {
125 HRESULT create_expected;
128 uri_str_property str_props[URI_STR_PROPERTY_COUNT];
129 uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT];
132 static const uri_properties uri_tests[] = {
133 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK, FALSE,
135 {"http://www.winehq.org/",S_OK,FALSE}, /* ABSOLUTE_URI */
136 {"www.winehq.org",S_OK,FALSE}, /* AUTHORITY */
137 {"http://www.winehq.org/",S_OK,FALSE}, /* DISPLAY_URI */
138 {"winehq.org",S_OK,FALSE}, /* DOMAIN */
139 {"",S_FALSE,FALSE}, /* EXTENSION */
140 {"",S_FALSE,FALSE}, /* FRAGMENT */
141 {"www.winehq.org",S_OK,FALSE}, /* HOST */
142 {"",S_FALSE,FALSE}, /* PASSWORD */
143 {"/",S_OK,FALSE}, /* PATH */
144 {"/",S_OK,FALSE}, /* PATH_AND_QUERY */
145 {"",S_FALSE,FALSE}, /* QUERY */
146 {"http://www.winehq.org/tests/../tests/../..",S_OK,FALSE}, /* RAW_URI */
147 {"http",S_OK,FALSE}, /* SCHEME_NAME */
148 {"",S_FALSE,FALSE}, /* USER_INFO */
149 {"",S_FALSE,FALSE} /* USER_NAME */
152 {Uri_HOST_DNS,S_OK,FALSE}, /* HOST_TYPE */
153 {80,S_OK,FALSE}, /* PORT */
154 {URL_SCHEME_HTTP,S_OK,FALSE}, /* SCHEME */
155 {URLZONE_INVALID,E_NOTIMPL,FALSE} /* ZONE */
158 { "http://winehq.org/tests/.././tests", 0, S_OK, FALSE,
160 {"http://winehq.org/tests",S_OK,FALSE},
161 {"winehq.org",S_OK,FALSE},
162 {"http://winehq.org/tests",S_OK,FALSE},
163 {"winehq.org",S_OK,FALSE},
166 {"winehq.org",S_OK,FALSE},
168 {"/tests",S_OK,FALSE},
169 {"/tests",S_OK,FALSE},
171 {"http://winehq.org/tests/.././tests",S_OK,FALSE},
177 {Uri_HOST_DNS,S_OK,FALSE},
179 {URL_SCHEME_HTTP,S_OK,FALSE},
180 {URLZONE_INVALID,E_NOTIMPL,FALSE}
183 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK, FALSE,
185 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
186 {"www.winehq.org",S_OK,FALSE},
187 {"http://www.winehq.org/?query=x&return=y",S_OK,FALSE},
188 {"winehq.org",S_OK,FALSE},
191 {"www.winehq.org",S_OK,FALSE},
194 {"/?query=x&return=y",S_OK,FALSE},
195 {"?query=x&return=y",S_OK,FALSE},
196 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK,FALSE},
202 {Uri_HOST_DNS,S_OK,FALSE},
204 {URL_SCHEME_HTTP,S_OK,FALSE},
205 {URLZONE_INVALID,E_NOTIMPL,FALSE},
208 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK, FALSE,
210 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
211 {"usEr%3Ainfo@example.com",S_OK,FALSE},
212 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
213 {"example.com",S_OK,FALSE},
216 {"example.com",S_OK,FALSE},
218 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
219 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,FALSE},
221 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK,FALSE},
223 {"usEr%3Ainfo",S_OK,FALSE},
224 {"usEr%3Ainfo",S_OK,FALSE}
227 {Uri_HOST_DNS,S_OK,FALSE},
229 {URL_SCHEME_HTTP,S_OK,FALSE},
230 {URLZONE_INVALID,E_NOTIMPL,FALSE},
233 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK, FALSE,
235 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
236 {"winepass:wine@ftp.winehq.org:9999",S_OK,FALSE},
237 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,FALSE},
238 {"winehq.org",S_OK,FALSE},
241 {"ftp.winehq.org",S_OK,FALSE},
243 {"/dir/foo%20bar.txt",S_OK,FALSE},
244 {"/dir/foo%20bar.txt",S_OK,FALSE},
246 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK,FALSE},
248 {"winepass:wine",S_OK,FALSE},
249 {"winepass",S_OK,FALSE}
252 {Uri_HOST_DNS,S_OK,FALSE},
254 {URL_SCHEME_FTP,S_OK,FALSE},
255 {URLZONE_INVALID,E_NOTIMPL,FALSE}
258 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK, FALSE,
260 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
262 {"file:///c:/tests/foo%2520bar.mp3",S_OK,FALSE},
268 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
269 {"/c:/tests/foo%2520bar.mp3",S_OK,FALSE},
271 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK,FALSE},
277 {Uri_HOST_UNKNOWN,S_OK,FALSE},
279 {URL_SCHEME_FILE,S_OK,FALSE},
280 {URLZONE_INVALID,E_NOTIMPL,FALSE}
283 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK, FALSE,
285 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
287 {"file:///tests/test%20file.README.txt",S_OK,FALSE},
293 {"/tests/test%20file.README.txt",S_OK,FALSE},
294 {"/tests/test%20file.README.txt",S_OK,FALSE},
296 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK,FALSE},
302 {Uri_HOST_UNKNOWN,S_OK,FALSE},
304 {URL_SCHEME_FILE,S_OK,FALSE},
305 {URLZONE_INVALID,E_NOTIMPL,FALSE}
308 { "urn:nothing:should:happen here", 0, S_OK, FALSE,
310 {"urn:nothing:should:happen here",S_OK,FALSE},
312 {"urn:nothing:should:happen here",S_OK,FALSE},
318 {"nothing:should:happen here",S_OK,FALSE},
319 {"nothing:should:happen here",S_OK,FALSE},
321 {"urn:nothing:should:happen here",S_OK,FALSE},
327 {Uri_HOST_UNKNOWN,S_OK,FALSE},
329 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
330 {URLZONE_INVALID,E_NOTIMPL,FALSE}
333 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK, FALSE,
335 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
336 {"127.0.0.1",S_OK,FALSE},
337 {"http://127.0.0.1/test%20dir/test.txt",S_OK,FALSE},
341 {"127.0.0.1",S_OK,FALSE},
343 {"/test%20dir/test.txt",S_OK,FALSE},
344 {"/test%20dir/test.txt",S_OK,FALSE},
346 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK,FALSE},
352 {Uri_HOST_IPV4,S_OK,FALSE},
354 {URL_SCHEME_HTTP,S_OK,FALSE},
355 {URLZONE_INVALID,E_NOTIMPL,FALSE}
358 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK, FALSE,
360 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
361 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,FALSE},
362 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,FALSE},
366 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK,FALSE},
371 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK,FALSE},
377 {Uri_HOST_IPV6,S_OK,FALSE},
379 {URL_SCHEME_HTTP,S_OK,FALSE},
380 {URLZONE_INVALID,E_NOTIMPL,FALSE}
383 { "ftp://[::13.1.68.3]", 0, S_OK, FALSE,
385 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
386 {"[::13.1.68.3]",S_OK,FALSE},
387 {"ftp://[::13.1.68.3]/",S_OK,FALSE},
391 {"::13.1.68.3",S_OK,FALSE},
396 {"ftp://[::13.1.68.3]",S_OK,FALSE},
402 {Uri_HOST_IPV6,S_OK,FALSE},
404 {URL_SCHEME_FTP,S_OK,FALSE},
405 {URLZONE_INVALID,E_NOTIMPL,FALSE}
408 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK, FALSE,
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,
435 {"1234://www.winehq.org/",S_OK,FALSE},
436 {"www.winehq.org",S_OK,FALSE},
437 {"1234://www.winehq.org/",S_OK,FALSE},
438 {"winehq.org",S_OK,FALSE},
441 {"www.winehq.org",S_OK,FALSE},
446 {"1234://www.winehq.org",S_OK,FALSE},
452 {Uri_HOST_DNS,S_OK,FALSE},
454 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
455 {URLZONE_INVALID,E_NOTIMPL,FALSE}
458 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
459 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
461 {"file:///C:/test/test.mp3",S_OK,FALSE},
463 {"file:///C:/test/test.mp3",S_OK,FALSE},
469 {"/C:/test/test.mp3",S_OK,FALSE},
470 {"/C:/test/test.mp3",S_OK,FALSE},
472 {"C:/test/test.mp3",S_OK,FALSE},
478 {Uri_HOST_UNKNOWN,S_OK,FALSE},
480 {URL_SCHEME_FILE,S_OK,FALSE},
481 {URLZONE_INVALID,E_NOTIMPL,FALSE}
484 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
485 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, S_OK, FALSE,
487 {"file://server/test.mp3",S_OK,FALSE},
488 {"server",S_OK,FALSE},
489 {"file://server/test.mp3",S_OK,FALSE},
493 {"server",S_OK,FALSE},
495 {"/test.mp3",S_OK,FALSE},
496 {"/test.mp3",S_OK,FALSE},
498 {"\\\\Server/test.mp3",S_OK,FALSE},
504 {Uri_HOST_DNS,S_OK,FALSE},
506 {URL_SCHEME_FILE,S_OK,FALSE},
507 {URLZONE_INVALID,E_NOTIMPL,FALSE}
510 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
512 {"*:www.winehq.org/test",S_OK,FALSE},
513 {"www.winehq.org",S_OK,FALSE},
514 {"*:www.winehq.org/test",S_OK,FALSE},
515 {"winehq.org",S_OK,FALSE},
518 {"www.winehq.org",S_OK,FALSE},
520 {"/test",S_OK,FALSE},
521 {"/test",S_OK,FALSE},
523 {"www.winehq.org/test",S_OK,FALSE},
529 {Uri_HOST_DNS,S_OK,FALSE},
531 {URL_SCHEME_WILDCARD,S_OK,FALSE},
532 {URLZONE_INVALID,E_NOTIMPL,FALSE}
535 /* Valid since the '*' is the only character in the scheme name. */
536 { "*:www.winehq.org/test", 0, S_OK, FALSE,
538 {"*:www.winehq.org/test",S_OK,FALSE},
539 {"www.winehq.org",S_OK,FALSE},
540 {"*:www.winehq.org/test",S_OK,FALSE},
541 {"winehq.org",S_OK,FALSE},
544 {"www.winehq.org",S_OK,FALSE},
546 {"/test",S_OK,FALSE},
547 {"/test",S_OK,FALSE},
549 {"*:www.winehq.org/test",S_OK,FALSE},
555 {Uri_HOST_DNS,S_OK,FALSE},
557 {URL_SCHEME_WILDCARD,S_OK,FALSE},
558 {URLZONE_INVALID,E_NOTIMPL,FALSE}
561 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE,
563 {"/../some dir/test.ext",S_OK,FALSE},
565 {"/../some dir/test.ext",S_OK,FALSE},
571 {"/../some dir/test.ext",S_OK,FALSE},
572 {"/../some dir/test.ext",S_OK,FALSE},
574 {"/../some dir/test.ext",S_OK,FALSE},
580 {Uri_HOST_UNKNOWN,S_OK,FALSE},
582 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
583 {URLZONE_INVALID,E_NOTIMPL,FALSE}
586 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME, S_OK, FALSE,
588 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
590 {"*://implicit/wildcard/uri%20scheme",S_OK,FALSE},
596 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
597 {"//implicit/wildcard/uri%20scheme",S_OK,FALSE},
599 {"//implicit/wildcard/uri scheme",S_OK,FALSE},
605 {Uri_HOST_UNKNOWN,S_OK,FALSE},
607 {URL_SCHEME_WILDCARD,S_OK,FALSE},
608 {URLZONE_INVALID,E_NOTIMPL,FALSE}
611 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and its an unknown scheme. */
612 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES, S_OK, FALSE,
614 {"zip:/.//google.com",S_OK,FALSE},
616 {"zip:/.//google.com",S_OK,FALSE},
622 {"/.//google.com",S_OK,FALSE},
623 {"/.//google.com",S_OK,FALSE},
625 {"zip://google.com",S_OK,FALSE},
631 {Uri_HOST_UNKNOWN,S_OK,FALSE},
633 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
634 {URLZONE_INVALID,E_NOTIMPL,FALSE}
637 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
638 { "ftp://user:pass:word@winehq.org/", 0, S_OK, FALSE,
640 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
641 {"user:pass:word@winehq.org",S_OK,FALSE},
642 {"ftp://winehq.org/",S_OK,FALSE},
643 {"winehq.org",S_OK,FALSE},
646 {"winehq.org",S_OK,FALSE},
647 {"pass:word",S_OK,FALSE},
651 {"ftp://user:pass:word@winehq.org/",S_OK,FALSE},
653 {"user:pass:word",S_OK,FALSE},
657 {Uri_HOST_DNS,S_OK,FALSE},
659 {URL_SCHEME_FTP,S_OK,FALSE},
660 {URLZONE_INVALID,E_NOTIMPL,FALSE}
663 /* Make sure % encoded unreserved characters are decoded. */
664 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK, FALSE,
666 {"ftp://wINe:PASS@ftp.google.com/",S_OK,FALSE},
667 {"wINe:PASS@ftp.google.com",S_OK,FALSE},
668 {"ftp://ftp.google.com/",S_OK,FALSE},
669 {"google.com",S_OK,FALSE},
672 {"ftp.google.com",S_OK,FALSE},
677 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE},
679 {"wINe:PASS",S_OK,FALSE},
683 {Uri_HOST_DNS,S_OK,FALSE},
685 {URL_SCHEME_FTP,S_OK,FALSE},
686 {URLZONE_INVALID,E_NOTIMPL,FALSE}
689 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
690 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK, FALSE,
692 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
693 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,FALSE},
694 {"ftp://ftp.google.com/",S_OK,FALSE},
695 {"google.com",S_OK,FALSE},
698 {"ftp.google.com",S_OK,FALSE},
699 {"PA%7B%7D",S_OK,FALSE},
703 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
705 {"w%5D%5Be:PA%7B%7D",S_OK,FALSE},
706 {"w%5D%5Be",S_OK,FALSE}
709 {Uri_HOST_DNS,S_OK,FALSE},
711 {URL_SCHEME_FTP,S_OK,FALSE},
712 {URLZONE_INVALID,E_NOTIMPL,FALSE}
715 /* You're allowed to have an empty password portion in the userinfo section. */
716 { "ftp://empty:@ftp.google.com/", 0, S_OK, FALSE,
718 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
719 {"empty:@ftp.google.com",S_OK,FALSE},
720 {"ftp://ftp.google.com/",S_OK,FALSE},
721 {"google.com",S_OK,FALSE},
724 {"ftp.google.com",S_OK,FALSE},
729 {"ftp://empty:@ftp.google.com/",S_OK,FALSE},
731 {"empty:",S_OK,FALSE},
735 {Uri_HOST_DNS,S_OK,FALSE},
737 {URL_SCHEME_FTP,S_OK,FALSE},
738 {URLZONE_INVALID,E_NOTIMPL,FALSE}
741 /* Make sure forbidden characters in "userinfo" get encoded. */
742 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK, FALSE,
744 {"ftp://%22%20%22weird@ftp.google.com/",S_OK,FALSE},
745 {"%22%20%22weird@ftp.google.com",S_OK,FALSE},
746 {"ftp://ftp.google.com/",S_OK,FALSE},
747 {"google.com",S_OK,FALSE},
750 {"ftp.google.com",S_OK,FALSE},
755 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
757 {"%22%20%22weird",S_OK,FALSE},
758 {"%22%20%22weird",S_OK,FALSE}
761 {Uri_HOST_DNS,S_OK,FALSE},
763 {URL_SCHEME_FTP,S_OK,FALSE},
764 {URLZONE_INVALID,E_NOTIMPL,FALSE}
767 /* Make sure the forbidden characters don't get percent encoded. */
768 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
770 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
771 {"\" \"weird@ftp.google.com",S_OK,FALSE},
772 {"ftp://ftp.google.com/",S_OK,FALSE},
773 {"google.com",S_OK,FALSE},
776 {"ftp.google.com",S_OK,FALSE},
781 {"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
783 {"\" \"weird",S_OK,FALSE},
784 {"\" \"weird",S_OK,FALSE}
787 {Uri_HOST_DNS,S_OK,FALSE},
789 {URL_SCHEME_FTP,S_OK,FALSE},
790 {URLZONE_INVALID,E_NOTIMPL,FALSE}
793 /* Make sure already percent encoded characters don't get unencoded. */
794 { "ftp://\"%20\"weird@ftp.google.com/\"%20\"weird", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
796 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
797 {"\"%20\"weird@ftp.google.com",S_OK,FALSE},
798 {"ftp://ftp.google.com/\"%20\"weird",S_OK,FALSE},
799 {"google.com",S_OK,FALSE},
802 {"ftp.google.com",S_OK,FALSE},
804 {"/\"%20\"weird",S_OK,FALSE},
805 {"/\"%20\"weird",S_OK,FALSE},
807 {"ftp://\"%20\"weird@ftp.google.com/\"%20\"weird",S_OK,FALSE},
809 {"\"%20\"weird",S_OK,FALSE},
810 {"\"%20\"weird",S_OK,FALSE}
813 {Uri_HOST_DNS,S_OK,FALSE},
815 {URL_SCHEME_FTP,S_OK,FALSE},
816 {URLZONE_INVALID,E_NOTIMPL,FALSE}
819 /* Allowed to have invalid % encoded because its an unknown scheme type. */
820 { "zip://%xy:word@winehq.org/", 0, S_OK, FALSE,
822 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
823 {"%xy:word@winehq.org",S_OK,FALSE},
824 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
825 {"winehq.org",S_OK,FALSE},
828 {"winehq.org",S_OK,FALSE},
833 {"zip://%xy:word@winehq.org/",S_OK,FALSE},
835 {"%xy:word",S_OK,FALSE},
839 {Uri_HOST_DNS,S_OK,FALSE},
841 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
842 {URLZONE_INVALID,E_NOTIMPL,FALSE}
845 /* Unreserved, percent encoded characters aren't decoded in the userinfo because the scheme
848 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK, FALSE,
850 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
851 {"%2E:%52%53ord@winehq.org",S_OK,FALSE},
852 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
853 {"winehq.org",S_OK,FALSE},
856 {"winehq.org",S_OK,FALSE},
857 {"%52%53ord",S_OK,FALSE},
861 {"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
863 {"%2E:%52%53ord",S_OK,FALSE},
867 {Uri_HOST_DNS,S_OK,FALSE},
869 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
870 {URLZONE_INVALID,E_NOTIMPL,FALSE}
873 { "ftp://[](),'test':word@winehq.org/", 0, S_OK, FALSE,
875 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
876 {"[](),'test':word@winehq.org",S_OK,FALSE},
877 {"ftp://winehq.org/",S_OK,FALSE},
878 {"winehq.org",S_OK,FALSE},
881 {"winehq.org",S_OK,FALSE},
886 {"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
888 {"[](),'test':word",S_OK,FALSE},
889 {"[](),'test'",S_OK,FALSE}
892 {Uri_HOST_DNS,S_OK,FALSE},
894 {URL_SCHEME_FTP,S_OK,FALSE},
895 {URLZONE_INVALID,E_NOTIMPL,FALSE}
898 { "ftp://test?:word@winehq.org/", 0, S_OK, FALSE,
900 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
902 {"ftp://test/?:word@winehq.org/",S_OK,FALSE},
909 {"/?:word@winehq.org/",S_OK,FALSE},
910 {"?:word@winehq.org/",S_OK,FALSE},
911 {"ftp://test?:word@winehq.org/",S_OK,FALSE},
917 {Uri_HOST_DNS,S_OK,FALSE},
919 {URL_SCHEME_FTP,S_OK,FALSE},
920 {URLZONE_INVALID,E_NOTIMPL,FALSE}
923 { "ftp://test#:word@winehq.org/", 0, S_OK, FALSE,
925 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
927 {"ftp://test/#:word@winehq.org/",S_OK,FALSE},
930 {"#:word@winehq.org/",S_OK,FALSE},
936 {"ftp://test#:word@winehq.org/",S_OK,FALSE},
942 {Uri_HOST_DNS,S_OK,FALSE},
944 {URL_SCHEME_FTP,S_OK,FALSE},
945 {URLZONE_INVALID,E_NOTIMPL,FALSE}
948 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
949 { "zip://test\\:word@winehq.org/", 0, S_OK, FALSE,
951 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
952 {"test\\:word@winehq.org",S_OK,FALSE},
953 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
954 {"winehq.org",S_OK,FALSE},
957 {"winehq.org",S_OK,FALSE},
962 {"zip://test\\:word@winehq.org/",S_OK,FALSE},
964 {"test\\:word",S_OK,FALSE},
965 {"test\\",S_OK,FALSE}
968 {Uri_HOST_DNS,S_OK,FALSE},
970 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
971 {URLZONE_INVALID,E_NOTIMPL,FALSE}
974 /* It normalizes IPv4 addresses correctly. */
975 { "http://127.000.000.100/", 0, S_OK, FALSE,
977 {"http://127.0.0.100/",S_OK,FALSE},
978 {"127.0.0.100",S_OK,FALSE},
979 {"http://127.0.0.100/",S_OK,FALSE},
983 {"127.0.0.100",S_OK,FALSE},
988 {"http://127.000.000.100/",S_OK,FALSE},
994 {Uri_HOST_IPV4,S_OK,FALSE},
996 {URL_SCHEME_HTTP,S_OK,FALSE},
997 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1000 { "http://127.0.0.1:8000", 0, S_OK, FALSE,
1002 {"http://127.0.0.1:8000/",S_OK},
1003 {"127.0.0.1:8000",S_OK},
1004 {"http://127.0.0.1:8000/",S_OK},
1013 {"http://127.0.0.1:8000",S_OK},
1019 {Uri_HOST_IPV4,S_OK,FALSE},
1021 {URL_SCHEME_HTTP,S_OK,FALSE},
1022 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1025 /* Make sure it normalizes partial IPv4 addresses correctly. */
1026 { "http://127.0/", 0, S_OK, FALSE,
1028 {"http://127.0.0.0/",S_OK,FALSE},
1029 {"127.0.0.0",S_OK,FALSE},
1030 {"http://127.0.0.0/",S_OK,FALSE},
1034 {"127.0.0.0",S_OK,FALSE},
1039 {"http://127.0/",S_OK,FALSE},
1040 {"http",S_OK,FALSE},
1045 {Uri_HOST_IPV4,S_OK,FALSE},
1047 {URL_SCHEME_HTTP,S_OK,FALSE},
1048 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1051 /* Make sure it converts implicit IPv4's correctly. */
1052 { "http://123456/", 0, S_OK, FALSE,
1054 {"http://0.1.226.64/",S_OK,FALSE},
1055 {"0.1.226.64",S_OK,FALSE},
1056 {"http://0.1.226.64/",S_OK,FALSE},
1060 {"0.1.226.64",S_OK,FALSE},
1065 {"http://123456/",S_OK,FALSE},
1066 {"http",S_OK,FALSE},
1071 {Uri_HOST_IPV4,S_OK,FALSE},
1073 {URL_SCHEME_HTTP,S_OK,FALSE},
1074 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1078 { "http://4294967295/", 0, S_OK, FALSE,
1080 {"http://255.255.255.255/",S_OK,FALSE},
1081 {"255.255.255.255",S_OK,FALSE},
1082 {"http://255.255.255.255/",S_OK,FALSE},
1086 {"255.255.255.255",S_OK,FALSE},
1091 {"http://4294967295/",S_OK,FALSE},
1092 {"http",S_OK,FALSE},
1097 {Uri_HOST_IPV4,S_OK,FALSE},
1099 {URL_SCHEME_HTTP,S_OK,FALSE},
1100 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1104 { "http://4294967296/", 0, S_OK, FALSE,
1106 {"http://4294967296/",S_OK,FALSE},
1107 {"4294967296",S_OK,FALSE},
1108 {"http://4294967296/",S_OK,FALSE},
1112 {"4294967296",S_OK,FALSE},
1117 {"http://4294967296/",S_OK,FALSE},
1118 {"http",S_OK,FALSE},
1123 {Uri_HOST_DNS,S_OK,FALSE},
1125 {URL_SCHEME_HTTP,S_OK,FALSE},
1126 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1129 /* Window's doesn't normalize IP address for unknown schemes. */
1130 { "1234://4294967295/", 0, S_OK, FALSE,
1132 {"1234://4294967295/",S_OK,FALSE},
1133 {"4294967295",S_OK,FALSE},
1134 {"1234://4294967295/",S_OK,FALSE},
1138 {"4294967295",S_OK,FALSE},
1143 {"1234://4294967295/",S_OK,FALSE},
1144 {"1234",S_OK,FALSE},
1149 {Uri_HOST_IPV4,S_OK,FALSE},
1151 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1152 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1155 /* Window's doesn't normalize IP address for unknown schemes. */
1156 { "1234://127.001/", 0, S_OK, FALSE,
1158 {"1234://127.001/",S_OK,FALSE},
1159 {"127.001",S_OK,FALSE},
1160 {"1234://127.001/",S_OK,FALSE},
1164 {"127.001",S_OK,FALSE},
1169 {"1234://127.001/",S_OK,FALSE},
1170 {"1234",S_OK,FALSE},
1175 {Uri_HOST_IPV4,S_OK,FALSE},
1177 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1178 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1181 { "http://[FEDC:BA98::3210]", 0, S_OK, FALSE,
1183 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1184 {"[fedc:ba98::3210]",S_OK,FALSE},
1185 {"http://[fedc:ba98::3210]/",S_OK,FALSE},
1189 {"fedc:ba98::3210",S_OK,FALSE},
1194 {"http://[FEDC:BA98::3210]",S_OK,FALSE},
1195 {"http",S_OK,FALSE},
1200 {Uri_HOST_IPV6,S_OK,FALSE},
1202 {URL_SCHEME_HTTP,S_OK,FALSE},
1203 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1206 { "http://[::]", 0, S_OK, FALSE,
1208 {"http://[::]/",S_OK,FALSE},
1209 {"[::]",S_OK,FALSE},
1210 {"http://[::]/",S_OK,FALSE},
1219 {"http://[::]",S_OK,FALSE},
1220 {"http",S_OK,FALSE},
1225 {Uri_HOST_IPV6,S_OK,FALSE},
1227 {URL_SCHEME_HTTP,S_OK,FALSE},
1228 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1231 { "http://[FEDC:BA98::]", 0, S_OK, FALSE,
1233 {"http://[fedc:ba98::]/",S_OK,FALSE},
1234 {"[fedc:ba98::]",S_OK,FALSE},
1235 {"http://[fedc:ba98::]/",S_OK,FALSE},
1239 {"fedc:ba98::",S_OK,FALSE},
1244 {"http://[FEDC:BA98::]",S_OK,FALSE},
1245 {"http",S_OK,FALSE},
1250 {Uri_HOST_IPV6,S_OK,FALSE},
1252 {URL_SCHEME_HTTP,S_OK,FALSE},
1253 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1256 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1257 { "http://[1::3:4:5:6:7:8]", 0, S_OK, FALSE,
1259 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1260 {"[1:0:3:4:5:6:7:8]",S_OK,FALSE},
1261 {"http://[1:0:3:4:5:6:7:8]/",S_OK,FALSE},
1265 {"1:0:3:4:5:6:7:8",S_OK,FALSE},
1270 {"http://[1::3:4:5:6:7:8]",S_OK,FALSE},
1271 {"http",S_OK,FALSE},
1276 {Uri_HOST_IPV6,S_OK,FALSE},
1278 {URL_SCHEME_HTTP,S_OK,FALSE},
1279 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1282 { "http://[v2.34]/", 0, S_OK, FALSE,
1284 {"http://[v2.34]/",S_OK,FALSE},
1285 {"[v2.34]",S_OK,FALSE},
1286 {"http://[v2.34]/",S_OK,FALSE},
1290 {"[v2.34]",S_OK,FALSE},
1295 {"http://[v2.34]/",S_OK,FALSE},
1296 {"http",S_OK,FALSE},
1301 {Uri_HOST_UNKNOWN,S_OK,FALSE},
1303 {URL_SCHEME_HTTP,S_OK,FALSE},
1304 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1307 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1308 { "http://[xyz:12345.com/test", 0, S_OK, FALSE,
1310 {"http://[xyz:12345.com/test",S_OK,FALSE},
1311 {"[xyz:12345.com",S_OK,FALSE},
1312 {"http://[xyz:12345.com/test",S_OK,FALSE},
1313 {"[xyz:12345.com",S_OK,FALSE},
1316 {"[xyz:12345.com",S_OK,FALSE},
1318 {"/test",S_OK,FALSE},
1319 {"/test",S_OK,FALSE},
1321 {"http://[xyz:12345.com/test",S_OK,FALSE},
1322 {"http",S_OK,FALSE},
1327 {Uri_HOST_DNS,S_OK,FALSE},
1329 {URL_SCHEME_HTTP,S_OK,FALSE},
1330 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1333 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1334 * of the host name (respectively).
1336 { "ftp://www.[works].com/", 0, S_OK, FALSE,
1338 {"ftp://www.[works].com/",S_OK,FALSE},
1339 {"www.[works].com",S_OK,FALSE},
1340 {"ftp://www.[works].com/",S_OK,FALSE},
1341 {"[works].com",S_OK,FALSE},
1344 {"www.[works].com",S_OK,FALSE},
1349 {"ftp://www.[works].com/",S_OK,FALSE},
1355 {Uri_HOST_DNS,S_OK,FALSE},
1357 {URL_SCHEME_FTP,S_OK,FALSE},
1358 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1361 /* Considers ':' a delimiter since it appears after the ']'. */
1362 { "http://www.google.com]:12345/", 0, S_OK, FALSE,
1364 {"http://www.google.com]:12345/",S_OK,FALSE},
1365 {"www.google.com]:12345",S_OK,FALSE},
1366 {"http://www.google.com]:12345/",S_OK,FALSE},
1367 {"google.com]",S_OK,FALSE},
1370 {"www.google.com]",S_OK,FALSE},
1375 {"http://www.google.com]:12345/",S_OK,FALSE},
1376 {"http",S_OK,FALSE},
1381 {Uri_HOST_DNS,S_OK,FALSE},
1383 {URL_SCHEME_HTTP,S_OK,FALSE},
1384 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1387 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1388 { "zip://w%XXw%GEw.google.com/", 0, S_OK, FALSE,
1390 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1391 {"w%XXw%GEw.google.com",S_OK,FALSE},
1392 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1393 {"google.com",S_OK,FALSE},
1396 {"w%XXw%GEw.google.com",S_OK,FALSE},
1401 {"zip://w%XXw%GEw.google.com/",S_OK,FALSE},
1407 {Uri_HOST_DNS,S_OK,FALSE},
1409 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1410 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1413 /* Unknown scheme types hostname doesn't get lower cased. */
1414 { "zip://GOOGLE.com/", 0, S_OK, FALSE,
1416 {"zip://GOOGLE.com/",S_OK,FALSE},
1417 {"GOOGLE.com",S_OK,FALSE},
1418 {"zip://GOOGLE.com/",S_OK,FALSE},
1419 {"GOOGLE.com",S_OK,FALSE},
1422 {"GOOGLE.com",S_OK,FALSE},
1427 {"zip://GOOGLE.com/",S_OK,FALSE},
1433 {Uri_HOST_DNS,S_OK,FALSE},
1435 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1436 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1439 /* Hostname gets lower-cased for known scheme types. */
1440 { "http://WWW.GOOGLE.com/", 0, S_OK, FALSE,
1442 {"http://www.google.com/",S_OK,FALSE},
1443 {"www.google.com",S_OK,FALSE},
1444 {"http://www.google.com/",S_OK,FALSE},
1445 {"google.com",S_OK,FALSE},
1448 {"www.google.com",S_OK,FALSE},
1453 {"http://WWW.GOOGLE.com/",S_OK,FALSE},
1454 {"http",S_OK,FALSE},
1459 {Uri_HOST_DNS,S_OK,FALSE},
1461 {URL_SCHEME_HTTP,S_OK,FALSE},
1462 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1465 /* Characters that get % encoded in the hostname also have their percent
1466 * encoded forms lower cased.
1468 { "http://www.%7Cgoogle|.com/", 0, S_OK, FALSE,
1470 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1471 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1472 {"http://www.%7cgoogle%7c.com/",S_OK,FALSE},
1473 {"%7cgoogle%7c.com",S_OK,FALSE},
1476 {"www.%7cgoogle%7c.com",S_OK,FALSE},
1481 {"http://www.%7Cgoogle|.com/",S_OK,FALSE},
1482 {"http",S_OK,FALSE},
1487 {Uri_HOST_DNS,S_OK,FALSE},
1489 {URL_SCHEME_HTTP,S_OK,FALSE},
1490 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1493 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1494 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK, FALSE,
1496 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1497 {"[1:2:3:4:5:6::]",S_OK,FALSE},
1498 {"http://[1:2:3:4:5:6::]/",S_OK,FALSE},
1502 {"1:2:3:4:5:6::",S_OK,FALSE},
1507 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK,FALSE},
1508 {"http",S_OK,FALSE},
1513 {Uri_HOST_IPV6,S_OK,FALSE},
1515 {URL_SCHEME_HTTP,S_OK,FALSE},
1516 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1519 /* IPv4 addresses get normalized. */
1520 { "http://[::001.002.003.000]", 0, S_OK, FALSE,
1522 {"http://[::1.2.3.0]/",S_OK,FALSE},
1523 {"[::1.2.3.0]",S_OK,FALSE},
1524 {"http://[::1.2.3.0]/",S_OK,FALSE},
1528 {"::1.2.3.0",S_OK,FALSE},
1533 {"http://[::001.002.003.000]",S_OK,FALSE},
1534 {"http",S_OK,FALSE},
1539 {Uri_HOST_IPV6,S_OK,FALSE},
1541 {URL_SCHEME_HTTP,S_OK,FALSE},
1542 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1545 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1546 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK, FALSE,
1548 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1549 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1550 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,FALSE},
1554 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK,FALSE},
1559 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
1565 {Uri_HOST_IPV6,S_OK,FALSE},
1567 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1568 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1571 /* IPv4 address is converted into 2 h16 components. */
1572 { "http://[ffff::192.222.111.32]", 0, S_OK, FALSE,
1574 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1575 {"[ffff::c0de:6f20]",S_OK,FALSE},
1576 {"http://[ffff::c0de:6f20]/",S_OK,FALSE},
1580 {"ffff::c0de:6f20",S_OK,FALSE},
1585 {"http://[ffff::192.222.111.32]",S_OK,FALSE},
1586 {"http",S_OK,FALSE},
1591 {Uri_HOST_IPV6,S_OK,FALSE},
1593 {URL_SCHEME_HTTP,S_OK,FALSE},
1594 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1597 /* Max value for a port. */
1598 { "http://google.com:65535", 0, S_OK, FALSE,
1600 {"http://google.com:65535/",S_OK,FALSE},
1601 {"google.com:65535",S_OK,FALSE},
1602 {"http://google.com:65535/",S_OK,FALSE},
1603 {"google.com",S_OK,FALSE},
1606 {"google.com",S_OK,FALSE},
1611 {"http://google.com:65535",S_OK,FALSE},
1612 {"http",S_OK,FALSE},
1617 {Uri_HOST_DNS,S_OK,FALSE},
1619 {URL_SCHEME_HTTP,S_OK,FALSE},
1620 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1623 { "zip://google.com:65536", 0, S_OK, FALSE,
1625 {"zip://google.com:65536/",S_OK,FALSE},
1626 {"google.com:65536",S_OK,FALSE},
1627 {"zip://google.com:65536/",S_OK,FALSE},
1628 {"google.com:65536",S_OK,FALSE},
1631 {"google.com:65536",S_OK,FALSE},
1636 {"zip://google.com:65536",S_OK,FALSE},
1642 {Uri_HOST_DNS,S_OK,FALSE},
1644 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1645 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1648 { "zip://google.com:65536:25", 0, S_OK, FALSE,
1650 {"zip://google.com:65536:25/",S_OK,FALSE},
1651 {"google.com:65536:25",S_OK,FALSE},
1652 {"zip://google.com:65536:25/",S_OK,FALSE},
1653 {"google.com:65536:25",S_OK,FALSE},
1656 {"google.com:65536:25",S_OK,FALSE},
1661 {"zip://google.com:65536:25",S_OK,FALSE},
1667 {Uri_HOST_DNS,S_OK,FALSE},
1669 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1670 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1673 { "zip://[::ffff]:abcd", 0, S_OK, FALSE,
1675 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1676 {"[::ffff]:abcd",S_OK,FALSE},
1677 {"zip://[::ffff]:abcd/",S_OK,FALSE},
1681 {"[::ffff]:abcd",S_OK,FALSE},
1686 {"zip://[::ffff]:abcd",S_OK,FALSE},
1692 {Uri_HOST_DNS,S_OK,FALSE},
1694 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1695 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1698 { "zip://127.0.0.1:abcd", 0, S_OK, FALSE,
1700 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1701 {"127.0.0.1:abcd",S_OK,FALSE},
1702 {"zip://127.0.0.1:abcd/",S_OK,FALSE},
1703 {"0.1:abcd",S_OK,FALSE},
1706 {"127.0.0.1:abcd",S_OK,FALSE},
1711 {"zip://127.0.0.1:abcd",S_OK,FALSE},
1717 {Uri_HOST_DNS,S_OK,FALSE},
1719 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
1720 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1723 /* Port is just copied over. */
1724 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1726 {"http://google.com:00035",S_OK,FALSE},
1727 {"google.com:00035",S_OK,FALSE},
1728 {"http://google.com:00035",S_OK,FALSE,"http://google.com:35"},
1729 {"google.com",S_OK,FALSE},
1732 {"google.com",S_OK,FALSE},
1737 {"http://google.com:00035",S_OK,FALSE},
1738 {"http",S_OK,FALSE},
1743 {Uri_HOST_DNS,S_OK,FALSE},
1745 {URL_SCHEME_HTTP,S_OK,FALSE},
1746 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1749 /* Default port is copied over. */
1750 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
1752 {"http://google.com:80",S_OK,FALSE},
1753 {"google.com:80",S_OK,FALSE},
1754 {"http://google.com:80",S_OK,FALSE},
1755 {"google.com",S_OK,FALSE},
1758 {"google.com",S_OK,FALSE},
1763 {"http://google.com:80",S_OK,FALSE},
1764 {"http",S_OK,FALSE},
1769 {Uri_HOST_DNS,S_OK,FALSE},
1771 {URL_SCHEME_HTTP,S_OK,FALSE},
1772 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1775 { "http://google.com.uk", 0, S_OK, FALSE,
1777 {"http://google.com.uk/",S_OK,FALSE},
1778 {"google.com.uk",S_OK,FALSE},
1779 {"http://google.com.uk/",S_OK,FALSE},
1780 {"google.com.uk",S_OK,FALSE},
1783 {"google.com.uk",S_OK,FALSE},
1788 {"http://google.com.uk",S_OK,FALSE},
1789 {"http",S_OK,FALSE},
1794 {Uri_HOST_DNS,S_OK,FALSE},
1796 {URL_SCHEME_HTTP,S_OK,FALSE},
1797 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1800 { "http://google.com.com", 0, S_OK, FALSE,
1802 {"http://google.com.com/",S_OK,FALSE},
1803 {"google.com.com",S_OK,FALSE},
1804 {"http://google.com.com/",S_OK,FALSE},
1805 {"com.com",S_OK,FALSE},
1808 {"google.com.com",S_OK,FALSE},
1813 {"http://google.com.com",S_OK,FALSE},
1814 {"http",S_OK,FALSE},
1819 {Uri_HOST_DNS,S_OK,FALSE},
1821 {URL_SCHEME_HTTP,S_OK,FALSE},
1822 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1825 { "http://google.uk.1", 0, S_OK, FALSE,
1827 {"http://google.uk.1/",S_OK,FALSE},
1828 {"google.uk.1",S_OK,FALSE},
1829 {"http://google.uk.1/",S_OK,FALSE},
1830 {"google.uk.1",S_OK,FALSE},
1833 {"google.uk.1",S_OK,FALSE},
1838 {"http://google.uk.1",S_OK,FALSE},
1839 {"http",S_OK,FALSE},
1844 {Uri_HOST_DNS,S_OK,FALSE},
1846 {URL_SCHEME_HTTP,S_OK,FALSE},
1847 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1850 /* Since foo isn't a recognized 3 character TLD its considered the domain name. */
1851 { "http://google.foo.uk", 0, S_OK, FALSE,
1853 {"http://google.foo.uk/",S_OK,FALSE},
1854 {"google.foo.uk",S_OK,FALSE},
1855 {"http://google.foo.uk/",S_OK,FALSE},
1856 {"foo.uk",S_OK,FALSE},
1859 {"google.foo.uk",S_OK,FALSE},
1864 {"http://google.foo.uk",S_OK,FALSE},
1865 {"http",S_OK,FALSE},
1870 {Uri_HOST_DNS,S_OK,FALSE},
1872 {URL_SCHEME_HTTP,S_OK,FALSE},
1873 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1876 { "http://.com", 0, S_OK, FALSE,
1878 {"http://.com/",S_OK,FALSE},
1879 {".com",S_OK,FALSE},
1880 {"http://.com/",S_OK,FALSE},
1881 {".com",S_OK,FALSE},
1884 {".com",S_OK,FALSE},
1889 {"http://.com",S_OK,FALSE},
1890 {"http",S_OK,FALSE},
1895 {Uri_HOST_DNS,S_OK,FALSE},
1897 {URL_SCHEME_HTTP,S_OK,FALSE},
1898 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1901 { "http://.uk", 0, S_OK, FALSE,
1903 {"http://.uk/",S_OK,FALSE},
1905 {"http://.uk/",S_OK,FALSE},
1914 {"http://.uk",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://www.co.google.com.[]", 0, S_OK, FALSE,
1928 {"http://www.co.google.com.[]/",S_OK,FALSE},
1929 {"www.co.google.com.[]",S_OK,FALSE},
1930 {"http://www.co.google.com.[]/",S_OK,FALSE},
1931 {"google.com.[]",S_OK,FALSE},
1934 {"www.co.google.com.[]",S_OK,FALSE},
1939 {"http://www.co.google.com.[]",S_OK,FALSE},
1940 {"http",S_OK,FALSE},
1945 {Uri_HOST_DNS,S_OK,FALSE},
1947 {URL_SCHEME_HTTP,S_OK,FALSE},
1948 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1951 { "http://co.uk", 0, S_OK, FALSE,
1953 {"http://co.uk/",S_OK,FALSE},
1954 {"co.uk",S_OK,FALSE},
1955 {"http://co.uk/",S_OK,FALSE},
1959 {"co.uk",S_OK,FALSE},
1964 {"http://co.uk",S_OK,FALSE},
1965 {"http",S_OK,FALSE},
1970 {Uri_HOST_DNS,S_OK,FALSE},
1972 {URL_SCHEME_HTTP,S_OK,FALSE},
1973 {URLZONE_INVALID,E_NOTIMPL,FALSE}
1976 { "http://www.co.google.us.test", 0, S_OK, FALSE,
1978 {"http://www.co.google.us.test/",S_OK,FALSE},
1979 {"www.co.google.us.test",S_OK,FALSE},
1980 {"http://www.co.google.us.test/",S_OK,FALSE},
1981 {"us.test",S_OK,FALSE},
1984 {"www.co.google.us.test",S_OK,FALSE},
1989 {"http://www.co.google.us.test",S_OK,FALSE},
1990 {"http",S_OK,FALSE},
1995 {Uri_HOST_DNS,S_OK,FALSE},
1997 {URL_SCHEME_HTTP,S_OK,FALSE},
1998 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2001 { "http://gov.uk", 0, S_OK, FALSE,
2003 {"http://gov.uk/",S_OK,FALSE},
2004 {"gov.uk",S_OK,FALSE},
2005 {"http://gov.uk/",S_OK,FALSE},
2009 {"gov.uk",S_OK,FALSE},
2014 {"http://gov.uk",S_OK,FALSE},
2015 {"http",S_OK,FALSE},
2020 {Uri_HOST_DNS,S_OK,FALSE},
2022 {URL_SCHEME_HTTP,S_OK,FALSE},
2023 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2026 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2028 {"zip://www.google.com\\test",S_OK,FALSE},
2029 {"www.google.com\\test",S_OK,FALSE},
2030 {"zip://www.google.com\\test",S_OK,FALSE},
2031 {"google.com\\test",S_OK,FALSE},
2034 {"www.google.com\\test",S_OK,FALSE},
2039 {"zip://www.google.com\\test",S_OK,FALSE},
2045 {Uri_HOST_DNS,S_OK,FALSE},
2047 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2048 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2051 { "urn:excepts:bad:%XY:encoded", 0, S_OK, FALSE,
2053 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2055 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2061 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2062 {"excepts:bad:%XY:encoded",S_OK,FALSE},
2064 {"urn:excepts:bad:%XY:encoded",S_OK,FALSE},
2070 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2072 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2073 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2076 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2077 * are decoded and all '%' are encoded.
2079 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK, FALSE,
2081 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2083 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2085 {".mp3",S_OK,FALSE},
2089 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2090 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK,FALSE},
2092 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK,FALSE},
2093 {"file",S_OK,FALSE},
2098 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2100 {URL_SCHEME_FILE,S_OK,FALSE},
2101 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2104 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2105 * is decoded and only %'s in front of invalid hex digits are encoded.
2107 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK, FALSE,
2109 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2111 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2113 {".mp3",S_OK,FALSE},
2117 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2118 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK,FALSE},
2120 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK,FALSE},
2121 {"file",S_OK,FALSE},
2126 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2128 {URL_SCHEME_FILE,S_OK,FALSE},
2129 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2132 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2133 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK, FALSE,
2135 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2136 {"[::1.2.3.0]",S_OK,FALSE},
2137 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK,FALSE},
2141 {"::1.2.3.0",S_OK,FALSE},
2143 {"/%3F%23.T/test",S_OK,FALSE},
2144 {"/%3F%23.T/test",S_OK,FALSE},
2146 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK,FALSE},
2147 {"http",S_OK,FALSE},
2152 {Uri_HOST_IPV6,S_OK,FALSE},
2154 {URL_SCHEME_HTTP,S_OK,FALSE},
2155 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2158 /* Forbidden characters are always encoded for file URIs. */
2159 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2161 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2163 {"file:///C:/%22test%22/test.mp3",S_OK,FALSE},
2165 {".mp3",S_OK,FALSE},
2169 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2170 {"/C:/%22test%22/test.mp3",S_OK,FALSE},
2172 {"file:///C:/\"test\"/test.mp3",S_OK,FALSE},
2173 {"file",S_OK,FALSE},
2178 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2180 {URL_SCHEME_FILE,S_OK,FALSE},
2181 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2184 /* Forbidden characters are never encoded for unknown scheme types. */
2185 { "1234://4294967295/<|>\" test<|>", 0, S_OK, FALSE,
2187 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2188 {"4294967295",S_OK,FALSE},
2189 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2193 {"4294967295",S_OK,FALSE},
2195 {"/<|>\" test<|>",S_OK,FALSE},
2196 {"/<|>\" test<|>",S_OK,FALSE},
2198 {"1234://4294967295/<|>\" test<|>",S_OK,FALSE},
2199 {"1234",S_OK,FALSE},
2204 {Uri_HOST_IPV4,S_OK,FALSE},
2206 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2207 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2210 /* Make sure forbidden characters are percent encoded. */
2211 { "http://gov.uk/<|> test<|>", 0, S_OK, FALSE,
2213 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2214 {"gov.uk",S_OK,FALSE},
2215 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2219 {"gov.uk",S_OK,FALSE},
2221 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2222 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK,FALSE},
2224 {"http://gov.uk/<|> test<|>",S_OK,FALSE},
2225 {"http",S_OK,FALSE},
2230 {Uri_HOST_DNS,S_OK,FALSE},
2232 {URL_SCHEME_HTTP,S_OK,FALSE},
2233 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2236 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK, FALSE,
2238 {"http://gov.uk/",S_OK,FALSE},
2239 {"gov.uk",S_OK,FALSE},
2240 {"http://gov.uk/",S_OK,FALSE},
2244 {"gov.uk",S_OK,FALSE},
2249 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK,FALSE},
2250 {"http",S_OK,FALSE},
2255 {Uri_HOST_DNS,S_OK,FALSE},
2257 {URL_SCHEME_HTTP,S_OK,FALSE},
2258 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2261 { "http://gov.uk/test/test2/../../..", 0, S_OK, FALSE,
2263 {"http://gov.uk/",S_OK,FALSE},
2264 {"gov.uk",S_OK,FALSE},
2265 {"http://gov.uk/",S_OK,FALSE},
2269 {"gov.uk",S_OK,FALSE},
2274 {"http://gov.uk/test/test2/../../..",S_OK,FALSE},
2275 {"http",S_OK,FALSE},
2280 {Uri_HOST_DNS,S_OK,FALSE},
2282 {URL_SCHEME_HTTP,S_OK,FALSE},
2283 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2286 { "http://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2288 {"http://gov.uk/",S_OK,FALSE},
2289 {"gov.uk",S_OK,FALSE},
2290 {"http://gov.uk/",S_OK,FALSE},
2294 {"gov.uk",S_OK,FALSE},
2299 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2300 {"http",S_OK,FALSE},
2305 {Uri_HOST_DNS,S_OK,FALSE},
2307 {URL_SCHEME_HTTP,S_OK,FALSE},
2308 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2311 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK, FALSE,
2313 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2315 {"file:///c:/foo%2520bar.mp3",S_OK,FALSE},
2317 {".mp3",S_OK,FALSE},
2321 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2322 {"/c:/foo%2520bar.mp3",S_OK,FALSE},
2324 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK,FALSE},
2325 {"file",S_OK,FALSE},
2330 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2332 {URL_SCHEME_FILE,S_OK,FALSE},
2333 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2336 /* Dot removal happens for unknown scheme types. */
2337 { "zip://gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2339 {"zip://gov.uk/",S_OK,FALSE},
2340 {"gov.uk",S_OK,FALSE},
2341 {"zip://gov.uk/",S_OK,FALSE},
2345 {"gov.uk",S_OK,FALSE},
2350 {"zip://gov.uk/test/test2/../../.",S_OK,FALSE},
2356 {Uri_HOST_DNS,S_OK,FALSE},
2358 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2359 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2362 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2363 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2365 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2366 {"gov.uk",S_OK,FALSE},
2367 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2371 {"gov.uk",S_OK,FALSE},
2373 {"/test/test2/../../.",S_OK,FALSE},
2374 {"/test/test2/../../.",S_OK,FALSE},
2376 {"http://gov.uk/test/test2/../../.",S_OK,FALSE},
2377 {"http",S_OK,FALSE},
2382 {Uri_HOST_DNS,S_OK,FALSE},
2384 {URL_SCHEME_HTTP,S_OK,FALSE},
2385 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2388 /* Dot removal doesn't happen for wildcard scheme types. */
2389 { "*:gov.uk/test/test2/../../.", 0, S_OK, FALSE,
2391 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2392 {"gov.uk",S_OK,FALSE},
2393 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2397 {"gov.uk",S_OK,FALSE},
2399 {"/test/test2/../../.",S_OK,FALSE},
2400 {"/test/test2/../../.",S_OK,FALSE},
2402 {"*:gov.uk/test/test2/../../.",S_OK,FALSE},
2408 {Uri_HOST_DNS,S_OK,FALSE},
2410 {URL_SCHEME_WILDCARD,S_OK,FALSE},
2411 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2414 /* Forbidden characters are encoded for opaque known scheme types. */
2415 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK, FALSE,
2417 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2419 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2421 {".com%22",S_OK,FALSE},
2425 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2426 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK,FALSE},
2428 {"mailto:\"acco<|>unt@example.com\"",S_OK,FALSE},
2429 {"mailto",S_OK,FALSE},
2434 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2436 {URL_SCHEME_MAILTO,S_OK,FALSE},
2437 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2440 { "news:test.tes<|>t.com", 0, S_OK, FALSE,
2442 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2444 {"news:test.tes%3C%7C%3Et.com",S_OK,FALSE},
2446 {".com",S_OK,FALSE},
2450 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2451 {"test.tes%3C%7C%3Et.com",S_OK,FALSE},
2453 {"news:test.tes<|>t.com",S_OK,FALSE},
2454 {"news",S_OK,FALSE},
2459 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2461 {URL_SCHEME_NEWS,S_OK,FALSE},
2462 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2465 /* Don't encode forbidden characters. */
2466 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2468 {"news:test.tes<|>t.com",S_OK,FALSE},
2470 {"news:test.tes<|>t.com",S_OK,FALSE},
2472 {".com",S_OK,FALSE},
2476 {"test.tes<|>t.com",S_OK,FALSE},
2477 {"test.tes<|>t.com",S_OK,FALSE},
2479 {"news:test.tes<|>t.com",S_OK,FALSE},
2480 {"news",S_OK,FALSE},
2485 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2487 {URL_SCHEME_NEWS,S_OK,FALSE},
2488 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2491 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2492 { "urn:test.tes<|>t.com", 0, S_OK, FALSE,
2494 {"urn:test.tes<|>t.com",S_OK,FALSE},
2496 {"urn:test.tes<|>t.com",S_OK,FALSE},
2498 {".com",S_OK,FALSE},
2502 {"test.tes<|>t.com",S_OK,FALSE},
2503 {"test.tes<|>t.com",S_OK,FALSE},
2505 {"urn:test.tes<|>t.com",S_OK,FALSE},
2511 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2513 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2514 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2517 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2518 { "news:test.%74%65%73%74.com", 0, S_OK, FALSE,
2520 {"news:test.test.com",S_OK,FALSE},
2522 {"news:test.test.com",S_OK,FALSE},
2524 {".com",S_OK,FALSE},
2528 {"test.test.com",S_OK,FALSE},
2529 {"test.test.com",S_OK,FALSE},
2531 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2532 {"news",S_OK,FALSE},
2537 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2539 {URL_SCHEME_NEWS,S_OK,FALSE},
2540 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2543 /* Percent encoded characters are still decoded for known scheme types. */
2544 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2546 {"news:test.test.com",S_OK,FALSE},
2548 {"news:test.test.com",S_OK,FALSE},
2550 {".com",S_OK,FALSE},
2554 {"test.test.com",S_OK,FALSE},
2555 {"test.test.com",S_OK,FALSE},
2557 {"news:test.%74%65%73%74.com",S_OK,FALSE},
2558 {"news",S_OK,FALSE},
2563 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2565 {URL_SCHEME_NEWS,S_OK,FALSE},
2566 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2569 /* Percent encoded characters aren't decoded for unknown scheme types. */
2570 { "urn:test.%74%65%73%74.com", 0, S_OK, FALSE,
2572 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2574 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2576 {".com",S_OK,FALSE},
2580 {"test.%74%65%73%74.com",S_OK,FALSE},
2581 {"test.%74%65%73%74.com",S_OK,FALSE},
2583 {"urn:test.%74%65%73%74.com",S_OK,FALSE},
2589 {Uri_HOST_UNKNOWN,S_OK,FALSE},
2591 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2592 {URLZONE_INVALID,E_NOTIMPL,FALSE}
2595 /* Unknown scheme types can have invalid % encoded data in query string. */
2596 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK, FALSE,
2598 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2599 {"www.winehq.org",S_OK,FALSE},
2600 {"zip://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2601 {"winehq.org",S_OK,FALSE},
2604 {"www.winehq.org",S_OK,FALSE},
2607 {"/?query=%xx&return=y",S_OK,FALSE},
2608 {"?query=%xx&return=y",S_OK,FALSE},
2609 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2615 {Uri_HOST_DNS,S_OK,FALSE},
2617 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2618 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2621 /* Known scheme types can have invalid % encoded data with the right flags. */
2622 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2624 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2625 {"www.winehq.org",S_OK,FALSE},
2626 {"http://www.winehq.org/?query=%xx&return=y",S_OK,FALSE},
2627 {"winehq.org",S_OK,FALSE},
2630 {"www.winehq.org",S_OK,FALSE},
2633 {"/?query=%xx&return=y",S_OK,FALSE},
2634 {"?query=%xx&return=y",S_OK,FALSE},
2635 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK,FALSE},
2636 {"http",S_OK,FALSE},
2641 {Uri_HOST_DNS,S_OK,FALSE},
2643 {URL_SCHEME_HTTP,S_OK,FALSE},
2644 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2647 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2648 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2650 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2651 {"www.winehq.org",S_OK,FALSE},
2652 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2653 {"winehq.org",S_OK,FALSE},
2656 {"www.winehq.org",S_OK,FALSE},
2659 {"/?query=<|>&return=y",S_OK,FALSE},
2660 {"?query=<|>&return=y",S_OK,FALSE},
2661 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2662 {"http",S_OK,FALSE},
2667 {Uri_HOST_DNS,S_OK,FALSE},
2669 {URL_SCHEME_HTTP,S_OK,FALSE},
2670 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2673 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2674 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2676 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2677 {"www.winehq.org",S_OK,FALSE},
2678 {"http://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2679 {"winehq.org",S_OK,FALSE},
2682 {"www.winehq.org",S_OK,FALSE},
2685 {"/?query=<|>&return=y",S_OK,FALSE},
2686 {"?query=<|>&return=y",S_OK,FALSE},
2687 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2688 {"http",S_OK,FALSE},
2693 {Uri_HOST_DNS,S_OK,FALSE},
2695 {URL_SCHEME_HTTP,S_OK,FALSE},
2696 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2699 /* Forbidden characters are encoded for known scheme types. */
2700 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
2702 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2703 {"www.winehq.org",S_OK,FALSE},
2704 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2705 {"winehq.org",S_OK,FALSE},
2708 {"www.winehq.org",S_OK,FALSE},
2711 {"/?query=%3C%7C%3E&return=y",S_OK,FALSE},
2712 {"?query=%3C%7C%3E&return=y",S_OK,FALSE},
2713 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2714 {"http",S_OK,FALSE},
2719 {Uri_HOST_DNS,S_OK,FALSE},
2721 {URL_SCHEME_HTTP,S_OK,FALSE},
2722 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2725 /* Forbidden characters are not encoded for unknown scheme types. */
2726 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK, FALSE,
2728 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2729 {"www.winehq.org",S_OK,FALSE},
2730 {"zip://www.winehq.org/?query=<|>&return=y",S_OK,FALSE},
2731 {"winehq.org",S_OK,FALSE},
2734 {"www.winehq.org",S_OK,FALSE},
2737 {"/?query=<|>&return=y",S_OK,FALSE},
2738 {"?query=<|>&return=y",S_OK,FALSE},
2739 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK,FALSE},
2745 {Uri_HOST_DNS,S_OK,FALSE},
2747 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2748 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2751 /* Percent encoded, unreserved characters are decoded for known scheme types. */
2752 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
2754 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2755 {"www.winehq.org",S_OK,FALSE},
2756 {"http://www.winehq.org/?query=01&return=y",S_OK,FALSE},
2757 {"winehq.org",S_OK,FALSE},
2760 {"www.winehq.org",S_OK,FALSE},
2763 {"/?query=01&return=y",S_OK,FALSE},
2764 {"?query=01&return=y",S_OK,FALSE},
2765 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
2766 {"http",S_OK,FALSE},
2771 {Uri_HOST_DNS,S_OK,FALSE},
2773 {URL_SCHEME_HTTP,S_OK,FALSE},
2774 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2777 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
2778 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK, FALSE,
2780 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2781 {"www.winehq.org",S_OK,FALSE},
2782 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2783 {"winehq.org",S_OK,FALSE},
2786 {"www.winehq.org",S_OK,FALSE},
2789 {"/?query=%30%31&return=y",S_OK,FALSE},
2790 {"?query=%30%31&return=y",S_OK,FALSE},
2791 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
2797 {Uri_HOST_DNS,S_OK,FALSE},
2799 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2800 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2803 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
2804 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2806 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2807 {"www.winehq.org",S_OK,FALSE},
2808 {"http://www.winehq.org/?query=%30%31&return=y",S_OK,FALSE},
2809 {"winehq.org",S_OK,FALSE},
2812 {"www.winehq.org",S_OK,FALSE},
2815 {"/?query=%30%31&return=y",S_OK,FALSE},
2816 {"?query=%30%31&return=y",S_OK,FALSE},
2817 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK,FALSE},
2818 {"http",S_OK,FALSE},
2823 {Uri_HOST_DNS,S_OK,FALSE},
2825 {URL_SCHEME_HTTP,S_OK,FALSE},
2826 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2829 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
2831 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
2832 {"www.winehq.org",S_OK,FALSE},
2833 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
2834 {"winehq.org",S_OK,FALSE},
2837 {"www.winehq.org",S_OK,FALSE},
2840 {"?query=12&return=y",S_OK,FALSE},
2841 {"?query=12&return=y",S_OK,FALSE},
2842 {"http://www.winehq.org?query=12&return=y",S_OK,FALSE},
2843 {"http",S_OK,FALSE},
2848 {Uri_HOST_DNS,S_OK,FALSE},
2850 {URL_SCHEME_HTTP,S_OK,FALSE},
2851 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2854 /* Unknown scheme types can have invalid % encoded data in fragments. */
2855 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK, FALSE,
2857 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
2858 {"www.winehq.org",S_OK,FALSE},
2859 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
2860 {"winehq.org",S_OK,FALSE},
2862 {"#Te%xx",S_OK,FALSE},
2863 {"www.winehq.org",S_OK,FALSE},
2865 {"/tests/",S_OK,FALSE},
2866 {"/tests/",S_OK,FALSE},
2868 {"zip://www.winehq.org/tests/#Te%xx",S_OK,FALSE},
2874 {Uri_HOST_DNS,S_OK,FALSE},
2876 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2877 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2880 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
2881 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE,
2883 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2884 {"www.winehq.org",S_OK,FALSE},
2885 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2886 {"winehq.org",S_OK,FALSE},
2888 {"#Te<|>",S_OK,FALSE},
2889 {"www.winehq.org",S_OK,FALSE},
2891 {"/tests/",S_OK,FALSE},
2892 {"/tests/",S_OK,FALSE},
2894 {"zip://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2900 {Uri_HOST_DNS,S_OK,FALSE},
2902 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
2903 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2906 /* Forbidden characters in the fragment are percent encoded for known schemes. */
2907 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK, FALSE,
2909 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
2910 {"www.winehq.org",S_OK,FALSE},
2911 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK,FALSE},
2912 {"winehq.org",S_OK,FALSE},
2914 {"#Te%3C%7C%3E",S_OK,FALSE},
2915 {"www.winehq.org",S_OK,FALSE},
2917 {"/tests/",S_OK,FALSE},
2918 {"/tests/",S_OK,FALSE},
2920 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2921 {"http",S_OK,FALSE},
2926 {Uri_HOST_DNS,S_OK,FALSE},
2928 {URL_SCHEME_HTTP,S_OK,FALSE},
2929 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2932 /* Forbidden characters aren't encoded in the fragment with this flag. */
2933 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
2935 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2936 {"www.winehq.org",S_OK,FALSE},
2937 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2938 {"winehq.org",S_OK,FALSE},
2940 {"#Te<|>",S_OK,FALSE},
2941 {"www.winehq.org",S_OK,FALSE},
2943 {"/tests/",S_OK,FALSE},
2944 {"/tests/",S_OK,FALSE},
2946 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2947 {"http",S_OK,FALSE},
2952 {Uri_HOST_DNS,S_OK,FALSE},
2954 {URL_SCHEME_HTTP,S_OK,FALSE},
2955 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2958 /* Forbidden characters aren't encoded in the fragment with this flag. */
2959 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
2961 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2962 {"www.winehq.org",S_OK,FALSE},
2963 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2964 {"winehq.org",S_OK,FALSE},
2966 {"#Te<|>",S_OK,FALSE},
2967 {"www.winehq.org",S_OK,FALSE},
2969 {"/tests/",S_OK,FALSE},
2970 {"/tests/",S_OK,FALSE},
2972 {"http://www.winehq.org/tests/#Te<|>",S_OK,FALSE},
2973 {"http",S_OK,FALSE},
2978 {Uri_HOST_DNS,S_OK,FALSE},
2980 {URL_SCHEME_HTTP,S_OK,FALSE},
2981 {URLZONE_INVALID,E_NOTIMPL,FALSE},
2984 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
2985 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE,
2987 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
2988 {"www.winehq.org",S_OK,FALSE},
2989 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
2990 {"winehq.org",S_OK,FALSE},
2992 {"#Te%30%31%32",S_OK,FALSE},
2993 {"www.winehq.org",S_OK,FALSE},
2995 {"/tests/",S_OK,FALSE},
2996 {"/tests/",S_OK,FALSE},
2998 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3004 {Uri_HOST_DNS,S_OK,FALSE},
3006 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3007 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3010 /* Percent encoded, unreserved characters are decoded for known schemes. */
3011 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK, FALSE,
3013 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3014 {"www.winehq.org",S_OK,FALSE},
3015 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3016 {"winehq.org",S_OK,FALSE},
3018 {"#Te012",S_OK,FALSE},
3019 {"www.winehq.org",S_OK,FALSE},
3021 {"/tests/",S_OK,FALSE},
3022 {"/tests/",S_OK,FALSE},
3024 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3025 {"http",S_OK,FALSE},
3030 {Uri_HOST_DNS,S_OK,FALSE},
3032 {URL_SCHEME_HTTP,S_OK,FALSE},
3033 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3036 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3037 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
3039 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3040 {"www.winehq.org",S_OK,FALSE},
3041 {"http://www.winehq.org/tests/#Te012",S_OK,FALSE},
3042 {"winehq.org",S_OK,FALSE},
3044 {"#Te012",S_OK,FALSE},
3045 {"www.winehq.org",S_OK,FALSE},
3047 {"/tests/",S_OK,FALSE},
3048 {"/tests/",S_OK,FALSE},
3050 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3051 {"http",S_OK,FALSE},
3056 {Uri_HOST_DNS,S_OK,FALSE},
3058 {URL_SCHEME_HTTP,S_OK,FALSE},
3059 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3062 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3063 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO, S_OK, FALSE,
3065 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3066 {"www.winehq.org",S_OK,FALSE},
3067 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3068 {"winehq.org",S_OK,FALSE},
3070 {"#Te%30%31%32",S_OK,FALSE},
3071 {"www.winehq.org",S_OK,FALSE},
3073 {"/tests/",S_OK,FALSE},
3074 {"/tests/",S_OK,FALSE},
3076 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK,FALSE},
3077 {"http",S_OK,FALSE},
3082 {Uri_HOST_DNS,S_OK,FALSE},
3084 {URL_SCHEME_HTTP,S_OK,FALSE},
3085 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3088 /* Leading/Trailing whitespace is removed. */
3089 { " http://google.com/ ", 0, S_OK, FALSE,
3091 {"http://google.com/",S_OK,FALSE},
3092 {"google.com",S_OK,FALSE},
3093 {"http://google.com/",S_OK,FALSE},
3094 {"google.com",S_OK,FALSE},
3097 {"google.com",S_OK,FALSE},
3102 {"http://google.com/",S_OK,FALSE},
3103 {"http",S_OK,FALSE},
3108 {Uri_HOST_DNS,S_OK,FALSE},
3110 {URL_SCHEME_HTTP,S_OK,FALSE},
3111 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3114 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK, FALSE,
3116 {"http://google.com/",S_OK,FALSE},
3117 {"google.com",S_OK,FALSE},
3118 {"http://google.com/",S_OK,FALSE},
3119 {"google.com",S_OK,FALSE},
3122 {"google.com",S_OK,FALSE},
3127 {"http://google.com/",S_OK,FALSE},
3128 {"http",S_OK,FALSE},
3133 {Uri_HOST_DNS,S_OK,FALSE},
3135 {URL_SCHEME_HTTP,S_OK,FALSE},
3136 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3139 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE,
3141 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3142 {"g%0aoogle.co%0dm",S_OK,FALSE},
3143 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK,FALSE},
3144 {"g%0aoogle.co%0dm",S_OK,FALSE},
3147 {"g%0aoogle.co%0dm",S_OK,FALSE},
3149 {"/%0A%0A%0A",S_OK,FALSE},
3150 {"/%0A%0A%0A",S_OK,FALSE},
3152 {"http://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3153 {"http",S_OK,FALSE},
3158 {Uri_HOST_DNS,S_OK,FALSE},
3160 {URL_SCHEME_HTTP,S_OK,FALSE},
3161 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3164 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI, S_OK, FALSE,
3166 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3167 {"g\noogle.co\rm",S_OK,FALSE},
3168 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3169 {"g\noogle.co\rm",S_OK,FALSE},
3172 {"g\noogle.co\rm",S_OK,FALSE},
3174 {"/\n\n\n",S_OK,FALSE},
3175 {"/\n\n\n",S_OK,FALSE},
3177 {"zip://g\noogle.co\rm/\n\n\n",S_OK,FALSE},
3183 {Uri_HOST_DNS,S_OK,FALSE},
3185 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3186 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3189 /* Since file URLs are usually hierarchical, it returns an empty string
3190 * for the absolute URI property since it was declared as an opaque URI.
3192 { "file:index.html", 0, S_OK, FALSE,
3196 {"file:index.html",S_OK,FALSE},
3198 {".html",S_OK,FALSE},
3202 {"index.html",S_OK,FALSE},
3203 {"index.html",S_OK,FALSE},
3205 {"file:index.html",S_OK,FALSE},
3206 {"file",S_OK,FALSE},
3211 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3213 {URL_SCHEME_FILE,S_OK,FALSE},
3214 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3217 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3218 { "http:test.com/index.html", 0, S_OK, FALSE,
3222 {"http:test.com/index.html",S_OK,FALSE},
3224 {".html",S_OK,FALSE},
3228 {"test.com/index.html",S_OK,FALSE},
3229 {"test.com/index.html",S_OK,FALSE},
3231 {"http:test.com/index.html",S_OK,FALSE},
3232 {"http",S_OK,FALSE},
3237 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3239 {URL_SCHEME_HTTP,S_OK,FALSE},
3240 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3243 { "ftp:test.com/index.html", 0, S_OK, FALSE,
3247 {"ftp:test.com/index.html",S_OK,FALSE},
3249 {".html",S_OK,FALSE},
3253 {"test.com/index.html",S_OK,FALSE},
3254 {"test.com/index.html",S_OK,FALSE},
3256 {"ftp:test.com/index.html",S_OK,FALSE},
3262 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3264 {URL_SCHEME_FTP,S_OK,FALSE},
3265 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3268 { "file://C|/test.mp3", 0, S_OK, FALSE,
3270 {"file:///C:/test.mp3",S_OK,FALSE},
3272 {"file:///C:/test.mp3",S_OK,FALSE},
3274 {".mp3",S_OK,FALSE},
3278 {"/C:/test.mp3",S_OK,FALSE},
3279 {"/C:/test.mp3",S_OK,FALSE},
3281 {"file://C|/test.mp3",S_OK,FALSE},
3282 {"file",S_OK,FALSE},
3287 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3289 {URL_SCHEME_FILE,S_OK,FALSE},
3290 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3293 { "file:///C|/test.mp3", 0, S_OK, FALSE,
3295 {"file:///C:/test.mp3",S_OK,FALSE},
3297 {"file:///C:/test.mp3",S_OK,FALSE},
3299 {".mp3",S_OK,FALSE},
3303 {"/C:/test.mp3",S_OK,FALSE},
3304 {"/C:/test.mp3",S_OK,FALSE},
3306 {"file:///C|/test.mp3",S_OK,FALSE},
3307 {"file",S_OK,FALSE},
3312 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3314 {URL_SCHEME_FILE,S_OK,FALSE},
3315 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3318 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3321 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3323 {"file://c:\\dir\\index.html",S_OK,FALSE},
3325 {"file://c:\\dir\\index.html",S_OK,FALSE},
3327 {".html",S_OK,FALSE},
3331 {"c:\\dir\\index.html",S_OK,FALSE},
3332 {"c:\\dir\\index.html",S_OK,FALSE},
3334 {"file://c:/dir/index.html",S_OK,FALSE},
3335 {"file",S_OK,FALSE},
3340 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3342 {URL_SCHEME_FILE,S_OK,FALSE},
3343 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3346 /* Extra '/' after "file://" is removed. */
3347 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3349 {"file://c:\\dir\\index.html",S_OK,FALSE},
3351 {"file://c:\\dir\\index.html",S_OK,FALSE},
3353 {".html",S_OK,FALSE},
3357 {"c:\\dir\\index.html",S_OK,FALSE},
3358 {"c:\\dir\\index.html",S_OK,FALSE},
3360 {"file:///c:/dir/index.html",S_OK,FALSE},
3361 {"file",S_OK,FALSE},
3366 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3368 {URL_SCHEME_FILE,S_OK,FALSE},
3369 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3372 /* Allow more characters when Uri_CREATE_FILE_USE_DOS_PATH is specified */
3373 { "file:///c:/dir\\%%61%20%5Fname/file%2A.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3375 {"file://c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3377 {"file://c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3379 {".html",S_OK,FALSE},
3383 {"c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3384 {"c:\\dir\\%a _name\\file*.html",S_OK,FALSE},
3386 {"file:///c:/dir\\%%61%20%5Fname/file%2A.html",S_OK,FALSE},
3387 {"file",S_OK,FALSE},
3392 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3394 {URL_SCHEME_FILE,S_OK,FALSE},
3395 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3398 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3400 {"file://c:\\dir\\index.html",S_OK,FALSE},
3402 {"file://c:\\dir\\index.html",S_OK,FALSE},
3404 {".html",S_OK,FALSE},
3408 {"c:\\dir\\index.html",S_OK,FALSE},
3409 {"c:\\dir\\index.html",S_OK,FALSE},
3411 {"file://c|/dir\\index.html",S_OK,FALSE},
3412 {"file",S_OK,FALSE},
3417 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3419 {URL_SCHEME_FILE,S_OK,FALSE},
3420 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3423 /* The backslashes after the scheme name are converted to forward slashes. */
3424 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3426 {"file://c:\\dir\\index.html",S_OK,FALSE},
3428 {"file://c:\\dir\\index.html",S_OK,FALSE},
3430 {".html",S_OK,FALSE},
3434 {"c:\\dir\\index.html",S_OK,FALSE},
3435 {"c:\\dir\\index.html",S_OK,FALSE},
3437 {"file:\\\\c:\\dir\\index.html",S_OK,FALSE},
3438 {"file",S_OK,FALSE},
3443 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3445 {URL_SCHEME_FILE,S_OK,FALSE},
3446 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3449 { "file:\\\\c:/dir/index.html", 0, S_OK, FALSE,
3451 {"file:///c:/dir/index.html",S_OK,FALSE},
3453 {"file:///c:/dir/index.html",S_OK,FALSE},
3455 {".html",S_OK,FALSE},
3459 {"/c:/dir/index.html",S_OK,FALSE},
3460 {"/c:/dir/index.html",S_OK,FALSE},
3462 {"file:\\\\c:/dir/index.html",S_OK,FALSE},
3463 {"file",S_OK,FALSE},
3468 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3470 {URL_SCHEME_FILE,S_OK,FALSE},
3471 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3474 { "http:\\\\google.com", 0, S_OK, FALSE,
3476 {"http://google.com/",S_OK,FALSE},
3477 {"google.com",S_OK,FALSE},
3478 {"http://google.com/",S_OK,FALSE},
3479 {"google.com",S_OK,FALSE},
3482 {"google.com",S_OK,FALSE},
3487 {"http:\\\\google.com",S_OK,FALSE},
3488 {"http",S_OK,FALSE},
3493 {Uri_HOST_DNS,S_OK,FALSE},
3495 {URL_SCHEME_HTTP,S_OK,FALSE},
3496 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3499 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3500 { "zip:\\\\google.com", 0, S_OK, FALSE,
3502 {"zip:\\\\google.com",S_OK,FALSE},
3504 {"zip:\\\\google.com",S_OK,FALSE},
3506 {".com",S_OK,FALSE},
3510 {"\\\\google.com",S_OK,FALSE},
3511 {"\\\\google.com",S_OK,FALSE},
3513 {"zip:\\\\google.com",S_OK,FALSE},
3519 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3521 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3522 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3525 /* Dot segments aren't removed. */
3526 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3528 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3530 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3532 {".html",S_OK,FALSE},
3536 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3537 {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE},
3539 {"file://c:\\dir\\../..\\./index.html",S_OK,FALSE},
3540 {"file",S_OK,FALSE},
3545 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3547 {URL_SCHEME_FILE,S_OK,FALSE},
3548 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3551 /* Forbidden characters aren't percent encoded. */
3552 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3554 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3556 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3558 {".html",S_OK,FALSE},
3562 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3563 {"c:\\dir\\i^|ndex.html",S_OK,FALSE},
3565 {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE},
3566 {"file",S_OK,FALSE},
3571 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3573 {URL_SCHEME_FILE,S_OK,FALSE},
3574 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3577 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3578 { "file:c:\\dir\\../..\\index.html", 0, S_OK, FALSE,
3582 {"file:c:/dir/../../index.html",S_OK,FALSE},
3584 {".html",S_OK,FALSE},
3588 {"c:/dir/../../index.html",S_OK,FALSE},
3589 {"c:/dir/../../index.html",S_OK,FALSE},
3591 {"file:c:\\dir\\../..\\index.html",S_OK,FALSE},
3592 {"file",S_OK,FALSE},
3597 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3599 {URL_SCHEME_FILE,S_OK,FALSE},
3600 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3603 /* '/' are still converted to '\' even though it's an opaque URI. */
3604 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3608 {"file:c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3610 {".html",S_OK,FALSE},
3614 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3615 {"c:\\dir\\..\\..\\index.html",S_OK,FALSE},
3617 {"file:c:/dir\\../..\\index.html",S_OK,FALSE},
3618 {"file",S_OK,FALSE},
3623 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3625 {URL_SCHEME_FILE,S_OK,FALSE},
3626 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3629 /* Forbidden characters aren't percent encoded. */
3630 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3634 {"file:c:\\in^|dex.html",S_OK,FALSE},
3636 {".html",S_OK,FALSE},
3640 {"c:\\in^|dex.html",S_OK,FALSE},
3641 {"c:\\in^|dex.html",S_OK,FALSE},
3643 {"file:c:\\in^|dex.html",S_OK,FALSE},
3644 {"file",S_OK,FALSE},
3649 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3651 {URL_SCHEME_FILE,S_OK,FALSE},
3652 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3655 /* Doesn't have a UserName since the ':' appears at the beginning of the
3658 { "http://:password@gov.uk", 0, S_OK, FALSE,
3660 {"http://:password@gov.uk/",S_OK,FALSE},
3661 {":password@gov.uk",S_OK,FALSE},
3662 {"http://gov.uk/",S_OK,FALSE},
3666 {"gov.uk",S_OK,FALSE},
3667 {"password",S_OK,FALSE},
3671 {"http://:password@gov.uk",S_OK,FALSE},
3672 {"http",S_OK,FALSE},
3673 {":password",S_OK,FALSE},
3677 {Uri_HOST_DNS,S_OK,FALSE},
3679 {URL_SCHEME_HTTP,S_OK,FALSE},
3680 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3683 /* Has a UserName since the userinfo section doesn't contain a password. */
3684 { "http://@gov.uk", 0, S_OK, FALSE,
3686 {"http://gov.uk/",S_OK,FALSE,"http://@gov.uk/"},
3687 {"@gov.uk",S_OK,FALSE},
3688 {"http://gov.uk/",S_OK,FALSE},
3692 {"gov.uk",S_OK,FALSE},
3697 {"http://@gov.uk",S_OK,FALSE},
3698 {"http",S_OK,FALSE},
3703 {Uri_HOST_DNS,S_OK,FALSE},
3705 {URL_SCHEME_HTTP,S_OK,FALSE},
3706 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3709 /* ":@" not included in the absolute URI. */
3710 { "http://:@gov.uk", 0, S_OK, FALSE,
3712 {"http://gov.uk/",S_OK,FALSE,"http://:@gov.uk/"},
3713 {":@gov.uk",S_OK,FALSE},
3714 {"http://gov.uk/",S_OK,FALSE},
3718 {"gov.uk",S_OK,FALSE},
3723 {"http://:@gov.uk",S_OK,FALSE},
3724 {"http",S_OK,FALSE},
3729 {Uri_HOST_DNS,S_OK,FALSE},
3731 {URL_SCHEME_HTTP,S_OK,FALSE},
3732 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3735 /* '@' is included because it's an unknown scheme type. */
3736 { "zip://@gov.uk", 0, S_OK, FALSE,
3738 {"zip://@gov.uk/",S_OK,FALSE},
3739 {"@gov.uk",S_OK,FALSE},
3740 {"zip://@gov.uk/",S_OK,FALSE},
3744 {"gov.uk",S_OK,FALSE},
3749 {"zip://@gov.uk",S_OK,FALSE},
3755 {Uri_HOST_DNS,S_OK,FALSE},
3757 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3758 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3761 /* ":@" are included because it's an unknown scheme type. */
3762 { "zip://:@gov.uk", 0, S_OK, FALSE,
3764 {"zip://:@gov.uk/",S_OK,FALSE},
3765 {":@gov.uk",S_OK,FALSE},
3766 {"zip://:@gov.uk/",S_OK,FALSE},
3770 {"gov.uk",S_OK,FALSE},
3775 {"zip://:@gov.uk",S_OK,FALSE},
3781 {Uri_HOST_DNS,S_OK,FALSE},
3783 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
3784 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3787 { "about:blank", 0, S_OK, FALSE,
3789 {"about:blank",S_OK,FALSE},
3791 {"about:blank",S_OK,FALSE},
3797 {"blank",S_OK,FALSE},
3798 {"blank",S_OK,FALSE},
3800 {"about:blank",S_OK,FALSE},
3801 {"about",S_OK,FALSE},
3806 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3808 {URL_SCHEME_ABOUT,S_OK,FALSE},
3809 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3812 { "mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",0,S_OK,FALSE,
3814 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
3816 {"mk:@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
3818 {".htm",S_OK,FALSE},
3822 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
3823 {"@MSITStore:C:\\Program%20Files/AutoCAD%202008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
3825 {"mk:@MSITStore:C:\\Program Files/AutoCAD 2008\\Help/acad_acg.chm::/WSfacf1429558a55de1a7524c1004e616f8b-322b.htm",S_OK,FALSE},
3831 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3833 {URL_SCHEME_MK,S_OK,FALSE},
3834 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3837 { "mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",0,S_OK,FALSE,
3839 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
3841 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
3843 {".htm",S_OK,FALSE},
3847 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
3848 {"@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
3850 {"mk:@MSITStore:Z:\\home\\test\\chm\\silqhelp.chm::/thesilqquickstartguide.htm",S_OK,FALSE},
3856 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3858 {URL_SCHEME_MK,S_OK,FALSE},
3859 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3862 /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */
3863 { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE,
3865 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
3866 {"server",S_OK,FALSE},
3867 {"file://\\\\server\\dir\\index.html",S_OK,FALSE},
3869 {".html",S_OK,FALSE},
3871 {"server",S_OK,FALSE},
3873 {"\\dir\\index.html",S_OK,FALSE},
3874 {"\\dir\\index.html",S_OK,FALSE},
3876 {"file://server/dir/index.html",S_OK,FALSE},
3877 {"file",S_OK,FALSE},
3882 {Uri_HOST_DNS,S_OK,FALSE},
3884 {URL_SCHEME_FILE,S_OK,FALSE},
3885 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3888 /* When CreateUri generates an IUri, it still displays the default port in the
3891 { "http://google.com:80/", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
3893 {"http://google.com:80/",S_OK,FALSE},
3894 {"google.com:80",S_OK,FALSE},
3895 {"http://google.com:80/",S_OK,FALSE},
3896 {"google.com",S_OK,FALSE},
3899 {"google.com",S_OK,FALSE},
3904 {"http://google.com:80/",S_OK,FALSE},
3905 {"http",S_OK,FALSE},
3910 {Uri_HOST_DNS,S_OK,FALSE},
3912 {URL_SCHEME_HTTP,S_OK,FALSE},
3913 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3916 /* For res URIs the host is everything up until the first '/'. */
3917 { "res://C:\\dir\\file.exe/DATA/test.html", 0, S_OK, FALSE,
3919 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
3920 {"C:\\dir\\file.exe",S_OK,FALSE},
3921 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
3923 {".html",S_OK,FALSE},
3925 {"C:\\dir\\file.exe",S_OK,FALSE},
3927 {"/DATA/test.html",S_OK,FALSE},
3928 {"/DATA/test.html",S_OK,FALSE},
3930 {"res://C:\\dir\\file.exe/DATA/test.html",S_OK,FALSE},
3936 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3938 {URL_SCHEME_RES,S_OK,FALSE},
3939 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3942 /* Res URI can contain a '|' in the host name. */
3943 { "res://c:\\di|r\\file.exe/test", 0, S_OK, FALSE,
3945 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
3946 {"c:\\di|r\\file.exe",S_OK,FALSE},
3947 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
3951 {"c:\\di|r\\file.exe",S_OK,FALSE},
3953 {"/test",S_OK,FALSE},
3954 {"/test",S_OK,FALSE},
3956 {"res://c:\\di|r\\file.exe/test",S_OK,FALSE},
3962 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3964 {URL_SCHEME_RES,S_OK,FALSE},
3965 {URLZONE_INVALID,E_NOTIMPL,FALSE},
3968 /* Res URIs can have invalid percent encoded values. */
3969 { "res://c:\\dir%xx\\file.exe/test", 0, S_OK, FALSE,
3971 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
3972 {"c:\\dir%xx\\file.exe",S_OK,FALSE},
3973 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
3977 {"c:\\dir%xx\\file.exe",S_OK,FALSE},
3979 {"/test",S_OK,FALSE},
3980 {"/test",S_OK,FALSE},
3982 {"res://c:\\dir%xx\\file.exe/test",S_OK,FALSE},
3988 {Uri_HOST_UNKNOWN,S_OK,FALSE},
3990 {URL_SCHEME_RES,S_OK,FALSE},
3991 {URLZONE_INVALID,E_NOTIMPL,FALSE}
3994 /* Res doesn't get forbidden characters percent encoded in it's path. */
3995 { "res://c:\\test/tes<|>t", 0, S_OK, FALSE,
3997 {"res://c:\\test/tes<|>t",S_OK,FALSE},
3998 {"c:\\test",S_OK,FALSE},
3999 {"res://c:\\test/tes<|>t",S_OK,FALSE},
4003 {"c:\\test",S_OK,FALSE},
4005 {"/tes<|>t",S_OK,FALSE},
4006 {"/tes<|>t",S_OK,FALSE},
4008 {"res://c:\\test/tes<|>t",S_OK,FALSE},
4014 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4016 {URL_SCHEME_RES,S_OK,FALSE},
4017 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4020 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK, FALSE,
4022 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4024 {"mk:@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4026 {".jpg",S_OK,FALSE},
4030 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4031 {"@MSITStore:Z:\\dir\\test.chm::/images/xxx.jpg",S_OK,FALSE},
4033 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4039 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4041 {URL_SCHEME_MK,S_OK,FALSE},
4042 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4045 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE,
4047 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4049 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4051 {".jpg",S_OK,FALSE},
4055 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4056 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4058 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4064 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4066 {URL_SCHEME_MK,S_OK,FALSE},
4067 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4070 { "xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg", 0, S_OK, FALSE,
4072 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4074 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4076 {".jpg",S_OK,FALSE},
4080 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4081 {"@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4083 {"xx:@MSITStore:Z:\\dir\\test.chm::/html/../images/xxx.jpg",S_OK,FALSE},
4089 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4091 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
4092 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4095 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg", 0, S_OK, FALSE,
4097 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4099 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4101 {".jpg",S_OK,FALSE},
4105 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4106 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4108 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../images/xxx.jpg",S_OK,FALSE},
4114 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4116 {URL_SCHEME_MK,S_OK,FALSE},
4117 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4120 { "mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg", 0, S_OK, FALSE,
4122 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4124 {"mk:@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4126 {".jpg",S_OK,FALSE},
4130 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4131 {"@MSITStore:Z:\\dir\\images/xxx.jpg",S_OK,FALSE},
4133 {"mk:@MSITStore:Z:\\dir\\dir2\\..\\test.chm::/html/../../images/xxx.jpg",S_OK,FALSE},
4139 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4141 {URL_SCHEME_MK,S_OK,FALSE},
4142 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4145 { "mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg", 0, S_OK, FALSE,
4147 {"mk:images/xxx.jpg",S_OK,FALSE},
4149 {"mk:images/xxx.jpg",S_OK,FALSE},
4151 {".jpg",S_OK,FALSE},
4155 {"images/xxx.jpg",S_OK,FALSE},
4156 {"images/xxx.jpg",S_OK,FALSE},
4158 {"mk:@MSITStore:Z:\\dir\\test.chm::/html/../../../../images/xxx.jpg",S_OK,FALSE},
4164 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4166 {URL_SCHEME_MK,S_OK,FALSE},
4167 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4170 { "", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE,
4189 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4191 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
4192 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4195 { " \t ", Uri_CREATE_ALLOW_RELATIVE, S_OK, FALSE,
4214 {Uri_HOST_UNKNOWN,S_OK,FALSE},
4216 {URL_SCHEME_UNKNOWN,S_OK,FALSE},
4217 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4220 { "javascript:void", 0, S_OK, FALSE,
4222 {"javascript:void",S_OK},
4224 {"javascript:void",S_OK},
4233 {"javascript:void",S_OK},
4234 {"javascript",S_OK},
4239 {Uri_HOST_UNKNOWN,S_OK},
4241 {URL_SCHEME_JAVASCRIPT,S_OK},
4242 {URLZONE_INVALID,E_NOTIMPL}
4245 { "javascript://undefined", 0, S_OK, FALSE,
4247 {"javascript://undefined",S_OK},
4249 {"javascript://undefined",S_OK},
4255 {"//undefined",S_OK},
4256 {"//undefined",S_OK},
4258 {"javascript://undefined",S_OK},
4259 {"javascript",S_OK},
4264 {Uri_HOST_UNKNOWN,S_OK},
4266 {URL_SCHEME_JAVASCRIPT,S_OK},
4267 {URLZONE_INVALID,E_NOTIMPL}
4270 { "JavaSCript:escape('/\\?#?')", 0, S_OK, FALSE,
4272 {"javascript:escape('/\\?#?')",S_OK},
4274 {"javascript:escape('/\\?#?')",S_OK},
4280 {"escape('/\\?#?')",S_OK},
4281 {"escape('/\\?#?')",S_OK},
4283 {"JavaSCript:escape('/\\?#?')",S_OK},
4284 {"javascript",S_OK},
4289 {Uri_HOST_UNKNOWN,S_OK},
4291 {URL_SCHEME_JAVASCRIPT,S_OK},
4292 {URLZONE_INVALID,E_NOTIMPL}
4295 { "*://google.com", 0, S_OK, FALSE,
4297 {"*:google.com/",S_OK,FALSE},
4298 {"google.com",S_OK},
4299 {"*:google.com/",S_OK,FALSE},
4300 {"google.com",S_OK,FALSE},
4303 {"google.com",S_OK,FALSE},
4308 {"*://google.com",S_OK,FALSE},
4314 {Uri_HOST_DNS,S_OK,FALSE},
4316 {URL_SCHEME_WILDCARD,S_OK,FALSE},
4317 {URLZONE_INVALID,E_NOTIMPL,FALSE}
4322 typedef struct _invalid_uri {
4328 static const invalid_uri invalid_uri_tests[] = {
4329 /* Has to have a scheme name. */
4330 {"://www.winehq.org",0,FALSE},
4331 /* Window's doesn't like URI's which are implicitly file paths without the
4332 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4334 {"C:/test/test.mp3",0,FALSE},
4335 {"\\\\Server/test/test.mp3",0,FALSE},
4336 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME,FALSE},
4337 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE,FALSE},
4338 /* Invalid schemes. */
4339 {"*abcd://not.valid.com",0,FALSE},
4340 {"*a*b*c*d://not.valid.com",0,FALSE},
4341 /* Not allowed to have invalid % encoded data. */
4342 {"ftp://google.co%XX/",0,FALSE},
4343 /* To many h16 components. */
4344 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE},
4345 /* Not enough room for IPv4 address. */
4346 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE},
4347 /* Not enough h16 components. */
4348 {"http://[1:2:3:4]",0,FALSE},
4349 /* Not enough components including IPv4. */
4350 {"http://[1:192.0.1.0]",0,FALSE},
4351 /* Not allowed to have partial IPv4 in IPv6. */
4352 {"http://[::192.0]",0,FALSE},
4353 /* Can't have elision of 1 h16 at beginning of address. */
4354 {"http://[::2:3:4:5:6:7:8]",0,FALSE},
4355 /* Can't have elision of 1 h16 at end of address. */
4356 {"http://[1:2:3:4:5:6:7::]",0,FALSE},
4357 /* Expects a valid IP Literal. */
4358 {"ftp://[not.valid.uri]/",0,FALSE},
4359 /* Expects valid port for a known scheme type. */
4360 {"ftp://www.winehq.org:123fgh",0,FALSE},
4361 /* Port exceeds USHORT_MAX for known scheme type. */
4362 {"ftp://www.winehq.org:65536",0,FALSE},
4363 /* Invalid port with IPv4 address. */
4364 {"http://www.winehq.org:1abcd",0,FALSE},
4365 /* Invalid port with IPv6 address. */
4366 {"http://[::ffff]:32xy",0,FALSE},
4367 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4368 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE},
4369 /* Not allowed to have invalid % encoded data in opaque URI path. */
4370 {"news:test%XX",0,FALSE},
4371 {"mailto:wine@winehq%G8.com",0,FALSE},
4372 /* Known scheme types can't have invalid % encoded data in query string. */
4373 {"http://google.com/?query=te%xx",0,FALSE},
4374 /* Invalid % encoded data in fragment of know scheme type. */
4375 {"ftp://google.com/#Test%xx",0,FALSE},
4376 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
4377 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE},
4378 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4379 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4380 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4381 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4382 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4383 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE},
4384 /* res URIs aren't allowed to have forbidden dos path characters in the
4387 {"res://c:\\te<st\\test/test",0,FALSE},
4388 {"res://c:\\te>st\\test/test",0,FALSE},
4389 {"res://c:\\te\"st\\test/test",0,FALSE},
4390 {"res://c:\\test/te%xxst",0,FALSE}
4393 typedef struct _uri_equality {
4395 DWORD create_flags_a;
4398 DWORD create_flags_b;
4404 static const uri_equality equality_tests[] = {
4406 "HTTP://www.winehq.org/test dir/./",0,FALSE,
4407 "http://www.winehq.org/test dir/../test dir/",0,FALSE,
4411 /* http://www.winehq.org/test%20dir */
4412 "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,
4413 "http://www.winehq.org/test dir",0,FALSE,
4417 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,FALSE,
4418 "file:///c:/test.mp3",0,FALSE,
4422 "ftp://ftp.winehq.org/",0,FALSE,
4423 "ftp://ftp.winehq.org",0,FALSE,
4427 "ftp://ftp.winehq.org/test/test2/../../testB/",0,FALSE,
4428 "ftp://ftp.winehq.org/t%45stB/",0,FALSE,
4432 "http://google.com/TEST",0,FALSE,
4433 "http://google.com/test",0,FALSE,
4437 "http://GOOGLE.com/",0,FALSE,
4438 "http://google.com/",0,FALSE,
4441 /* Performs case insensitive compare of host names (for known scheme types). */
4443 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE,FALSE,
4444 "ftp://google.com/",0,FALSE,
4448 "zip://GOOGLE.com/",0,FALSE,
4449 "zip://google.com/",0,FALSE,
4453 "file:///c:/TEST/TeST/",0,FALSE,
4454 "file:///c:/test/test/",0,FALSE,
4458 "file:///server/TEST",0,FALSE,
4459 "file:///SERVER/TEST",0,FALSE,
4463 "http://google.com",Uri_CREATE_NO_CANONICALIZE,FALSE,
4464 "http://google.com/",0,FALSE,
4468 "ftp://google.com:21/",0,FALSE,
4469 "ftp://google.com/",0,FALSE,
4473 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE,FALSE,
4474 "http://google.com/",0,FALSE,
4478 "http://google.com:70/",0,FALSE,
4479 "http://google.com:71/",0,FALSE,
4484 typedef struct _uri_with_fragment {
4486 const char* fragment;
4488 HRESULT create_expected;
4491 const char* expected_uri;
4493 } uri_with_fragment;
4495 static const uri_with_fragment uri_fragment_tests[] = {
4497 "http://google.com/","#fragment",0,S_OK,FALSE,
4498 "http://google.com/#fragment",FALSE
4501 "http://google.com/","fragment",0,S_OK,FALSE,
4502 "http://google.com/#fragment",FALSE
4505 "zip://test.com/","?test",0,S_OK,FALSE,
4506 "zip://test.com/#?test",FALSE
4508 /* The fragment can be empty. */
4510 "ftp://ftp.google.com/","",0,S_OK,FALSE,
4511 "ftp://ftp.google.com/#",FALSE
4515 typedef struct _uri_builder_property {
4518 const char *expected_value;
4519 Uri_PROPERTY property;
4522 } uri_builder_property;
4524 typedef struct _uri_builder_port {
4532 typedef struct _uri_builder_str_property {
4533 const char* expected;
4536 } uri_builder_str_property;
4538 typedef struct _uri_builder_dword_property {
4542 } uri_builder_dword_property;
4544 typedef struct _uri_builder_test {
4547 HRESULT create_builder_expected;
4548 BOOL create_builder_todo;
4550 uri_builder_property properties[URI_BUILDER_STR_PROPERTY_COUNT];
4552 uri_builder_port port_prop;
4558 DWORD uri_simple_encode_flags;
4559 HRESULT uri_simple_hres;
4560 BOOL uri_simple_todo;
4562 DWORD uri_with_flags;
4563 DWORD uri_with_builder_flags;
4564 DWORD uri_with_encode_flags;
4565 HRESULT uri_with_hres;
4568 uri_builder_str_property expected_str_props[URI_STR_PROPERTY_COUNT];
4569 uri_builder_dword_property expected_dword_props[URI_DWORD_PROPERTY_COUNT];
4572 static const uri_builder_test uri_builder_tests[] = {
4573 { "http://google.com/",0,S_OK,FALSE,
4575 {TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
4576 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE},
4577 {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE},
4578 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
4585 {"http://username:password@google.com/?query=x#fragment",S_OK},
4586 {"username:password@google.com",S_OK},
4587 {"http://google.com/?query=x#fragment",S_OK},
4588 {"google.com",S_OK},
4591 {"google.com",S_OK},
4596 {"http://username:password@google.com/?query=x#fragment",S_OK},
4598 {"username:password",S_OK},
4602 {Uri_HOST_DNS,S_OK},
4604 {URL_SCHEME_HTTP,S_OK},
4605 {URLZONE_INVALID,E_NOTIMPL}
4608 { "http://google.com/",0,S_OK,FALSE,
4610 {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
4612 {TRUE,TRUE,120,S_OK,FALSE},
4617 {"test://google.com:120/",S_OK},
4618 {"google.com:120",S_OK},
4619 {"test://google.com:120/",S_OK},
4620 {"google.com",S_OK},
4623 {"google.com",S_OK},
4628 {"test://google.com:120/",S_OK},
4634 {Uri_HOST_DNS,S_OK},
4636 {URL_SCHEME_UNKNOWN,S_OK},
4637 {URLZONE_INVALID,E_NOTIMPL}
4640 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4642 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
4643 {TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
4644 {TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
4651 {"http://[::192.2.3.4]/",S_OK},
4652 {"[::192.2.3.4]",S_OK},
4653 {"http://[::192.2.3.4]/",S_OK},
4657 {"::192.2.3.4",S_OK},
4662 {"http://[::192.2.3.4]/",S_OK},
4668 {Uri_HOST_IPV6,S_OK},
4670 {URL_SCHEME_HTTP,S_OK},
4671 {URLZONE_INVALID,E_NOTIMPL}
4674 { "http://google.com/",0,S_OK,FALSE,
4676 {TRUE,"Frag","#Frag",Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
4683 {"http://google.com/#Frag",S_OK},
4684 {"google.com",S_OK},
4685 {"http://google.com/#Frag",S_OK},
4686 {"google.com",S_OK},
4689 {"google.com",S_OK},
4694 {"http://google.com/#Frag",S_OK},
4700 {Uri_HOST_DNS,S_OK},
4702 {URL_SCHEME_HTTP,S_OK},
4703 {URLZONE_INVALID,E_NOTIMPL}
4706 { "http://google.com/",0,S_OK,FALSE,
4708 {TRUE,"","#",Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
4715 {"http://google.com/#",S_OK},
4716 {"google.com",S_OK},
4717 {"http://google.com/#",S_OK},
4718 {"google.com",S_OK},
4721 {"google.com",S_OK},
4726 {"http://google.com/#",S_OK},
4732 {Uri_HOST_DNS,S_OK},
4734 {URL_SCHEME_HTTP,S_OK},
4735 {URLZONE_INVALID,E_NOTIMPL}
4738 { "http://google.com/",0,S_OK,FALSE,
4740 {TRUE,":password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
4747 {"http://::password@google.com/",S_OK},
4748 {"::password@google.com",S_OK},
4749 {"http://google.com/",S_OK},
4750 {"google.com",S_OK},
4753 {"google.com",S_OK},
4758 {"http://::password@google.com/",S_OK},
4760 {"::password",S_OK},
4764 {Uri_HOST_DNS,S_OK},
4766 {URL_SCHEME_HTTP,S_OK},
4767 {URLZONE_INVALID,E_NOTIMPL}
4770 { "test/test",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4772 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
4775 Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
4777 Uri_CREATE_ALLOW_RELATIVE,0,0,S_OK,FALSE,
4779 {":password@test/test",S_OK},
4780 {":password@",S_OK},
4781 {":password@test/test",S_OK},
4790 {":password@test/test",S_OK},
4796 {Uri_HOST_UNKNOWN,S_OK},
4798 {URL_SCHEME_UNKNOWN,S_OK},
4799 {URLZONE_INVALID,E_NOTIMPL}
4802 { "http://google.com/",0,S_OK,FALSE,
4804 {TRUE,"test/test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
4811 {"http://google.com/test/test",S_OK},
4812 {"google.com",S_OK},
4813 {"http://google.com/test/test",S_OK},
4814 {"google.com",S_OK},
4817 {"google.com",S_OK},
4819 {"/test/test",S_OK},
4820 {"/test/test",S_OK},
4822 {"http://google.com/test/test",S_OK},
4828 {Uri_HOST_DNS,S_OK},
4830 {URL_SCHEME_HTTP,S_OK},
4831 {URLZONE_INVALID,E_NOTIMPL}
4834 { "zip:testing/test",0,S_OK,FALSE,
4836 {TRUE,"test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
4860 {Uri_HOST_UNKNOWN,S_OK},
4862 {URL_SCHEME_UNKNOWN,S_OK},
4863 {URLZONE_INVALID,E_NOTIMPL}
4866 { "http://google.com/",0,S_OK,FALSE,
4870 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
4871 {TRUE,FALSE,555,S_OK,FALSE},
4876 {"http://google.com/",S_OK},
4877 {"google.com",S_OK},
4878 {"http://google.com/",S_OK},
4879 {"google.com",S_OK},
4882 {"google.com",S_OK},
4887 {"http://google.com/",S_OK},
4893 {Uri_HOST_DNS,S_OK},
4894 /* Still returns 80, even though earlier the port was disabled. */
4896 {URL_SCHEME_HTTP,S_OK},
4897 {URLZONE_INVALID,E_NOTIMPL}
4900 { "http://google.com/",0,S_OK,FALSE,
4904 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
4905 * you'll get 122345 instead.
4907 {TRUE,122345,222,S_OK,FALSE},
4912 {"http://google.com:222/",S_OK},
4913 {"google.com:222",S_OK},
4914 {"http://google.com:222/",S_OK},
4915 {"google.com",S_OK},
4918 {"google.com",S_OK},
4923 {"http://google.com:222/",S_OK},
4929 {Uri_HOST_DNS,S_OK},
4931 {URL_SCHEME_HTTP,S_OK},
4932 {URLZONE_INVALID,E_NOTIMPL}
4935 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
4936 { "http://google.com/",0,S_OK,FALSE,
4940 {TRUE,TRUE,999999,S_OK,FALSE},
4945 {"http://google.com:999999/",S_OK},
4946 {"google.com:999999",S_OK},
4947 {"http://google.com:999999/",S_OK},
4948 {"google.com",S_OK},
4951 {"google.com",S_OK},
4956 {"http://google.com:999999/",S_OK},
4962 {Uri_HOST_DNS,S_OK},
4964 {URL_SCHEME_HTTP,S_OK},
4965 {URLZONE_INVALID,E_NOTIMPL}
4968 { "http://google.com/",0,S_OK,FALSE,
4970 {TRUE,"test","?test",Uri_PROPERTY_QUERY,S_OK,FALSE},
4978 {"http://google.com/?test",S_OK},
4979 {"google.com",S_OK},
4980 {"http://google.com/?test",S_OK},
4981 {"google.com",S_OK},
4984 {"google.com",S_OK},
4989 {"http://google.com/?test",S_OK},
4995 {Uri_HOST_DNS,S_OK},
4997 {URL_SCHEME_HTTP,S_OK},
4998 {URLZONE_INVALID,E_NOTIMPL}
5001 { "http://:password@google.com/",0,S_OK,FALSE,
5010 {"http://:password@google.com/",S_OK},
5011 {":password@google.com",S_OK},
5012 {"http://google.com/",S_OK},
5013 {"google.com",S_OK},
5016 {"google.com",S_OK},
5021 {"http://:password@google.com/",S_OK},
5027 {Uri_HOST_DNS,S_OK},
5029 {URL_SCHEME_HTTP,S_OK},
5030 {URLZONE_INVALID,E_NOTIMPL}
5033 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5034 { NULL,0,S_OK,FALSE,
5036 {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
5037 {TRUE,"google.com",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5044 {"http://google.com/",S_OK},
5045 {"google.com",S_OK},
5046 {"http://google.com/",S_OK},
5047 {"google.com",S_OK},
5050 {"google.com",S_OK},
5055 {"http://google.com/",S_OK},
5061 {Uri_HOST_DNS,S_OK},
5063 {URL_SCHEME_HTTP,S_OK},
5064 {URLZONE_INVALID,E_NOTIMPL}
5067 /* Can't set the scheme name to NULL. */
5068 { "zip://google.com/",0,S_OK,FALSE,
5070 {TRUE,NULL,"zip",Uri_PROPERTY_SCHEME_NAME,E_INVALIDARG,FALSE}
5077 {"zip://google.com/",S_OK},
5078 {"google.com",S_OK},
5079 {"zip://google.com/",S_OK},
5080 {"google.com",S_OK},
5083 {"google.com",S_OK},
5088 {"zip://google.com/",S_OK},
5094 {Uri_HOST_DNS,S_OK},
5096 {URL_SCHEME_UNKNOWN,S_OK},
5097 {URLZONE_INVALID,E_NOTIMPL}
5100 /* Can't set the scheme name to an empty string. */
5101 { "zip://google.com/",0,S_OK,FALSE,
5103 {TRUE,"","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 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5134 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5136 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE,S_OK,FALSE,
5141 0,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5143 {"http://google.com/../../",S_OK},
5144 {"google.com",S_OK},
5145 {"http://google.com/../../",S_OK},
5146 {"google.com",S_OK},
5149 {"google.com",S_OK},
5154 {"http://google.com/../../",S_OK},
5160 {Uri_HOST_DNS,S_OK},
5162 {URL_SCHEME_HTTP,S_OK},
5163 {URLZONE_INVALID,E_NOTIMPL}
5166 { "http://google.com/",0,S_OK,FALSE,
5168 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5173 Uri_CREATE_NO_DECODE_EXTRA_INFO,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5175 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5176 {"google.com",S_OK},
5177 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5178 {"google.com",S_OK},
5180 {"#Fr%3C%7C%3Eg",S_OK},
5181 {"google.com",S_OK},
5186 {"http://google.com/#Fr<|>g",S_OK},
5192 {Uri_HOST_DNS,S_OK},
5194 {URL_SCHEME_HTTP,S_OK},
5195 {URLZONE_INVALID,E_NOTIMPL}
5198 { "http://google.com/",0,S_OK,FALSE,
5200 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5203 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,E_INVALIDARG,FALSE,
5205 Uri_CREATE_CANONICALIZE|Uri_CREATE_NO_CANONICALIZE,UriBuilder_USE_ORIGINAL_FLAGS,0,S_OK,FALSE,
5207 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5208 {"google.com",S_OK},
5209 {"http://google.com/#Fr%3C%7C%3Eg",S_OK},
5210 {"google.com",S_OK},
5212 {"#Fr%3C%7C%3Eg",S_OK},
5213 {"google.com",S_OK},
5218 {"http://google.com/#Fr<|>g",S_OK},
5224 {Uri_HOST_DNS,S_OK},
5226 {URL_SCHEME_HTTP,S_OK},
5227 {URLZONE_INVALID,E_NOTIMPL}
5230 { NULL,0,S_OK,FALSE,
5232 {TRUE,"/test/test/",NULL,Uri_PROPERTY_PATH,S_OK,FALSE},
5233 {TRUE,"#Fr<|>g",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}
5236 0,INET_E_INVALID_URL,FALSE,
5237 0,INET_E_INVALID_URL,FALSE,
5238 0,0,0,INET_E_INVALID_URL,FALSE
5240 { "http://google.com/",0,S_OK,FALSE,
5242 {TRUE,"ht%xxtp",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
5245 0,INET_E_INVALID_URL,FALSE,
5246 0,INET_E_INVALID_URL,FALSE,
5247 0,0,0,INET_E_INVALID_URL,FALSE
5249 /* File scheme's can't have a username set. */
5250 { "file://google.com/",0,S_OK,FALSE,
5252 {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5255 0,INET_E_INVALID_URL,FALSE,
5256 0,INET_E_INVALID_URL,FALSE,
5257 0,0,0,INET_E_INVALID_URL,FALSE
5259 /* File schemes can't have a password set. */
5260 { "file://google.com/",0,S_OK,FALSE,
5262 {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5265 0,INET_E_INVALID_URL,FALSE,
5266 0,INET_E_INVALID_URL,FALSE,
5267 0,0,0,INET_E_INVALID_URL,FALSE
5269 /* UserName can't contain any character that is a delimeter for another
5270 * component that appears after it in a normal URI.
5272 { "http://google.com/",0,S_OK,FALSE,
5274 {TRUE,"user:pass",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5277 0,INET_E_INVALID_URL,FALSE,
5278 0,INET_E_INVALID_URL,FALSE,
5279 0,0,0,INET_E_INVALID_URL,FALSE
5281 { "http://google.com/",0,S_OK,FALSE,
5283 {TRUE,"user@google.com",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5286 0,INET_E_INVALID_URL,FALSE,
5287 0,INET_E_INVALID_URL,FALSE,
5288 0,0,0,INET_E_INVALID_URL,FALSE
5290 { "http://google.com/",0,S_OK,FALSE,
5292 {TRUE,"user/path",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5295 0,INET_E_INVALID_URL,FALSE,
5296 0,INET_E_INVALID_URL,FALSE,
5297 0,0,0,INET_E_INVALID_URL,FALSE
5299 { "http://google.com/",0,S_OK,FALSE,
5301 {TRUE,"user?Query",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5304 0,INET_E_INVALID_URL,FALSE,
5305 0,INET_E_INVALID_URL,FALSE,
5306 0,0,0,INET_E_INVALID_URL,FALSE
5308 { "http://google.com/",0,S_OK,FALSE,
5310 {TRUE,"user#Frag",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE}
5313 0,INET_E_INVALID_URL,FALSE,
5314 0,INET_E_INVALID_URL,FALSE,
5315 0,0,0,INET_E_INVALID_URL,FALSE
5317 { "http://google.com/",0,S_OK,FALSE,
5319 {TRUE,"pass@google.com",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5322 0,INET_E_INVALID_URL,FALSE,
5323 0,INET_E_INVALID_URL,FALSE,
5324 0,0,0,INET_E_INVALID_URL,FALSE
5326 { "http://google.com/",0,S_OK,FALSE,
5328 {TRUE,"pass/path",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5331 0,INET_E_INVALID_URL,FALSE,
5332 0,INET_E_INVALID_URL,FALSE,
5333 0,0,0,INET_E_INVALID_URL,FALSE
5335 { "http://google.com/",0,S_OK,FALSE,
5337 {TRUE,"pass?query",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5340 0,INET_E_INVALID_URL,FALSE,
5341 0,INET_E_INVALID_URL,FALSE,
5342 0,0,0,INET_E_INVALID_URL,FALSE
5344 { "http://google.com/",0,S_OK,FALSE,
5346 {TRUE,"pass#frag",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
5349 0,INET_E_INVALID_URL,FALSE,
5350 0,INET_E_INVALID_URL,FALSE,
5351 0,0,0,INET_E_INVALID_URL,FALSE
5353 { "http://google.com/",0,S_OK,FALSE,
5355 {TRUE,"winehq.org/test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5358 0,INET_E_INVALID_URL,FALSE,
5359 0,INET_E_INVALID_URL,FALSE,
5360 0,0,0,INET_E_INVALID_URL,FALSE
5362 { "http://google.com/",0,S_OK,FALSE,
5364 {TRUE,"winehq.org?test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5367 0,INET_E_INVALID_URL,FALSE,
5368 0,INET_E_INVALID_URL,FALSE,
5369 0,0,0,INET_E_INVALID_URL,FALSE
5371 { "http://google.com/",0,S_OK,FALSE,
5373 {TRUE,"winehq.org#test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5376 0,INET_E_INVALID_URL,FALSE,
5377 0,INET_E_INVALID_URL,FALSE,
5378 0,0,0,INET_E_INVALID_URL,FALSE
5380 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5381 { "http://google.com/",0,S_OK,FALSE,
5383 {TRUE,"winehq.org:test",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
5390 {"http://winehq.org:test/",S_OK},
5391 {"winehq.org:test",S_OK},
5392 {"http://winehq.org:test/",S_OK},
5393 {"winehq.org:test",S_OK},
5396 {"winehq.org:test",S_OK},
5401 {"http://winehq.org:test/",S_OK},
5407 {Uri_HOST_DNS,S_OK},
5409 {URL_SCHEME_HTTP,S_OK},
5410 {URLZONE_INVALID,E_NOTIMPL}
5413 /* Can't set the host name to NULL. */
5414 { "http://google.com/",0,S_OK,FALSE,
5416 {TRUE,NULL,"google.com",Uri_PROPERTY_HOST,E_INVALIDARG,FALSE}
5423 {"http://google.com/",S_OK},
5424 {"google.com",S_OK},
5425 {"http://google.com/",S_OK},
5426 {"google.com",S_OK},
5429 {"google.com",S_OK},
5434 {"http://google.com/",S_OK},
5440 {Uri_HOST_DNS,S_OK},
5442 {URL_SCHEME_HTTP,S_OK},
5443 {URLZONE_INVALID,E_NOTIMPL}
5446 /* Can set the host name to an empty string. */
5447 { "http://google.com/",0,S_OK,FALSE,
5449 {TRUE,"",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}
5473 {Uri_HOST_UNKNOWN,S_OK},
5475 {URL_SCHEME_HTTP,S_OK},
5476 {URLZONE_INVALID,E_NOTIMPL}
5479 { "http://google.com/",0,S_OK,FALSE,
5481 {TRUE,"/path?query",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
5484 0,INET_E_INVALID_URL,FALSE,
5485 0,INET_E_INVALID_URL,FALSE,
5486 0,0,0,INET_E_INVALID_URL,FALSE
5488 { "http://google.com/",0,S_OK,FALSE,
5490 {TRUE,"/path#test",NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
5493 0,INET_E_INVALID_URL,FALSE,
5494 0,INET_E_INVALID_URL,FALSE,
5495 0,0,0,INET_E_INVALID_URL,FALSE
5497 { "http://google.com/",0,S_OK,FALSE,
5499 {TRUE,"?path#test",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE}
5502 0,INET_E_INVALID_URL,FALSE,
5503 0,INET_E_INVALID_URL,FALSE,
5504 0,0,0,INET_E_INVALID_URL,FALSE
5508 typedef struct _uri_builder_remove_test {
5511 HRESULT create_builder_expected;
5512 BOOL create_builder_todo;
5514 DWORD remove_properties;
5515 HRESULT remove_expected;
5518 const char *expected_uri;
5519 DWORD expected_flags;
5520 HRESULT expected_hres;
5522 } uri_builder_remove_test;
5524 static const uri_builder_remove_test uri_builder_remove_tests[] = {
5525 { "http://google.com/test?test=y#Frag",0,S_OK,FALSE,
5526 Uri_HAS_FRAGMENT|Uri_HAS_PATH|Uri_HAS_QUERY,S_OK,FALSE,
5527 "http://google.com/",0,S_OK,FALSE
5529 { "http://user:pass@winehq.org/",0,S_OK,FALSE,
5530 Uri_HAS_USER_NAME|Uri_HAS_PASSWORD,S_OK,FALSE,
5531 "http://winehq.org/",0,S_OK,FALSE
5533 { "zip://google.com?Test=x",0,S_OK,FALSE,
5534 Uri_HAS_HOST,S_OK,FALSE,
5535 "zip:/?Test=x",0,S_OK,FALSE
5537 /* Doesn't remove the whole userinfo component. */
5538 { "http://username:pass@google.com/",0,S_OK,FALSE,
5539 Uri_HAS_USER_INFO,S_OK,FALSE,
5540 "http://username:pass@google.com/",0,S_OK,FALSE
5542 /* Doesn't remove the domain. */
5543 { "http://google.com/",0,S_OK,FALSE,
5544 Uri_HAS_DOMAIN,S_OK,FALSE,
5545 "http://google.com/",0,S_OK,FALSE
5547 { "http://google.com:120/",0,S_OK,FALSE,
5548 Uri_HAS_AUTHORITY,S_OK,FALSE,
5549 "http://google.com:120/",0,S_OK,FALSE
5551 { "http://google.com/test.com/",0,S_OK,FALSE,
5552 Uri_HAS_EXTENSION,S_OK,FALSE,
5553 "http://google.com/test.com/",0,S_OK,FALSE
5555 { "http://google.com/?test=x",0,S_OK,FALSE,
5556 Uri_HAS_PATH_AND_QUERY,S_OK,FALSE,
5557 "http://google.com/?test=x",0,S_OK,FALSE
5559 /* Can't remove the scheme name. */
5560 { "http://google.com/?test=x",0,S_OK,FALSE,
5561 Uri_HAS_SCHEME_NAME|Uri_HAS_QUERY,E_INVALIDARG,FALSE,
5562 "http://google.com/?test=x",0,S_OK,FALSE
5566 typedef struct _uri_combine_str_property {
5570 const char *broken_value;
5571 const char *value_ex;
5572 } uri_combine_str_property;
5574 typedef struct _uri_combine_test {
5575 const char *base_uri;
5576 DWORD base_create_flags;
5577 const char *relative_uri;
5578 DWORD relative_create_flags;
5579 DWORD combine_flags;
5583 uri_combine_str_property str_props[URI_STR_PROPERTY_COUNT];
5584 uri_dword_property dword_props[URI_DWORD_PROPERTY_COUNT];
5587 static const uri_combine_test uri_combine_tests[] = {
5588 { "http://google.com/fun/stuff",0,
5589 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE,
5592 {"http://google.com/not/fun/stuff",S_OK},
5593 {"google.com",S_OK},
5594 {"http://google.com/not/fun/stuff",S_OK},
5595 {"google.com",S_OK},
5598 {"google.com",S_OK},
5600 {"/not/fun/stuff",S_OK},
5601 {"/not/fun/stuff",S_OK},
5603 {"http://google.com/not/fun/stuff",S_OK},
5609 {Uri_HOST_DNS,S_OK},
5611 {URL_SCHEME_HTTP,S_OK},
5612 {URLZONE_INVALID,E_NOTIMPL}
5615 { "http://google.com/test",0,
5616 "zip://test.com/cool",0,
5619 {"zip://test.com/cool",S_OK},
5621 {"zip://test.com/cool",S_OK},
5630 {"zip://test.com/cool",S_OK},
5636 {Uri_HOST_DNS,S_OK},
5638 {URL_SCHEME_UNKNOWN,S_OK},
5639 {URLZONE_INVALID,E_NOTIMPL}
5642 { "http://google.com/use/base/path",0,
5643 "?relative",Uri_CREATE_ALLOW_RELATIVE,
5646 {"http://google.com/use/base/path?relative",S_OK},
5647 {"google.com",S_OK},
5648 {"http://google.com/use/base/path?relative",S_OK},
5649 {"google.com",S_OK},
5652 {"google.com",S_OK},
5654 {"/use/base/path",S_OK},
5655 {"/use/base/path?relative",S_OK},
5657 {"http://google.com/use/base/path?relative",S_OK},
5663 {Uri_HOST_DNS,S_OK},
5665 {URL_SCHEME_HTTP,S_OK},
5666 {URLZONE_INVALID,E_NOTIMPL}
5669 { "http://google.com/path",0,
5670 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
5673 {"http://google.com/testing",S_OK},
5674 {"google.com",S_OK},
5675 {"http://google.com/testing",S_OK},
5676 {"google.com",S_OK},
5679 {"google.com",S_OK},
5684 {"http://google.com/testing",S_OK},
5690 {Uri_HOST_DNS,S_OK},
5692 {URL_SCHEME_HTTP,S_OK},
5693 {URLZONE_INVALID,E_NOTIMPL}
5696 { "http://google.com/path",0,
5697 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE,
5698 URL_DONT_SIMPLIFY,S_OK,FALSE,
5700 {"http://google.com:80/test/../test/.././testing",S_OK},
5701 {"google.com",S_OK},
5702 {"http://google.com:80/test/../test/.././testing",S_OK},
5703 {"google.com",S_OK},
5706 {"google.com",S_OK},
5708 {"/test/../test/.././testing",S_OK},
5709 {"/test/../test/.././testing",S_OK},
5711 {"http://google.com:80/test/../test/.././testing",S_OK},
5717 {Uri_HOST_DNS,S_OK},
5719 {URL_SCHEME_HTTP,S_OK},
5720 {URLZONE_INVALID,E_NOTIMPL}
5723 { "http://winehq.org/test/abc",0,
5724 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
5727 {"http://winehq.org/test/testing/test",S_OK},
5728 {"winehq.org",S_OK},
5729 {"http://winehq.org/test/testing/test",S_OK},
5730 {"winehq.org",S_OK},
5733 {"winehq.org",S_OK},
5735 {"/test/testing/test",S_OK},
5736 {"/test/testing/test",S_OK},
5738 {"http://winehq.org/test/testing/test",S_OK},
5744 {Uri_HOST_DNS,S_OK},
5746 {URL_SCHEME_HTTP,S_OK},
5747 {URLZONE_INVALID,E_NOTIMPL}
5750 { "http://winehq.org/test/abc",0,
5751 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE,
5752 URL_DONT_SIMPLIFY,S_OK,FALSE,
5754 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5755 /* Default port is hidden in the authority. */
5756 {"winehq.org",S_OK},
5757 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5758 {"winehq.org",S_OK},
5761 {"winehq.org",S_OK},
5763 {"/test/testing/abc/../test",S_OK},
5764 {"/test/testing/abc/../test",S_OK},
5766 {"http://winehq.org:80/test/testing/abc/../test",S_OK},
5772 {Uri_HOST_DNS,S_OK},
5774 {URL_SCHEME_HTTP,S_OK},
5775 {URLZONE_INVALID,E_NOTIMPL}
5778 { "http://winehq.org/test?query",0,
5779 "testing",Uri_CREATE_ALLOW_RELATIVE,
5782 {"http://winehq.org/testing",S_OK},
5783 {"winehq.org",S_OK},
5784 {"http://winehq.org/testing",S_OK},
5785 {"winehq.org",S_OK},
5788 {"winehq.org",S_OK},
5793 {"http://winehq.org/testing",S_OK},
5799 {Uri_HOST_DNS,S_OK},
5801 {URL_SCHEME_HTTP,S_OK},
5802 {URLZONE_INVALID,E_NOTIMPL}
5805 { "http://winehq.org/test#frag",0,
5806 "testing",Uri_CREATE_ALLOW_RELATIVE,
5809 {"http://winehq.org/testing",S_OK},
5810 {"winehq.org",S_OK},
5811 {"http://winehq.org/testing",S_OK},
5812 {"winehq.org",S_OK},
5815 {"winehq.org",S_OK},
5820 {"http://winehq.org/testing",S_OK},
5826 {Uri_HOST_DNS,S_OK},
5828 {URL_SCHEME_HTTP,S_OK},
5829 {URLZONE_INVALID,E_NOTIMPL}
5832 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE,
5833 "test",Uri_CREATE_ALLOW_RELATIVE,
5853 {Uri_HOST_UNKNOWN,S_OK},
5855 {URL_SCHEME_UNKNOWN,S_OK},
5856 {URLZONE_INVALID,E_NOTIMPL}
5859 { "file:///c:/test/test",0,
5860 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5861 URL_FILE_USE_PATHURL,S_OK,FALSE,
5863 {"file://c:\\testing.mp3",S_OK},
5865 {"file://c:\\testing.mp3",S_OK},
5871 {"c:\\testing.mp3",S_OK},
5872 {"c:\\testing.mp3",S_OK},
5874 {"file://c:\\testing.mp3",S_OK},
5880 {Uri_HOST_UNKNOWN,S_OK},
5882 {URL_SCHEME_FILE,S_OK},
5883 {URLZONE_INVALID,E_NOTIMPL}
5886 { "file:///c:/test/test",0,
5887 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5890 {"file:///c:/testing.mp3",S_OK},
5892 {"file:///c:/testing.mp3",S_OK},
5898 {"/c:/testing.mp3",S_OK},
5899 {"/c:/testing.mp3",S_OK},
5901 {"file:///c:/testing.mp3",S_OK},
5907 {Uri_HOST_UNKNOWN,S_OK},
5909 {URL_SCHEME_FILE,S_OK},
5910 {URLZONE_INVALID,E_NOTIMPL}
5913 { "file://test.com/test/test",0,
5914 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE,
5915 URL_FILE_USE_PATHURL,S_OK,FALSE,
5917 {"file://\\\\test.com\\testing.mp3",S_OK},
5919 {"file://\\\\test.com\\testing.mp3",S_OK},
5925 {"\\testing.mp3",S_OK},
5926 {"\\testing.mp3",S_OK},
5928 {"file://\\\\test.com\\testing.mp3",S_OK},
5934 {Uri_HOST_DNS,S_OK},
5936 {URL_SCHEME_FILE,S_OK},
5937 {URLZONE_INVALID,E_NOTIMPL}
5940 /* URL_DONT_SIMPLIFY has no effect. */
5941 { "http://google.com/test",0,
5942 "zip://test.com/cool/../cool/test",0,
5943 URL_DONT_SIMPLIFY,S_OK,FALSE,
5945 {"zip://test.com/cool/test",S_OK,FALSE,NULL,"zip://test.com/cool/../cool/test"},
5947 {"zip://test.com/cool/test",S_OK,FALSE,NULL,"zip://test.com/cool/../cool/test"},
5953 {"/cool/test",S_OK,FALSE,NULL,"/cool/../cool/test"},
5954 {"/cool/test",S_OK,FALSE,NULL,"/cool/../cool/test"},
5956 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
5957 * On IE 7 it reduces the path in the Raw URI.
5959 {"zip://test.com/cool/../cool/test",S_OK,FALSE,"zip://test.com/cool/test"},
5965 {Uri_HOST_DNS,S_OK},
5967 {URL_SCHEME_UNKNOWN,S_OK},
5968 {URLZONE_INVALID,E_NOTIMPL}
5971 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
5972 * resulting URI is converted into a dos path.
5974 { "http://google.com/test",0,
5975 "file:///c:/test/",0,
5976 URL_FILE_USE_PATHURL,S_OK,FALSE,
5978 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
5980 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
5986 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
5987 {"/c:/test/",S_OK,FALSE,"c:\\test\\"},
5989 {"file:///c:/test/",S_OK,FALSE,"file://c:\\test\\"},
5995 {Uri_HOST_UNKNOWN,S_OK},
5997 {URL_SCHEME_FILE,S_OK},
5998 {URLZONE_INVALID,E_NOTIMPL}
6001 { "http://google.com/test",0,
6002 "http://test.com/test#%30test",0,
6003 URL_DONT_UNESCAPE_EXTRA_INFO,S_OK,FALSE,
6005 {"http://test.com/test#0test",S_OK,FALSE,NULL,"http://test.com/test#%30test"},
6007 {"http://test.com/test#0test",S_OK,FALSE,NULL,"http://test.com/test#%30test"},
6010 {"#0test",S_OK,FALSE,NULL,"#%30test"},
6016 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
6017 {"http://test.com/test#%30test",S_OK,FALSE,"http://test.com/test#0test"},
6023 {Uri_HOST_DNS,S_OK},
6025 {URL_SCHEME_HTTP,S_OK},
6026 {URLZONE_INVALID,E_NOTIMPL}
6029 /* Windows validates the path component from the relative Uri. */
6030 { "http://google.com/test",0,
6031 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE,
6032 0,E_INVALIDARG,FALSE
6034 /* Windows doesn't validate the query from the relative Uri. */
6035 { "http://google.com/test",0,
6036 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
6039 {"http://google.com/test?Tes%XXt",S_OK},
6040 {"google.com",S_OK},
6041 {"http://google.com/test?Tes%XXt",S_OK},
6042 {"google.com",S_OK},
6045 {"google.com",S_OK},
6048 {"/test?Tes%XXt",S_OK},
6050 {"http://google.com/test?Tes%XXt",S_OK},
6056 {Uri_HOST_DNS,S_OK},
6058 {URL_SCHEME_HTTP,S_OK},
6059 {URLZONE_INVALID,E_NOTIMPL}
6062 /* Windows doesn't validate the fragment from the relative Uri. */
6063 { "http://google.com/test",0,
6064 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE,
6067 {"http://google.com/test#Tes%XXt",S_OK},
6068 {"google.com",S_OK},
6069 {"http://google.com/test#Tes%XXt",S_OK},
6070 {"google.com",S_OK},
6073 {"google.com",S_OK},
6078 {"http://google.com/test#Tes%XXt",S_OK},
6084 {Uri_HOST_DNS,S_OK},
6086 {URL_SCHEME_HTTP,S_OK},
6087 {URLZONE_INVALID,E_NOTIMPL}
6090 /* Creates an IUri which contains an invalid dos path char. */
6091 { "file:///c:/test",0,
6092 "/test<ing",Uri_CREATE_ALLOW_RELATIVE,
6093 URL_FILE_USE_PATHURL,S_OK,FALSE,
6095 {"file://c:\\test<ing",S_OK},
6097 {"file://c:\\test<ing",S_OK},
6103 {"c:\\test<ing",S_OK},
6104 {"c:\\test<ing",S_OK},
6106 {"file://c:\\test<ing",S_OK},
6112 {Uri_HOST_UNKNOWN,S_OK},
6114 {URL_SCHEME_FILE,S_OK},
6115 {URLZONE_INVALID,E_NOTIMPL}
6118 /* Appends the path after the drive letter (if any). */
6119 { "file:///c:/test",0,
6120 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE,
6123 {"file:///c:/c:/testing",S_OK},
6125 {"file:///c:/c:/testing",S_OK},
6131 {"/c:/c:/testing",S_OK},
6132 {"/c:/c:/testing",S_OK},
6134 {"file:///c:/c:/testing",S_OK},
6140 {Uri_HOST_UNKNOWN,S_OK},
6142 {URL_SCHEME_FILE,S_OK},
6143 {URLZONE_INVALID,E_NOTIMPL}
6146 /* A '/' is added if the base URI doesn't have a path and the
6147 * relative URI doesn't contain a path (since the base URI is
6150 { "http://google.com",Uri_CREATE_NO_CANONICALIZE,
6151 "?test",Uri_CREATE_ALLOW_RELATIVE,
6154 {"http://google.com/?test",S_OK},
6155 {"google.com",S_OK},
6156 {"http://google.com/?test",S_OK},
6157 {"google.com",S_OK},
6160 {"google.com",S_OK},
6165 {"http://google.com/?test",S_OK},
6171 {Uri_HOST_DNS,S_OK},
6173 {URL_SCHEME_HTTP,S_OK},
6174 {URLZONE_INVALID,E_NOTIMPL}
6177 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE,
6178 "?test",Uri_CREATE_ALLOW_RELATIVE,
6181 {"zip://google.com/?test",S_OK},
6182 {"google.com",S_OK},
6183 {"zip://google.com/?test",S_OK},
6184 {"google.com",S_OK},
6187 {"google.com",S_OK},
6192 {"zip://google.com/?test",S_OK},
6198 {Uri_HOST_DNS,S_OK},
6200 {URL_SCHEME_UNKNOWN,S_OK},
6201 {URLZONE_INVALID,E_NOTIMPL}
6204 /* No path is appended since the base URI is opaque. */
6206 "?test",Uri_CREATE_ALLOW_RELATIVE,
6226 {Uri_HOST_UNKNOWN,S_OK},
6228 {URL_SCHEME_UNKNOWN,S_OK},
6229 {URLZONE_INVALID,E_NOTIMPL}
6233 "../testing/test",Uri_CREATE_ALLOW_RELATIVE,
6236 {"file:///c:/testing/test",S_OK},
6238 {"file:///c:/testing/test",S_OK},
6244 {"/c:/testing/test",S_OK},
6245 {"/c:/testing/test",S_OK},
6247 {"file:///c:/testing/test",S_OK},
6253 {Uri_HOST_UNKNOWN,S_OK},
6255 {URL_SCHEME_FILE,S_OK},
6256 {URLZONE_INVALID,E_NOTIMPL}
6259 { "http://winehq.org/dir/testfile",0,
6260 "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
6263 {"http://winehq.org/dir/test?querystring",S_OK},
6264 {"winehq.org",S_OK},
6265 {"http://winehq.org/dir/test?querystring",S_OK},
6266 {"winehq.org",S_OK},
6269 {"winehq.org",S_OK},
6272 {"/dir/test?querystring",S_OK},
6273 {"?querystring",S_OK},
6274 {"http://winehq.org/dir/test?querystring",S_OK},
6280 {Uri_HOST_DNS,S_OK},
6282 {URL_SCHEME_HTTP,S_OK},
6283 {URLZONE_INVALID,E_NOTIMPL}
6286 { "http://winehq.org/dir/test",0,
6287 "test?querystring",Uri_CREATE_ALLOW_RELATIVE,
6290 {"http://winehq.org/dir/test?querystring",S_OK},
6291 {"winehq.org",S_OK},
6292 {"http://winehq.org/dir/test?querystring",S_OK},
6293 {"winehq.org",S_OK},
6296 {"winehq.org",S_OK},
6299 {"/dir/test?querystring",S_OK},
6300 {"?querystring",S_OK},
6301 {"http://winehq.org/dir/test?querystring",S_OK},
6307 {Uri_HOST_DNS,S_OK},
6309 {URL_SCHEME_HTTP,S_OK},
6310 {URLZONE_INVALID,E_NOTIMPL}
6313 { "http://winehq.org/dir/test?querystring",0,
6314 "#hash",Uri_CREATE_ALLOW_RELATIVE,
6317 {"http://winehq.org/dir/test?querystring#hash",S_OK},
6318 {"winehq.org",S_OK},
6319 {"http://winehq.org/dir/test?querystring#hash",S_OK},
6320 {"winehq.org",S_OK},
6323 {"winehq.org",S_OK},
6326 {"/dir/test?querystring",S_OK},
6327 {"?querystring",S_OK},
6328 {"http://winehq.org/dir/test?querystring#hash",S_OK},
6334 {Uri_HOST_DNS,S_OK},
6336 {URL_SCHEME_HTTP,S_OK},
6337 {URLZONE_INVALID,E_NOTIMPL}
6342 typedef struct _uri_parse_test {
6347 const char *property;
6352 static const uri_parse_test uri_parse_tests[] = {
6353 /* PARSE_CANONICALIZE tests. */
6354 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE,0,"zip://google.com/test<|>",S_OK,FALSE},
6355 {"http://google.com/test<|>",0,PARSE_CANONICALIZE,0,"http://google.com/test%3C%7C%3E",S_OK,FALSE},
6356 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE,URL_UNESCAPE,"http://google.com/0#?",S_OK,FALSE},
6357 {"test <|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_ESCAPE_UNSAFE,"test %3C%7C%3E",S_OK,FALSE},
6358 {"test <|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_ESCAPE_SPACES_ONLY,"test%20<|>",S_OK,FALSE},
6359 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE,PARSE_CANONICALIZE,URL_UNESCAPE|URL_ESCAPE_UNSAFE,"test%20%3C%7C%3E",S_OK,FALSE},
6360 {"http://google.com/%20",0,PARSE_CANONICALIZE,URL_ESCAPE_PERCENT,"http://google.com/%2520",S_OK,FALSE},
6361 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_DONT_SIMPLIFY,"http://google.com/test/../",S_OK,FALSE},
6362 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_NO_META,"http://google.com/test/../",S_OK,FALSE},
6363 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,0,"http://google.com/",S_OK,FALSE},
6364 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,0,"zip://google.com/",S_OK,FALSE},
6365 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE,PARSE_CANONICALIZE,URL_DONT_SIMPLIFY,"file:///c:/test/../test",S_OK,FALSE},
6367 /* PARSE_FRIENDLY tests. */
6368 {"http://test@google.com/test#test",0,PARSE_FRIENDLY,0,"http://google.com/test#test",S_OK,FALSE},
6369 {"zip://test@google.com/test",0,PARSE_FRIENDLY,0,"zip://test@google.com/test",S_OK,FALSE},
6371 /* PARSE_ROOTDOCUMENT tests. */
6372 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT,0,"http://google.com:200/",S_OK,FALSE},
6373 {"http://google.com",Uri_CREATE_NO_CANONICALIZE,PARSE_ROOTDOCUMENT,0,"http://google.com/",S_OK,FALSE},
6374 {"zip://google.com/",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
6375 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
6376 {"file://server/test",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
6377 {"zip:test/test",0,PARSE_ROOTDOCUMENT,0,"",S_OK,FALSE},
6379 /* PARSE_DOCUMENT tests. */
6380 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT,0,"http://test@google.com/test?query",S_OK,FALSE},
6381 {"http:testing#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
6382 {"file:///c:/test#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
6383 {"zip://google.com/#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
6384 {"zip:test#frag",0,PARSE_DOCUMENT,0,"",S_OK,FALSE},
6385 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE,PARSE_DOCUMENT,0,"",S_OK,FALSE},
6387 /* PARSE_PATH_FROM_URL tests. */
6388 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\test.mp3",S_OK,FALSE},
6389 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL,0,"c:\\t<|>est.mp3",S_OK,FALSE},
6390 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL,0,"c:\\te%XX t\\",S_OK,FALSE},
6391 {"file://server/test",0,PARSE_PATH_FROM_URL,0,"\\\\server\\test",S_OK,FALSE},
6392 {"http://google.com/",0,PARSE_PATH_FROM_URL,0,"",E_INVALIDARG,FALSE},
6394 /* PARSE_URL_FROM_PATH tests. */
6395 /* This function almost seems to useless (just returns the absolute uri). */
6396 {"test.com",Uri_CREATE_ALLOW_RELATIVE,PARSE_URL_FROM_PATH,0,"test.com",S_OK,FALSE},
6397 {"/test/test",Uri_CREATE_ALLOW_RELATIVE,PARSE_URL_FROM_PATH,0,"/test/test",S_OK,FALSE},
6398 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH,PARSE_URL_FROM_PATH,0,"file://c:\\test\\test",S_OK,FALSE},
6399 {"file:c:/test",0,PARSE_URL_FROM_PATH,0,"",S_OK,FALSE},
6400 {"http:google.com/",0,PARSE_URL_FROM_PATH,0,"",S_OK,FALSE},
6402 /* PARSE_SCHEMA tests. */
6403 {"http://google.com/test",0,PARSE_SCHEMA,0,"http",S_OK,FALSE},
6404 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_SCHEMA,0,"",S_OK,FALSE},
6406 /* PARSE_SITE tests. */
6407 {"http://google.uk.com/",0,PARSE_SITE,0,"google.uk.com",S_OK,FALSE},
6408 {"http://google.com.com/",0,PARSE_SITE,0,"google.com.com",S_OK,FALSE},
6409 {"google.com",Uri_CREATE_ALLOW_RELATIVE,PARSE_SITE,0,"",S_OK,FALSE},
6410 {"file://server/test",0,PARSE_SITE,0,"server",S_OK,FALSE},
6412 /* PARSE_DOMAIN tests. */
6413 {"http://google.com.uk/",0,PARSE_DOMAIN,0,"google.com.uk",S_OK,FALSE},
6414 {"http://google.com.com/",0,PARSE_DOMAIN,0,"com.com",S_OK,FALSE},
6415 {"test/test",Uri_CREATE_ALLOW_RELATIVE,PARSE_DOMAIN,0,"",S_OK,FALSE},
6416 {"file://server/test",0,PARSE_DOMAIN,0,"",S_OK,FALSE},
6418 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
6419 {"http://google.com/test#Test",0,PARSE_ANCHOR,0,"#Test",S_OK,FALSE},
6420 {"http://google.com/test#Test",0,PARSE_LOCATION,0,"#Test",S_OK,FALSE},
6421 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_ANCHOR,0,"",S_OK,FALSE},
6422 {"test",Uri_CREATE_ALLOW_RELATIVE,PARSE_LOCATION,0,"",S_OK,FALSE}
6425 static inline LPWSTR a2w(LPCSTR str) {
6429 DWORD len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
6430 ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
6431 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
6437 static inline BOOL heap_free(void* mem) {
6438 return HeapFree(GetProcessHeap(), 0, mem);
6441 static inline DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB) {
6442 LPWSTR strAW = a2w(strA);
6443 DWORD ret = lstrcmpW(strAW, strB);
6448 static inline ULONG get_refcnt(IUri *uri) {
6450 return IUri_Release(uri);
6453 static void change_property(IUriBuilder *builder, const uri_builder_property *prop,
6458 valueW = a2w(prop->value);
6459 switch(prop->property) {
6460 case Uri_PROPERTY_FRAGMENT:
6461 hr = IUriBuilder_SetFragment(builder, valueW);
6464 ok(hr == prop->expected,
6465 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6466 hr, prop->expected, test_index);
6469 ok(hr == prop->expected,
6470 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6471 hr, prop->expected, test_index);
6474 case Uri_PROPERTY_HOST:
6475 hr = IUriBuilder_SetHost(builder, valueW);
6478 ok(hr == prop->expected,
6479 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6480 hr, prop->expected, test_index);
6483 ok(hr == prop->expected,
6484 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6485 hr, prop->expected, test_index);
6488 case Uri_PROPERTY_PASSWORD:
6489 hr = IUriBuilder_SetPassword(builder, valueW);
6492 ok(hr == prop->expected,
6493 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6494 hr, prop->expected, test_index);
6497 ok(hr == prop->expected,
6498 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6499 hr, prop->expected, test_index);
6502 case Uri_PROPERTY_PATH:
6503 hr = IUriBuilder_SetPath(builder, valueW);
6506 ok(hr == prop->expected,
6507 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6508 hr, prop->expected, test_index);
6511 ok(hr == prop->expected,
6512 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6513 hr, prop->expected, test_index);
6516 case Uri_PROPERTY_QUERY:
6517 hr = IUriBuilder_SetQuery(builder, valueW);
6520 ok(hr == prop->expected,
6521 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6522 hr, prop->expected, test_index);
6525 ok(hr == prop->expected,
6526 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6527 hr, prop->expected, test_index);
6530 case Uri_PROPERTY_SCHEME_NAME:
6531 hr = IUriBuilder_SetSchemeName(builder, valueW);
6534 ok(hr == prop->expected,
6535 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6536 hr, prop->expected, test_index);
6539 ok(hr == prop->expected,
6540 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6541 hr, prop->expected, test_index);
6544 case Uri_PROPERTY_USER_NAME:
6545 hr = IUriBuilder_SetUserName(builder, valueW);
6548 ok(hr == prop->expected,
6549 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6550 hr, prop->expected, test_index);
6553 ok(hr == prop->expected,
6554 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6555 hr, prop->expected, test_index);
6559 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop->property, test_index);
6566 * Simple tests to make sure the CreateUri function handles invalid flag combinations
6569 static void test_CreateUri_InvalidFlags(void) {
6572 for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
6574 IUri *uri = (void*) 0xdeadbeef;
6576 hr = pCreateUri(http_urlW, invalid_flag_tests[i].flags, 0, &uri);
6577 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
6578 hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
6579 ok(uri == NULL, "Error: expected the IUri to be NULL, but it was %p instead\n", uri);
6583 static void test_CreateUri_InvalidArgs(void) {
6585 IUri *uri = (void*) 0xdeadbeef;
6587 const WCHAR invalidW[] = {'i','n','v','a','l','i','d',0};
6588 static const WCHAR emptyW[] = {0};
6590 hr = pCreateUri(http_urlW, 0, 0, NULL);
6591 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
6593 hr = pCreateUri(NULL, 0, 0, &uri);
6594 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
6595 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6597 uri = (void*) 0xdeadbeef;
6598 hr = pCreateUri(invalidW, 0, 0, &uri);
6599 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6600 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6602 uri = (void*) 0xdeadbeef;
6603 hr = pCreateUri(emptyW, 0, 0, &uri);
6604 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6605 ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
6608 static void test_CreateUri_InvalidUri(void) {
6611 for(i = 0; i < sizeof(invalid_uri_tests)/sizeof(invalid_uri_tests[0]); ++i) {
6612 invalid_uri test = invalid_uri_tests[i];
6617 uriW = a2w(test.uri);
6618 hr = pCreateUri(uriW, test.flags, 0, &uri);
6621 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6622 hr, E_INVALIDARG, i);
6625 ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6626 hr, E_INVALIDARG, i);
6628 if(uri) IUri_Release(uri);
6634 static void test_IUri_GetPropertyBSTR(void) {
6639 /* Make sure GetPropertyBSTR handles invalid args correctly. */
6640 hr = pCreateUri(http_urlW, 0, 0, &uri);
6641 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6643 BSTR received = NULL;
6645 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_RAW_URI, NULL, 0);
6646 ok(hr == E_POINTER, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6648 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
6649 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_PORT, &received, 0);
6650 ok(hr == S_OK, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6651 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
6652 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
6653 SysFreeString(received);
6655 /* Make sure it handles the ZONE property correctly. */
6657 hr = IUri_GetPropertyBSTR(uri, Uri_PROPERTY_ZONE, &received, 0);
6658 ok(hr == S_FALSE, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr, S_FALSE);
6659 ok(received != NULL, "Error: Expected the string not to be NULL.\n");
6660 ok(!SysStringLen(received), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received));
6661 SysFreeString(received);
6663 if(uri) IUri_Release(uri);
6665 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6666 uri_properties test = uri_tests[i];
6670 uriW = a2w(test.uri);
6671 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6672 if(test.create_todo) {
6674 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6675 hr, test.create_expected, i);
6678 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6679 hr, test.create_expected, i);
6685 /* Checks all the string properties of the uri. */
6686 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
6687 BSTR received = NULL;
6688 uri_str_property prop = test.str_props[j];
6690 hr = IUri_GetPropertyBSTR(uri, j, &received, 0);
6693 ok(hr == prop.expected, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6694 hr, prop.expected, i, j);
6697 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6698 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6699 prop.value, wine_dbgstr_w(received), i, j);
6702 ok(hr == prop.expected, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6703 hr, prop.expected, i, j);
6704 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6705 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6706 prop.value, wine_dbgstr_w(received), i, j);
6709 SysFreeString(received);
6713 if(uri) IUri_Release(uri);
6719 static void test_IUri_GetPropertyDWORD(void) {
6724 hr = pCreateUri(http_urlW, 0, 0, &uri);
6725 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6727 DWORD received = 0xdeadbeef;
6729 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_DWORD_START, NULL, 0);
6730 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6732 hr = IUri_GetPropertyDWORD(uri, Uri_PROPERTY_ABSOLUTE_URI, &received, 0);
6733 ok(hr == E_INVALIDARG, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
6734 ok(received == 0, "Error: Expected received=%d but instead received=%d.\n", 0, received);
6736 if(uri) IUri_Release(uri);
6738 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6739 uri_properties test = uri_tests[i];
6743 uriW = a2w(test.uri);
6744 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6745 if(test.create_todo) {
6747 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6748 hr, test.create_expected, i);
6751 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6752 hr, test.create_expected, i);
6758 /* Checks all the DWORD properties of the uri. */
6759 for(j = 0; j < sizeof(test.dword_props)/sizeof(test.dword_props[0]); ++j) {
6761 uri_dword_property prop = test.dword_props[j];
6763 hr = IUri_GetPropertyDWORD(uri, j+Uri_PROPERTY_DWORD_START, &received, 0);
6766 ok(hr == prop.expected, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6767 hr, prop.expected, i, j);
6770 ok(prop.value == received, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6771 prop.value, received, i, j);
6774 ok(hr == prop.expected, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6775 hr, prop.expected, i, j);
6776 ok(prop.value == received, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6777 prop.value, received, i, j);
6782 if(uri) IUri_Release(uri);
6788 /* Tests all the 'Get*' property functions which deal with strings. */
6789 static void test_IUri_GetStrProperties(void) {
6794 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
6795 hr = pCreateUri(http_urlW, 0, 0, &uri);
6796 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
6798 hr = IUri_GetAbsoluteUri(uri, NULL);
6799 ok(hr == E_POINTER, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6801 hr = IUri_GetAuthority(uri, NULL);
6802 ok(hr == E_POINTER, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6804 hr = IUri_GetDisplayUri(uri, NULL);
6805 ok(hr == E_POINTER, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6807 hr = IUri_GetDomain(uri, NULL);
6808 ok(hr == E_POINTER, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6810 hr = IUri_GetExtension(uri, NULL);
6811 ok(hr == E_POINTER, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6813 hr = IUri_GetFragment(uri, NULL);
6814 ok(hr == E_POINTER, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6816 hr = IUri_GetHost(uri, NULL);
6817 ok(hr == E_POINTER, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6819 hr = IUri_GetPassword(uri, NULL);
6820 ok(hr == E_POINTER, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6822 hr = IUri_GetPath(uri, NULL);
6823 ok(hr == E_POINTER, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6825 hr = IUri_GetPathAndQuery(uri, NULL);
6826 ok(hr == E_POINTER, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6828 hr = IUri_GetQuery(uri, NULL);
6829 ok(hr == E_POINTER, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6831 hr = IUri_GetRawUri(uri, NULL);
6832 ok(hr == E_POINTER, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6834 hr = IUri_GetSchemeName(uri, NULL);
6835 ok(hr == E_POINTER, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6837 hr = IUri_GetUserInfo(uri, NULL);
6838 ok(hr == E_POINTER, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6840 hr = IUri_GetUserName(uri, NULL);
6841 ok(hr == E_POINTER, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
6843 if(uri) IUri_Release(uri);
6845 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
6846 uri_properties test = uri_tests[i];
6850 uriW = a2w(test.uri);
6851 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
6852 if(test.create_todo) {
6854 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6855 hr, test.create_expected, i);
6858 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6859 hr, test.create_expected, i);
6863 uri_str_property prop;
6864 BSTR received = NULL;
6866 /* GetAbsoluteUri() tests. */
6867 prop = test.str_props[Uri_PROPERTY_ABSOLUTE_URI];
6868 hr = IUri_GetAbsoluteUri(uri, &received);
6871 ok(hr == prop.expected, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6872 hr, prop.expected, i);
6875 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6876 "Error: Expected %s but got %s on uri_tests[%d].\n",
6877 prop.value, wine_dbgstr_w(received), i);
6880 ok(hr == prop.expected, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6881 hr, prop.expected, i);
6882 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6883 "Error: Expected %s but got %s on uri_tests[%d].\n",
6884 prop.value, wine_dbgstr_w(received), i);
6886 SysFreeString(received);
6889 /* GetAuthority() tests. */
6890 prop = test.str_props[Uri_PROPERTY_AUTHORITY];
6891 hr = IUri_GetAuthority(uri, &received);
6894 ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6895 hr, prop.expected, i);
6898 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6899 prop.value, wine_dbgstr_w(received), i);
6902 ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6903 hr, prop.expected, i);
6904 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6905 prop.value, wine_dbgstr_w(received), i);
6907 SysFreeString(received);
6910 /* GetDisplayUri() tests. */
6911 prop = test.str_props[Uri_PROPERTY_DISPLAY_URI];
6912 hr = IUri_GetDisplayUri(uri, &received);
6915 ok(hr == prop.expected, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6916 hr, prop.expected, i);
6919 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6920 "Error: Expected %s but got %s on uri_test[%d].\n",
6921 prop.value, wine_dbgstr_w(received), i);
6924 ok(hr == prop.expected, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6925 hr, prop.expected, i);
6926 ok(!strcmp_aw(prop.value, received) || broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
6927 "Error: Expected %s but got %s on uri_tests[%d].\n",
6928 prop.value, wine_dbgstr_w(received), i);
6930 SysFreeString(received);
6933 /* GetDomain() tests. */
6934 prop = test.str_props[Uri_PROPERTY_DOMAIN];
6935 hr = IUri_GetDomain(uri, &received);
6938 ok(hr == prop.expected, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6939 hr, prop.expected, i);
6942 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6943 prop.value, wine_dbgstr_w(received), i);
6946 ok(hr == prop.expected, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6947 hr, prop.expected, i);
6948 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6949 prop.value, wine_dbgstr_w(received), i);
6951 SysFreeString(received);
6954 /* GetExtension() tests. */
6955 prop = test.str_props[Uri_PROPERTY_EXTENSION];
6956 hr = IUri_GetExtension(uri, &received);
6959 ok(hr == prop.expected, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6960 hr, prop.expected, i);
6963 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6964 prop.value, wine_dbgstr_w(received), i);
6967 ok(hr == prop.expected, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6968 hr, prop.expected, i);
6969 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6970 prop.value, wine_dbgstr_w(received), i);
6972 SysFreeString(received);
6975 /* GetFragment() tests. */
6976 prop = test.str_props[Uri_PROPERTY_FRAGMENT];
6977 hr = IUri_GetFragment(uri, &received);
6980 ok(hr == prop.expected, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6981 hr, prop.expected, i);
6984 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6985 prop.value, wine_dbgstr_w(received), i);
6988 ok(hr == prop.expected, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6989 hr, prop.expected, i);
6990 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
6991 prop.value, wine_dbgstr_w(received), i);
6993 SysFreeString(received);
6996 /* GetHost() tests. */
6997 prop = test.str_props[Uri_PROPERTY_HOST];
6998 hr = IUri_GetHost(uri, &received);
7001 ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7002 hr, prop.expected, i);
7005 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7006 prop.value, wine_dbgstr_w(received), i);
7009 ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7010 hr, prop.expected, i);
7011 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7012 prop.value, wine_dbgstr_w(received), i);
7014 SysFreeString(received);
7017 /* GetPassword() tests. */
7018 prop = test.str_props[Uri_PROPERTY_PASSWORD];
7019 hr = IUri_GetPassword(uri, &received);
7022 ok(hr == prop.expected, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7023 hr, prop.expected, i);
7026 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7027 prop.value, wine_dbgstr_w(received), i);
7030 ok(hr == prop.expected, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7031 hr, prop.expected, i);
7032 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7033 prop.value, wine_dbgstr_w(received), i);
7035 SysFreeString(received);
7038 /* GetPath() tests. */
7039 prop = test.str_props[Uri_PROPERTY_PATH];
7040 hr = IUri_GetPath(uri, &received);
7043 ok(hr == prop.expected, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7044 hr, prop.expected, i);
7047 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7048 prop.value, wine_dbgstr_w(received), i);
7051 ok(hr == prop.expected, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7052 hr, prop.expected, i);
7053 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7054 prop.value, wine_dbgstr_w(received), i);
7056 SysFreeString(received);
7059 /* GetPathAndQuery() tests. */
7060 prop = test.str_props[Uri_PROPERTY_PATH_AND_QUERY];
7061 hr = IUri_GetPathAndQuery(uri, &received);
7064 ok(hr == prop.expected, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7065 hr, prop.expected, i);
7068 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7069 prop.value, wine_dbgstr_w(received), i);
7072 ok(hr == prop.expected, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7073 hr, prop.expected, i);
7074 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7075 prop.value, wine_dbgstr_w(received), i);
7077 SysFreeString(received);
7080 /* GetQuery() tests. */
7081 prop = test.str_props[Uri_PROPERTY_QUERY];
7082 hr = IUri_GetQuery(uri, &received);
7085 ok(hr == prop.expected, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7086 hr, prop.expected, i);
7089 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7090 prop.value, wine_dbgstr_w(received), i);
7093 ok(hr == prop.expected, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7094 hr, prop.expected, i);
7095 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7096 prop.value, wine_dbgstr_w(received), i);
7098 SysFreeString(received);
7101 /* GetRawUri() tests. */
7102 prop = test.str_props[Uri_PROPERTY_RAW_URI];
7103 hr = IUri_GetRawUri(uri, &received);
7106 ok(hr == prop.expected, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7107 hr, prop.expected, i);
7110 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7111 prop.value, wine_dbgstr_w(received), i);
7114 ok(hr == prop.expected, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7115 hr, prop.expected, i);
7116 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7117 prop.value, wine_dbgstr_w(received), i);
7119 SysFreeString(received);
7122 /* GetSchemeName() tests. */
7123 prop = test.str_props[Uri_PROPERTY_SCHEME_NAME];
7124 hr = IUri_GetSchemeName(uri, &received);
7127 ok(hr == prop.expected, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7128 hr, prop.expected, i);
7131 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7132 prop.value, wine_dbgstr_w(received), i);
7135 ok(hr == prop.expected, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7136 hr, prop.expected, i);
7137 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7138 prop.value, wine_dbgstr_w(received), i);
7140 SysFreeString(received);
7143 /* GetUserInfo() tests. */
7144 prop = test.str_props[Uri_PROPERTY_USER_INFO];
7145 hr = IUri_GetUserInfo(uri, &received);
7148 ok(hr == prop.expected, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7149 hr, prop.expected, i);
7152 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7153 prop.value, wine_dbgstr_w(received), i);
7156 ok(hr == prop.expected, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7157 hr, prop.expected, i);
7158 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7159 prop.value, wine_dbgstr_w(received), i);
7161 SysFreeString(received);
7164 /* GetUserName() tests. */
7165 prop = test.str_props[Uri_PROPERTY_USER_NAME];
7166 hr = IUri_GetUserName(uri, &received);
7169 ok(hr == prop.expected, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7170 hr, prop.expected, i);
7173 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7174 prop.value, wine_dbgstr_w(received), i);
7177 ok(hr == prop.expected, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7178 hr, prop.expected, i);
7179 ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
7180 prop.value, wine_dbgstr_w(received), i);
7182 SysFreeString(received);
7185 if(uri) IUri_Release(uri);
7191 static void test_IUri_GetDwordProperties(void) {
7196 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
7197 hr = pCreateUri(http_urlW, 0, 0, &uri);
7198 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7200 hr = IUri_GetHostType(uri, NULL);
7201 ok(hr == E_INVALIDARG, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7203 hr = IUri_GetPort(uri, NULL);
7204 ok(hr == E_INVALIDARG, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7206 hr = IUri_GetScheme(uri, NULL);
7207 ok(hr == E_INVALIDARG, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7209 hr = IUri_GetZone(uri, NULL);
7210 ok(hr == E_INVALIDARG, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7212 if(uri) IUri_Release(uri);
7214 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7215 uri_properties test = uri_tests[i];
7219 uriW = a2w(test.uri);
7220 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7221 if(test.create_todo) {
7223 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7224 hr, test.create_expected, i);
7227 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7228 hr, test.create_expected, i);
7232 uri_dword_property prop;
7235 /* Assign an insane value so tests don't accidentally pass when
7238 received = -9999999;
7240 /* GetHostType() tests. */
7241 prop = test.dword_props[Uri_PROPERTY_HOST_TYPE-Uri_PROPERTY_DWORD_START];
7242 hr = IUri_GetHostType(uri, &received);
7245 ok(hr == prop.expected, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7246 hr, prop.expected, i);
7249 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7252 ok(hr == prop.expected, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7253 hr, prop.expected, i);
7254 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7256 received = -9999999;
7258 /* GetPort() tests. */
7259 prop = test.dword_props[Uri_PROPERTY_PORT-Uri_PROPERTY_DWORD_START];
7260 hr = IUri_GetPort(uri, &received);
7263 ok(hr == prop.expected, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7264 hr, prop.expected, i);
7267 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7270 ok(hr == prop.expected, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7271 hr, prop.expected, i);
7272 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7274 received = -9999999;
7276 /* GetScheme() tests. */
7277 prop = test.dword_props[Uri_PROPERTY_SCHEME-Uri_PROPERTY_DWORD_START];
7278 hr = IUri_GetScheme(uri, &received);
7281 ok(hr == prop.expected, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7282 hr, prop.expected, i);
7285 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7288 ok(hr == prop.expected, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7289 hr, prop.expected, i);
7290 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7292 received = -9999999;
7294 /* GetZone() tests. */
7295 prop = test.dword_props[Uri_PROPERTY_ZONE-Uri_PROPERTY_DWORD_START];
7296 hr = IUri_GetZone(uri, &received);
7299 ok(hr == prop.expected, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7300 hr, prop.expected, i);
7303 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7306 ok(hr == prop.expected, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7307 hr, prop.expected, i);
7308 ok(received == prop.value, "Error: Expected %d but got %d on uri_tests[%d].\n", prop.value, received, i);
7312 if(uri) IUri_Release(uri);
7318 static void test_IUri_GetPropertyLength(void) {
7323 /* Make sure it handles invalid args correctly. */
7324 hr = pCreateUri(http_urlW, 0, 0, &uri);
7325 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7327 DWORD received = 0xdeadbeef;
7329 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_STRING_START, NULL, 0);
7330 ok(hr == E_INVALIDARG, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7332 hr = IUri_GetPropertyLength(uri, Uri_PROPERTY_DWORD_START, &received, 0);
7333 ok(hr == E_INVALIDARG, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7334 ok(received == 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received);
7336 if(uri) IUri_Release(uri);
7338 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7339 uri_properties test = uri_tests[i];
7343 uriW = a2w(test.uri);
7344 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7345 if(test.create_todo) {
7347 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7348 hr, test.create_expected, i);
7351 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
7352 hr, test.create_expected, i);
7358 for(j = Uri_PROPERTY_STRING_START; j <= Uri_PROPERTY_STRING_LAST; ++j) {
7359 DWORD expectedLen, brokenLen, receivedLen;
7360 uri_str_property prop = test.str_props[j];
7362 expectedLen = lstrlen(prop.value);
7363 brokenLen = lstrlen(prop.broken_value);
7365 /* This won't be necessary once GetPropertyLength is implemented. */
7368 hr = IUri_GetPropertyLength(uri, j, &receivedLen, 0);
7371 ok(hr == prop.expected, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7372 hr, prop.expected, i, j);
7375 ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
7376 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7377 expectedLen, receivedLen, i, j);
7380 ok(hr == prop.expected, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7381 hr, prop.expected, i, j);
7382 ok(receivedLen == expectedLen || broken(receivedLen == brokenLen),
7383 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7384 expectedLen, receivedLen, i, j);
7389 if(uri) IUri_Release(uri);
7395 static DWORD compute_expected_props(uri_properties *test)
7399 for(i=Uri_PROPERTY_STRING_START; i <= Uri_PROPERTY_STRING_LAST; i++) {
7400 if(test->str_props[i-Uri_PROPERTY_STRING_START].expected == S_OK)
7404 for(i=Uri_PROPERTY_DWORD_START; i <= Uri_PROPERTY_DWORD_LAST; i++) {
7405 if(test->dword_props[i-Uri_PROPERTY_DWORD_START].expected == S_OK)
7412 static void test_IUri_GetProperties(void) {
7417 hr = pCreateUri(http_urlW, 0, 0, &uri);
7418 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7420 hr = IUri_GetProperties(uri, NULL);
7421 ok(hr == E_INVALIDARG, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7423 if(uri) IUri_Release(uri);
7425 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7426 uri_properties test = uri_tests[i];
7430 uriW = a2w(test.uri);
7431 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7432 if(test.create_todo) {
7434 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7437 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7441 DWORD received = 0, expected_props;
7444 hr = IUri_GetProperties(uri, &received);
7445 ok(hr == S_OK, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7447 expected_props = compute_expected_props(&test);
7449 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
7450 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
7451 if(expected_props & (1 << j))
7452 ok(received & (1 << j), "Error: Expected flag for property %d on uri_tests[%d].\n", j, i);
7454 ok(!(received & (1 << j)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j, i);
7458 if(uri) IUri_Release(uri);
7464 static void test_IUri_HasProperty(void) {
7469 hr = pCreateUri(http_urlW, 0, 0, &uri);
7470 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7472 hr = IUri_HasProperty(uri, Uri_PROPERTY_RAW_URI, NULL);
7473 ok(hr == E_INVALIDARG, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7475 if(uri) IUri_Release(uri);
7477 for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
7478 uri_properties test = uri_tests[i];
7482 uriW = a2w(test.uri);
7484 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
7485 if(test.create_todo) {
7487 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7490 ok(hr == test.create_expected, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, test.create_expected);
7494 DWORD expected_props, j;
7496 expected_props = compute_expected_props(&test);
7498 for(j = 0; j <= Uri_PROPERTY_DWORD_LAST; ++j) {
7499 /* Assign -1, then explicitly test for TRUE or FALSE later. */
7502 hr = IUri_HasProperty(uri, j, &received);
7503 ok(hr == S_OK, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
7506 if(expected_props & (1 << j)) {
7507 ok(received == TRUE, "Error: Expected to have property %d on uri_tests[%d].\n", j, i);
7509 ok(received == FALSE, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j, i);
7514 if(uri) IUri_Release(uri);
7520 static void test_IUri_IsEqual(void) {
7527 /* Make sure IsEqual handles invalid args correctly. */
7528 hrA = pCreateUri(http_urlW, 0, 0, &uriA);
7529 hrB = pCreateUri(http_urlW, 0, 0, &uriB);
7530 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrA, S_OK);
7531 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrB, S_OK);
7532 if(SUCCEEDED(hrA) && SUCCEEDED(hrB)) {
7534 hrA = IUri_IsEqual(uriA, NULL, &equal);
7535 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA, S_OK);
7536 ok(equal == FALSE, "Error: Expected equal to be FALSE, but was %d instead.\n", equal);
7538 hrA = IUri_IsEqual(uriA, uriB, NULL);
7539 ok(hrA == E_POINTER, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA, E_POINTER);
7541 if(uriA) IUri_Release(uriA);
7542 if(uriB) IUri_Release(uriB);
7544 for(i = 0; i < sizeof(equality_tests)/sizeof(equality_tests[0]); ++i) {
7545 uri_equality test = equality_tests[i];
7546 LPWSTR uriA_W, uriB_W;
7550 uriA_W = a2w(test.a);
7551 uriB_W = a2w(test.b);
7553 hrA = pCreateUri(uriA_W, test.create_flags_a, 0, &uriA);
7554 if(test.create_todo_a) {
7556 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7560 ok(hrA == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7564 hrB = pCreateUri(uriB_W, test.create_flags_b, 0, &uriB);
7565 if(test.create_todo_b) {
7567 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7571 ok(hrB == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7575 if(SUCCEEDED(hrA) && SUCCEEDED(hrB)) {
7578 hrA = IUri_IsEqual(uriA, uriB, &equal);
7581 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n",
7585 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test.equal, i);
7588 ok(hrA == S_OK, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hrA, S_OK, i);
7589 ok(equal == test.equal, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test.equal, i);
7592 if(uriA) IUri_Release(uriA);
7593 if(uriB) IUri_Release(uriB);
7600 static void test_CreateUriWithFragment_InvalidArgs(void) {
7602 IUri *uri = (void*) 0xdeadbeef;
7603 const WCHAR fragmentW[] = {'#','f','r','a','g','m','e','n','t',0};
7605 hr = pCreateUriWithFragment(NULL, fragmentW, 0, 0, &uri);
7606 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7607 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7609 hr = pCreateUriWithFragment(http_urlW, fragmentW, 0, 0, NULL);
7610 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7612 /* Original URI can't already contain a fragment component. */
7613 uri = (void*) 0xdeadbeef;
7614 hr = pCreateUriWithFragment(http_url_fragW, fragmentW, 0, 0, &uri);
7615 ok(hr == E_INVALIDARG, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
7616 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7619 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
7620 static void test_CreateUriWithFragment_InvalidFlags(void) {
7623 for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
7625 IUri *uri = (void*) 0xdeadbeef;
7627 hr = pCreateUriWithFragment(http_urlW, NULL, invalid_flag_tests[i].flags, 0, &uri);
7628 ok(hr == invalid_flag_tests[i].expected, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
7629 hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
7630 ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
7634 static void test_CreateUriWithFragment(void) {
7637 for(i = 0; i < sizeof(uri_fragment_tests)/sizeof(uri_fragment_tests[0]); ++i) {
7641 uri_with_fragment test = uri_fragment_tests[i];
7643 uriW = a2w(test.uri);
7644 fragW = a2w(test.fragment);
7646 hr = pCreateUriWithFragment(uriW, fragW, test.create_flags, 0, &uri);
7647 if(test.expected_todo) {
7649 ok(hr == test.create_expected,
7650 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7651 hr, test.create_expected, i);
7654 ok(hr == test.create_expected,
7655 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7656 hr, test.create_expected, i);
7659 BSTR received = NULL;
7661 hr = IUri_GetAbsoluteUri(uri, &received);
7662 if(test.expected_todo) {
7665 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7669 ok(!strcmp_aw(test.expected_uri, received),
7670 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7671 test.expected_uri, wine_dbgstr_w(received), i);
7674 ok(hr == S_OK, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7676 ok(!strcmp_aw(test.expected_uri, received), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7677 test.expected_uri, wine_dbgstr_w(received), i);
7680 SysFreeString(received);
7683 if(uri) IUri_Release(uri);
7689 static void test_CreateIUriBuilder(void) {
7691 IUriBuilder *builder = NULL;
7694 hr = pCreateIUriBuilder(NULL, 0, 0, NULL);
7695 ok(hr == E_POINTER, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
7698 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
7699 hr = pCreateUri(http_urlW, 0, 0, &uri);
7700 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7702 ULONG cur_count, orig_count;
7704 orig_count = get_refcnt(uri);
7705 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
7706 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7707 ok(builder != NULL, "Error: Expecting builder not to be NULL\n");
7709 cur_count = get_refcnt(uri);
7710 ok(cur_count == orig_count+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count+1, cur_count);
7712 if(builder) IUriBuilder_Release(builder);
7713 cur_count = get_refcnt(uri);
7714 ok(cur_count == orig_count, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count, cur_count);
7716 if(uri) IUri_Release(uri);
7719 static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_test *test,
7724 hr = IUriBuilder_CreateUri(builder, test->uri_flags, 0, 0, &uri);
7725 if(test->uri_todo) {
7727 ok(hr == test->uri_hres,
7728 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7729 hr, test->uri_hres, test_index);
7732 ok(hr == test->uri_hres,
7733 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7734 hr, test->uri_hres, test_index);
7740 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7741 uri_builder_str_property prop = test->expected_str_props[i];
7742 BSTR received = NULL;
7744 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7747 ok(hr == prop.result,
7748 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7749 hr, prop.result, test_index, i);
7752 ok(hr == prop.result,
7753 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7754 hr, prop.result, test_index, i);
7759 ok(!strcmp_aw(prop.expected, received),
7760 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7761 prop.expected, wine_dbgstr_w(received), test_index, i);
7764 ok(!strcmp_aw(prop.expected, received),
7765 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7766 prop.expected, wine_dbgstr_w(received), test_index, i);
7769 SysFreeString(received);
7772 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7773 uri_builder_dword_property prop = test->expected_dword_props[i];
7774 DWORD received = -2;
7776 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7779 ok(hr == prop.result,
7780 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7781 hr, prop.result, test_index, i);
7784 ok(hr == prop.result,
7785 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7786 hr, prop.result, test_index, i);
7791 ok(received == prop.expected,
7792 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7793 prop.expected, received, test_index, i);
7796 ok(received == prop.expected,
7797 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7798 prop.expected, received, test_index, i);
7803 if(uri) IUri_Release(uri);
7806 static void test_IUriBuilder_CreateUriSimple(IUriBuilder *builder, const uri_builder_test *test,
7811 hr = IUriBuilder_CreateUriSimple(builder, test->uri_simple_encode_flags, 0, &uri);
7812 if(test->uri_simple_todo) {
7814 ok(hr == test->uri_simple_hres,
7815 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7816 hr, test->uri_simple_hres, test_index);
7819 ok(hr == test->uri_simple_hres,
7820 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7821 hr, test->uri_simple_hres, test_index);
7827 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7828 uri_builder_str_property prop = test->expected_str_props[i];
7829 BSTR received = NULL;
7831 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7834 ok(hr == prop.result,
7835 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7836 hr, prop.result, test_index, i);
7839 ok(hr == prop.result,
7840 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7841 hr, prop.result, test_index, i);
7846 ok(!strcmp_aw(prop.expected, received),
7847 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7848 prop.expected, wine_dbgstr_w(received), test_index, i);
7851 ok(!strcmp_aw(prop.expected, received),
7852 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7853 prop.expected, wine_dbgstr_w(received), test_index, i);
7856 SysFreeString(received);
7859 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7860 uri_builder_dword_property prop = test->expected_dword_props[i];
7861 DWORD received = -2;
7863 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7866 ok(hr == prop.result,
7867 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7868 hr, prop.result, test_index, i);
7871 ok(hr == prop.result,
7872 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7873 hr, prop.result, test_index, i);
7878 ok(received == prop.expected,
7879 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7880 prop.expected, received, test_index, i);
7883 ok(received == prop.expected,
7884 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7885 prop.expected, received, test_index, i);
7890 if(uri) IUri_Release(uri);
7893 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder *builder, const uri_builder_test *test,
7898 hr = IUriBuilder_CreateUriWithFlags(builder, test->uri_with_flags, test->uri_with_builder_flags,
7899 test->uri_with_encode_flags, 0, &uri);
7900 if(test->uri_with_todo) {
7902 ok(hr == test->uri_with_hres,
7903 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7904 hr, test->uri_with_hres, test_index);
7907 ok(hr == test->uri_with_hres,
7908 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7909 hr, test->uri_with_hres, test_index);
7915 for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
7916 uri_builder_str_property prop = test->expected_str_props[i];
7917 BSTR received = NULL;
7919 hr = IUri_GetPropertyBSTR(uri, i, &received, 0);
7922 ok(hr == prop.result,
7923 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7924 hr, prop.result, test_index, i);
7927 ok(hr == prop.result,
7928 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7929 hr, prop.result, test_index, i);
7934 ok(!strcmp_aw(prop.expected, received),
7935 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7936 prop.expected, wine_dbgstr_w(received), test_index, i);
7939 ok(!strcmp_aw(prop.expected, received),
7940 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7941 prop.expected, wine_dbgstr_w(received), test_index, i);
7944 SysFreeString(received);
7947 for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
7948 uri_builder_dword_property prop = test->expected_dword_props[i];
7949 DWORD received = -2;
7951 hr = IUri_GetPropertyDWORD(uri, i+Uri_PROPERTY_DWORD_START, &received, 0);
7954 ok(hr == prop.result,
7955 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7956 hr, prop.result, test_index, i);
7959 ok(hr == prop.result,
7960 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7961 hr, prop.result, test_index, i);
7966 ok(received == prop.expected,
7967 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7968 prop.expected, received, test_index, i);
7971 ok(received == prop.expected,
7972 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7973 prop.expected, received, test_index, i);
7978 if(uri) IUri_Release(uri);
7981 static void test_IUriBuilder_CreateInvalidArgs(void) {
7982 IUriBuilder *builder;
7985 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
7986 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
7988 IUri *test = NULL, *uri = (void*) 0xdeadbeef;
7990 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
7991 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, NULL);
7992 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
7994 uri = (void*) 0xdeadbeef;
7995 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
7996 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_NOTIMPL);
7997 ok(uri == NULL, "Error: expected uri to be NULL, but was %p instead.\n", uri);
7999 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, NULL);
8000 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8003 uri = (void*) 0xdeadbeef;
8004 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
8005 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8007 ok(!uri, "Error: Expected uri to NULL, but was %p instead.\n", uri);
8009 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, NULL);
8010 ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8013 uri = (void*) 0xdeadbeef;
8014 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
8015 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8017 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
8019 hr = pCreateUri(http_urlW, 0, 0, &test);
8020 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8022 hr = IUriBuilder_SetIUri(builder, test);
8023 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8025 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
8027 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
8028 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8029 ok(uri != NULL, "Error: The uri was NULL.\n");
8030 if(uri) IUri_Release(uri);
8033 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
8034 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8036 ok(uri != NULL, "Error: uri was NULL.\n");
8037 if(uri) IUri_Release(uri);
8040 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &uri);
8041 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8043 ok(uri != NULL, "Error: uri was NULL.\n");
8044 if(uri) IUri_Release(uri);
8046 hr = IUriBuilder_SetFragment(builder, NULL);
8047 ok(hr == S_OK, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8049 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
8050 uri = (void*) 0xdeadbeef;
8051 hr = IUriBuilder_CreateUri(builder, 0, Uri_HAS_USER_NAME, 0, &uri);
8052 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8053 ok(!uri, "Error: Expected uri to be NULL but was %p instead.\n", uri);
8055 uri = (void*) 0xdeadbeef;
8056 hr = IUriBuilder_CreateUriSimple(builder, Uri_HAS_USER_NAME, 0, &uri);
8057 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8059 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
8061 uri = (void*) 0xdeadbeef;
8062 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, Uri_HAS_USER_NAME, 0, &uri);
8063 ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8065 ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri);
8067 if(test) IUri_Release(test);
8069 if(builder) IUriBuilder_Release(builder);
8072 /* Tests invalid args to the "Get*" functions. */
8073 static void test_IUriBuilder_GetInvalidArgs(void) {
8074 IUriBuilder *builder = NULL;
8077 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
8078 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
8080 LPCWSTR received = (void*) 0xdeadbeef;
8081 DWORD len = -1, port = -1;
8084 hr = IUriBuilder_GetFragment(builder, NULL, NULL);
8085 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8087 hr = IUriBuilder_GetFragment(builder, NULL, &received);
8088 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8090 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8091 hr = IUriBuilder_GetFragment(builder, &len, NULL);
8092 ok(hr == E_POINTER, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8094 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8096 hr = IUriBuilder_GetHost(builder, NULL, NULL);
8097 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8099 received = (void*) 0xdeadbeef;
8100 hr = IUriBuilder_GetHost(builder, NULL, &received);
8101 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8103 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8105 hr = IUriBuilder_GetHost(builder, &len, NULL);
8106 ok(hr == E_POINTER, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8108 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8110 hr = IUriBuilder_GetPassword(builder, NULL, NULL);
8111 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8113 received = (void*) 0xdeadbeef;
8114 hr = IUriBuilder_GetPassword(builder, NULL, &received);
8115 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8117 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8119 hr = IUriBuilder_GetPassword(builder, &len, NULL);
8120 ok(hr == E_POINTER, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8122 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8124 hr = IUriBuilder_GetPath(builder, NULL, NULL);
8125 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8127 received = (void*) 0xdeadbeef;
8128 hr = IUriBuilder_GetPath(builder, NULL, &received);
8129 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8131 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8133 hr = IUriBuilder_GetPath(builder, &len, NULL);
8134 ok(hr == E_POINTER, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8136 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8138 hr = IUriBuilder_GetPort(builder, NULL, NULL);
8139 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8141 hr = IUriBuilder_GetPort(builder, NULL, &port);
8142 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8144 ok(!port, "Error: Expected port to be 0, but was %d instead.\n", port);
8145 hr = IUriBuilder_GetPort(builder, &set, NULL);
8146 ok(hr == E_POINTER, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8148 ok(!set, "Error: Expected set to be FALSE, but was %d instead.\n", set);
8150 hr = IUriBuilder_GetQuery(builder, NULL, NULL);
8151 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8153 received = (void*) 0xdeadbeef;
8154 hr = IUriBuilder_GetQuery(builder, NULL, &received);
8155 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8157 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8159 hr = IUriBuilder_GetQuery(builder, &len, NULL);
8160 ok(hr == E_POINTER, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8162 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8164 hr = IUriBuilder_GetSchemeName(builder, NULL, NULL);
8165 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8167 received = (void*) 0xdeadbeef;
8168 hr = IUriBuilder_GetSchemeName(builder, NULL, &received);
8169 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8171 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8173 hr = IUriBuilder_GetSchemeName(builder, &len, NULL);
8174 ok(hr == E_POINTER, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8176 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8178 hr = IUriBuilder_GetUserName(builder, NULL, NULL);
8179 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8181 received = (void*) 0xdeadbeef;
8182 hr = IUriBuilder_GetUserName(builder, NULL, &received);
8183 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8185 ok(!received, "Error: Expected received to be NULL, but was %p instead.\n", received);
8187 hr = IUriBuilder_GetUserName(builder, &len, NULL);
8188 ok(hr == E_POINTER, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8190 ok(!len, "Error: Expected len to be 0, but was %d instead.\n", len);
8192 if(builder) IUriBuilder_Release(builder);
8195 static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder_test *test,
8199 LPCWSTR received = NULL;
8201 const uri_builder_property *prop = NULL;
8203 /* Check if the property was set earlier. */
8204 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8205 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_FRAGMENT)
8206 prop = &(test->properties[i]);
8210 /* Use expected_value unless it's NULL, then use value. */
8211 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8212 hr = IUriBuilder_GetFragment(builder, &len, &received);
8215 ok(hr == (expected ? S_OK : S_FALSE),
8216 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8217 hr, (expected ? S_OK : S_FALSE), test_index);
8221 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8222 expected, wine_dbgstr_w(received), test_index);
8225 ok(lstrlen(expected) == len,
8226 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8227 lstrlen(expected), len, test_index);
8231 ok(hr == (expected ? S_OK : S_FALSE),
8232 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8233 hr, (expected ? S_OK : S_FALSE), test_index);
8234 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8235 expected, wine_dbgstr_w(received), test_index);
8236 ok(lstrlen(expected) == len,
8237 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8238 lstrlen(expected), len, test_index);
8241 /* The property wasn't set earlier, so it should return whatever
8242 * the base IUri contains (if anything).
8245 hr = IUriBuilder_GetIUri(builder, &uri);
8247 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8248 hr, S_OK, test_index);
8251 received = (void*) 0xdeadbeef;
8254 hr = IUriBuilder_GetFragment(builder, &len, &received);
8256 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8257 hr, S_FALSE, test_index);
8259 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8261 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8262 received, test_index);
8265 BOOL has_prop = FALSE;
8266 BSTR expected = NULL;
8268 hr = IUri_GetFragment(uri, &expected);
8270 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8272 has_prop = hr == S_OK;
8274 hr = IUriBuilder_GetFragment(builder, &len, &received);
8277 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8278 hr, S_OK, test_index);
8280 ok(!lstrcmpW(expected, received),
8281 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8282 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8283 ok(lstrlenW(expected) == len,
8284 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8285 lstrlenW(expected), len, test_index);
8289 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8290 hr, S_FALSE, test_index);
8292 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8293 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8297 SysFreeString(expected);
8300 if(uri) IUri_Release(uri);
8304 static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_test *test,
8308 LPCWSTR received = NULL;
8310 const uri_builder_property *prop = NULL;
8312 /* Check if the property was set earlier. */
8313 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8314 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_HOST)
8315 prop = &(test->properties[i]);
8319 /* Use expected_value unless it's NULL, then use value. */
8320 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8321 hr = IUriBuilder_GetHost(builder, &len, &received);
8324 ok(hr == (expected ? S_OK : S_FALSE),
8325 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8326 hr, (expected ? S_OK : S_FALSE), test_index);
8330 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8331 expected, wine_dbgstr_w(received), test_index);
8334 ok(lstrlen(expected) == len,
8335 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8336 lstrlen(expected), len, test_index);
8340 ok(hr == (expected ? S_OK : S_FALSE),
8341 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8342 hr, (expected ? S_OK : S_FALSE), test_index);
8343 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8344 expected, wine_dbgstr_w(received), test_index);
8345 ok(lstrlen(expected) == len,
8346 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8347 lstrlen(expected), len, test_index);
8350 /* The property wasn't set earlier, so it should return whatever
8351 * the base IUri contains (if anything).
8354 hr = IUriBuilder_GetIUri(builder, &uri);
8356 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8357 hr, S_OK, test_index);
8360 received = (void*) 0xdeadbeef;
8363 hr = IUriBuilder_GetHost(builder, &len, &received);
8365 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8366 hr, S_FALSE, test_index);
8368 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8370 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8371 received, test_index);
8374 BOOL has_prop = FALSE;
8375 BSTR expected = NULL;
8377 hr = IUri_GetHost(uri, &expected);
8379 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8381 has_prop = hr == S_OK;
8383 hr = IUriBuilder_GetHost(builder, &len, &received);
8386 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8387 hr, S_OK, test_index);
8389 ok(!lstrcmpW(expected, received),
8390 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8391 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8392 ok(lstrlenW(expected) == len,
8393 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8394 lstrlenW(expected), len, test_index);
8398 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8399 hr, S_FALSE, test_index);
8401 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8402 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8406 SysFreeString(expected);
8409 if(uri) IUri_Release(uri);
8413 static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder_test *test,
8417 LPCWSTR received = NULL;
8419 const uri_builder_property *prop = NULL;
8421 /* Check if the property was set earlier. */
8422 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8423 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PASSWORD)
8424 prop = &(test->properties[i]);
8428 /* Use expected_value unless it's NULL, then use value. */
8429 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8430 hr = IUriBuilder_GetPassword(builder, &len, &received);
8433 ok(hr == (expected ? S_OK : S_FALSE),
8434 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8435 hr, (expected ? S_OK : S_FALSE), test_index);
8439 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8440 expected, wine_dbgstr_w(received), test_index);
8443 ok(lstrlen(expected) == len,
8444 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8445 lstrlen(expected), len, test_index);
8449 ok(hr == (expected ? S_OK : S_FALSE),
8450 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8451 hr, (expected ? S_OK : S_FALSE), test_index);
8452 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8453 expected, wine_dbgstr_w(received), test_index);
8454 ok(lstrlen(expected) == len,
8455 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8456 lstrlen(expected), len, test_index);
8459 /* The property wasn't set earlier, so it should return whatever
8460 * the base IUri contains (if anything).
8463 hr = IUriBuilder_GetIUri(builder, &uri);
8465 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8466 hr, S_OK, test_index);
8469 received = (void*) 0xdeadbeef;
8472 hr = IUriBuilder_GetPassword(builder, &len, &received);
8474 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8475 hr, S_FALSE, test_index);
8477 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8479 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8480 received, test_index);
8483 BOOL has_prop = FALSE;
8484 BSTR expected = NULL;
8486 hr = IUri_GetPassword(uri, &expected);
8488 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8490 has_prop = hr == S_OK;
8492 hr = IUriBuilder_GetPassword(builder, &len, &received);
8495 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8496 hr, S_OK, test_index);
8498 ok(!lstrcmpW(expected, received),
8499 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8500 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8501 ok(lstrlenW(expected) == len,
8502 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8503 lstrlenW(expected), len, test_index);
8507 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8508 hr, S_FALSE, test_index);
8510 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8511 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8515 SysFreeString(expected);
8518 if(uri) IUri_Release(uri);
8522 static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_test *test,
8526 LPCWSTR received = NULL;
8528 const uri_builder_property *prop = NULL;
8530 /* Check if the property was set earlier. */
8531 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8532 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PATH)
8533 prop = &(test->properties[i]);
8537 /* Use expected_value unless it's NULL, then use value. */
8538 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8539 hr = IUriBuilder_GetPath(builder, &len, &received);
8542 ok(hr == (expected ? S_OK : S_FALSE),
8543 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8544 hr, (expected ? S_OK : S_FALSE), test_index);
8548 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8549 expected, wine_dbgstr_w(received), test_index);
8552 ok(lstrlen(expected) == len,
8553 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8554 lstrlen(expected), len, test_index);
8558 ok(hr == (expected ? S_OK : S_FALSE),
8559 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8560 hr, (expected ? S_OK : S_FALSE), test_index);
8561 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8562 expected, wine_dbgstr_w(received), test_index);
8563 ok(lstrlen(expected) == len,
8564 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8565 lstrlen(expected), len, test_index);
8568 /* The property wasn't set earlier, so it should return whatever
8569 * the base IUri contains (if anything).
8572 hr = IUriBuilder_GetIUri(builder, &uri);
8574 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8575 hr, S_OK, test_index);
8578 received = (void*) 0xdeadbeef;
8581 hr = IUriBuilder_GetPath(builder, &len, &received);
8583 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8584 hr, S_FALSE, test_index);
8586 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8588 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8589 received, test_index);
8592 BOOL has_prop = FALSE;
8593 BSTR expected = NULL;
8595 hr = IUri_GetPath(uri, &expected);
8597 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8599 has_prop = hr == S_OK;
8601 hr = IUriBuilder_GetPath(builder, &len, &received);
8604 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8605 hr, S_OK, test_index);
8607 ok(!lstrcmpW(expected, received),
8608 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8609 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8610 ok(lstrlenW(expected) == len,
8611 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8612 lstrlenW(expected), len, test_index);
8616 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8617 hr, S_FALSE, test_index);
8619 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8620 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8624 SysFreeString(expected);
8627 if(uri) IUri_Release(uri);
8631 static void test_IUriBuilder_GetPort(IUriBuilder *builder, const uri_builder_test *test,
8634 BOOL has_port = FALSE;
8635 DWORD received = -1;
8637 if(test->port_prop.change) {
8638 DWORD expected = test->port_prop.value;
8640 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8641 if(test->port_prop.todo) {
8644 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8645 hr, S_OK, test_index);
8649 ok(has_port == test->port_prop.set,
8650 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
8651 test->port_prop.set, has_port, test_index);
8654 ok(received == expected,
8655 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8656 expected, received, test_index);
8661 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8662 hr, S_OK, test_index);
8663 ok(has_port == test->port_prop.set,
8664 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8665 test->port_prop.set, has_port, test_index);
8666 ok(received == test->port_prop.value,
8667 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8668 test->port_prop.value, received, test_index);
8673 hr = IUriBuilder_GetIUri(builder, &uri);
8675 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8676 hr, S_OK, test_index);
8679 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8681 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8682 hr, S_OK, test_index);
8684 ok(has_port == FALSE,
8685 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
8686 has_port, test_index);
8687 ok(!received, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
8688 received, test_index);
8693 hr = IUri_GetPort(uri, &expected);
8695 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8698 hr = IUriBuilder_GetPort(builder, &has_port, &received);
8700 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8701 hr, S_OK, test_index);
8704 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
8706 ok(received == expected,
8707 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8708 expected, received, test_index);
8712 if(uri) IUri_Release(uri);
8716 static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_test *test,
8720 LPCWSTR received = NULL;
8722 const uri_builder_property *prop = NULL;
8724 /* Check if the property was set earlier. */
8725 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8726 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_QUERY)
8727 prop = &(test->properties[i]);
8731 /* Use expected_value unless it's NULL, then use value. */
8732 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8733 hr = IUriBuilder_GetQuery(builder, &len, &received);
8736 ok(hr == (expected ? S_OK : S_FALSE),
8737 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8738 hr, (expected ? S_OK : S_FALSE), test_index);
8742 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8743 expected, wine_dbgstr_w(received), test_index);
8746 ok(lstrlen(expected) == len,
8747 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8748 lstrlen(expected), len, test_index);
8752 ok(hr == (expected ? S_OK : S_FALSE),
8753 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8754 hr, (expected ? S_OK : S_FALSE), test_index);
8755 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8756 expected, wine_dbgstr_w(received), test_index);
8757 ok(lstrlen(expected) == len,
8758 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8759 lstrlen(expected), len, test_index);
8762 /* The property wasn't set earlier, so it should return whatever
8763 * the base IUri contains (if anything).
8766 hr = IUriBuilder_GetIUri(builder, &uri);
8768 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8769 hr, S_OK, test_index);
8772 received = (void*) 0xdeadbeef;
8775 hr = IUriBuilder_GetQuery(builder, &len, &received);
8777 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8778 hr, S_FALSE, test_index);
8780 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8782 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8783 received, test_index);
8786 BOOL has_prop = FALSE;
8787 BSTR expected = NULL;
8789 hr = IUri_GetQuery(uri, &expected);
8791 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8793 has_prop = hr == S_OK;
8795 hr = IUriBuilder_GetQuery(builder, &len, &received);
8798 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8799 hr, S_OK, test_index);
8801 ok(!lstrcmpW(expected, received),
8802 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8803 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8804 ok(lstrlenW(expected) == len,
8805 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8806 lstrlenW(expected), len, test_index);
8810 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8811 hr, S_FALSE, test_index);
8813 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8814 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8818 SysFreeString(expected);
8821 if(uri) IUri_Release(uri);
8825 static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_builder_test *test,
8829 LPCWSTR received = NULL;
8831 const uri_builder_property *prop = NULL;
8833 /* Check if the property was set earlier. */
8834 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8835 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_SCHEME_NAME)
8836 prop = &(test->properties[i]);
8840 /* Use expected_value unless it's NULL, then use value. */
8841 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8842 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8845 ok(hr == (expected ? S_OK : S_FALSE),
8846 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8847 hr, (expected ? S_OK : S_FALSE), test_index);
8851 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8852 expected, wine_dbgstr_w(received), test_index);
8855 ok(lstrlen(expected) == len,
8856 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8857 lstrlen(expected), len, test_index);
8861 ok(hr == (expected ? S_OK : S_FALSE),
8862 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8863 hr, (expected ? S_OK : S_FALSE), test_index);
8864 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8865 expected, wine_dbgstr_w(received), test_index);
8866 ok(lstrlen(expected) == len,
8867 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8868 lstrlen(expected), len, test_index);
8871 /* The property wasn't set earlier, so it should return whatever
8872 * the base IUri contains (if anything).
8875 hr = IUriBuilder_GetIUri(builder, &uri);
8877 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8878 hr, S_OK, test_index);
8881 received = (void*) 0xdeadbeef;
8884 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8886 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8887 hr, S_FALSE, test_index);
8889 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8891 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8892 received, test_index);
8895 BOOL has_prop = FALSE;
8896 BSTR expected = NULL;
8898 hr = IUri_GetSchemeName(uri, &expected);
8900 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8902 has_prop = hr == S_OK;
8904 hr = IUriBuilder_GetSchemeName(builder, &len, &received);
8907 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8908 hr, S_OK, test_index);
8910 ok(!lstrcmpW(expected, received),
8911 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8912 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
8913 ok(lstrlenW(expected) == len,
8914 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8915 lstrlenW(expected), len, test_index);
8919 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8920 hr, S_FALSE, test_index);
8922 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
8923 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8927 SysFreeString(expected);
8930 if(uri) IUri_Release(uri);
8934 static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder_test *test,
8938 LPCWSTR received = NULL;
8940 const uri_builder_property *prop = NULL;
8942 /* Check if the property was set earlier. */
8943 for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
8944 if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_USER_NAME)
8945 prop = &(test->properties[i]);
8948 if(prop && prop->value && *prop->value) {
8949 /* Use expected_value unless it's NULL, then use value. */
8950 LPCSTR expected = prop->expected_value ? prop->expected_value : prop->value;
8951 hr = IUriBuilder_GetUserName(builder, &len, &received);
8954 ok(hr == (expected ? S_OK : S_FALSE),
8955 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8956 hr, (expected ? S_OK : S_FALSE), test_index);
8960 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8961 expected, wine_dbgstr_w(received), test_index);
8964 ok(lstrlen(expected) == len,
8965 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8966 lstrlen(expected), len, test_index);
8970 ok(hr == (expected ? S_OK : S_FALSE),
8971 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8972 hr, (expected ? S_OK : S_FALSE), test_index);
8973 ok(!strcmp_aw(expected, received), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8974 expected, wine_dbgstr_w(received), test_index);
8975 ok(lstrlen(expected) == len,
8976 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8977 lstrlen(expected), len, test_index);
8980 /* The property wasn't set earlier, so it should return whatever
8981 * the base IUri contains (if anything).
8984 hr = IUriBuilder_GetIUri(builder, &uri);
8986 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8987 hr, S_OK, test_index);
8990 received = (void*) 0xdeadbeef;
8993 hr = IUriBuilder_GetUserName(builder, &len, &received);
8995 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8996 hr, S_FALSE, test_index);
8998 ok(!len, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
9000 ok(!received, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
9001 received, test_index);
9004 BSTR expected = NULL;
9005 BOOL has_prop = FALSE;
9007 hr = IUri_GetUserName(uri, &expected);
9009 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
9011 has_prop = hr == S_OK;
9013 hr = IUriBuilder_GetUserName(builder, &len, &received);
9016 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9017 hr, S_OK, test_index);
9019 ok(!lstrcmpW(expected, received),
9020 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
9021 wine_dbgstr_w(expected), wine_dbgstr_w(received), test_index);
9022 ok(lstrlenW(expected) == len,
9023 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
9024 lstrlenW(expected), len, test_index);
9028 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9029 hr, S_FALSE, test_index);
9031 ok(!received, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index);
9032 ok(!len, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9036 SysFreeString(expected);
9039 if(uri) IUri_Release(uri);
9043 /* Tests IUriBuilder functions. */
9044 static void test_IUriBuilder(void) {
9046 IUriBuilder *builder;
9049 for(i = 0; i < sizeof(uri_builder_tests)/sizeof(uri_builder_tests[0]); ++i) {
9051 uri_builder_test test = uri_builder_tests[i];
9055 uriW = a2w(test.uri);
9056 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
9057 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9059 if(FAILED(hr)) continue;
9061 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9062 if(test.create_builder_todo) {
9064 ok(hr == test.create_builder_expected,
9065 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9066 hr, test.create_builder_expected, i);
9069 ok(hr == test.create_builder_expected,
9070 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9071 hr, test.create_builder_expected, i);
9075 BOOL modified = FALSE, received = FALSE;
9077 /* Perform all the string property changes. */
9078 for(j = 0; j < URI_BUILDER_STR_PROPERTY_COUNT; ++j) {
9079 uri_builder_property prop = test.properties[j];
9081 change_property(builder, &prop, i);
9082 if(prop.property != Uri_PROPERTY_SCHEME_NAME &&
9083 prop.property != Uri_PROPERTY_HOST)
9085 else if(prop.value && *prop.value)
9087 else if(prop.value && !*prop.value && prop.property == Uri_PROPERTY_HOST)
9088 /* Host name property can't be NULL, but it can be empty. */
9093 if(test.port_prop.change) {
9094 hr = IUriBuilder_SetPort(builder, test.port_prop.set, test.port_prop.value);
9096 if(test.port_prop.todo) {
9098 ok(hr == test.port_prop.expected,
9099 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9100 hr, test.port_prop.expected, i);
9103 ok(hr == test.port_prop.expected,
9104 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9105 hr, test.port_prop.expected, i);
9109 hr = IUriBuilder_HasBeenModified(builder, &received);
9111 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9114 ok(received == modified,
9115 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
9116 modified, received, i);
9118 /* Test the "Get*" functions. */
9119 test_IUriBuilder_GetFragment(builder, &test, i);
9120 test_IUriBuilder_GetHost(builder, &test, i);
9121 test_IUriBuilder_GetPassword(builder, &test, i);
9122 test_IUriBuilder_GetPath(builder, &test, i);
9123 test_IUriBuilder_GetPort(builder, &test, i);
9124 test_IUriBuilder_GetQuery(builder, &test, i);
9125 test_IUriBuilder_GetSchemeName(builder, &test, i);
9126 test_IUriBuilder_GetUserName(builder, &test, i);
9128 test_IUriBuilder_CreateUri(builder, &test, i);
9129 test_IUriBuilder_CreateUriSimple(builder, &test, i);
9130 test_IUriBuilder_CreateUriWithFlags(builder, &test, i);
9132 if(builder) IUriBuilder_Release(builder);
9133 if(uri) IUri_Release(uri);
9138 static void test_IUriBuilder_HasBeenModified(void) {
9140 IUriBuilder *builder = NULL;
9142 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9143 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9145 static const WCHAR hostW[] = {'g','o','o','g','l','e','.','c','o','m',0};
9149 hr = IUriBuilder_HasBeenModified(builder, NULL);
9150 ok(hr == E_POINTER, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9153 hr = IUriBuilder_SetHost(builder, hostW);
9154 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
9157 hr = IUriBuilder_HasBeenModified(builder, &received);
9158 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9161 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9163 hr = pCreateUri(http_urlW, 0, 0, &uri);
9164 ok(hr == S_OK, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9169 hr = IUriBuilder_SetIUri(builder, uri);
9170 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
9173 hr = IUriBuilder_HasBeenModified(builder, &received);
9174 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9177 ok(received == FALSE, "Error: Expected received to be FALSE.\n");
9179 /* Test what happens with you call SetIUri with the same IUri again. */
9180 hr = IUriBuilder_SetHost(builder, hostW);
9181 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9183 hr = IUriBuilder_HasBeenModified(builder, &received);
9184 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9187 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9189 hr = IUriBuilder_SetIUri(builder, uri);
9190 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9192 /* IUriBuilder already had 'uri' as it's IUri property and so Windows doesn't
9193 * reset any of the changes that were made to the IUriBuilder.
9195 hr = IUriBuilder_HasBeenModified(builder, &received);
9196 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9198 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9200 hr = IUriBuilder_GetHost(builder, &len, &prop);
9201 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9203 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
9204 wine_dbgstr_w(hostW), wine_dbgstr_w(prop));
9205 ok(len == lstrlenW(hostW), "Error: Expected len to be %d, but was %d instead.\n",
9206 lstrlenW(hostW), len);
9209 hr = IUriBuilder_SetIUri(builder, NULL);
9210 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9212 hr = IUriBuilder_SetHost(builder, hostW);
9213 ok(hr == S_OK, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9214 hr = IUriBuilder_HasBeenModified(builder, &received);
9215 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9218 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9220 hr = IUriBuilder_SetIUri(builder, NULL);
9221 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr, S_OK);
9223 hr = IUriBuilder_HasBeenModified(builder, &received);
9224 ok(hr == S_OK, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9227 ok(received == TRUE, "Error: Expected received to be TRUE.\n");
9229 hr = IUriBuilder_GetHost(builder, &len, &prop);
9230 ok(hr == S_OK, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9232 ok(!lstrcmpW(prop, hostW), "Error: Expected %s but got %s instead.\n",
9233 wine_dbgstr_w(hostW), wine_dbgstr_w(prop));
9234 ok(len == lstrlenW(hostW), "Error: Expected len to %d, but was %d instead.\n",
9235 lstrlenW(hostW), len);
9238 if(uri) IUri_Release(uri);
9240 if(builder) IUriBuilder_Release(builder);
9243 /* Test IUriBuilder {Get,Set}IUri functions. */
9244 static void test_IUriBuilder_IUriProperty(void) {
9245 IUriBuilder *builder = NULL;
9248 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9249 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9253 hr = IUriBuilder_GetIUri(builder, NULL);
9254 ok(hr == E_POINTER, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
9257 hr = pCreateUri(http_urlW, 0, 0, &uri);
9260 ULONG cur_count, orig_count;
9262 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
9263 orig_count = get_refcnt(uri);
9264 hr = IUriBuilder_SetIUri(builder, uri);
9265 cur_count = get_refcnt(uri);
9267 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9268 orig_count+1, cur_count);
9270 hr = IUriBuilder_SetIUri(builder, NULL);
9271 cur_count = get_refcnt(uri);
9273 ok(cur_count == orig_count, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9274 orig_count, cur_count);
9276 /* CreateUri* functions will return back the same IUri if nothing has changed. */
9277 hr = IUriBuilder_SetIUri(builder, uri);
9278 ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9279 orig_count = get_refcnt(uri);
9281 hr = IUriBuilder_CreateUri(builder, 0, 0, 0, &test);
9282 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9284 cur_count = get_refcnt(uri);
9285 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9286 orig_count+1, cur_count);
9287 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n",
9290 if(test) IUri_Release(test);
9293 hr = IUriBuilder_CreateUri(builder, -1, 0, 0, &test);
9294 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9296 cur_count = get_refcnt(uri);
9297 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9298 orig_count+1, cur_count);
9299 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9301 if(test) IUri_Release(test);
9303 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9307 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, &test);
9308 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9310 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
9312 if(test) IUri_Release(test);
9314 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9315 * explicitly set (because it's a default flags).
9318 hr = IUriBuilder_CreateUri(builder, Uri_CREATE_CANONICALIZE, 0, 0, &test);
9319 ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9321 cur_count = get_refcnt(uri);
9322 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9323 orig_count+1, cur_count);
9324 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
9326 if(test) IUri_Release(test);
9329 hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test);
9330 ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9332 cur_count = get_refcnt(uri);
9333 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9334 orig_count+1, cur_count);
9335 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9337 if(test) IUri_Release(test);
9340 hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &test);
9341 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9344 cur_count = get_refcnt(uri);
9345 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9346 orig_count+1, cur_count);
9347 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
9349 if(test) IUri_Release(test);
9351 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9355 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, 0, &test);
9356 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9358 ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
9360 if(test) IUri_Release(test);
9362 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9363 * explicitly set (because it's a default flags).
9366 hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_CANONICALIZE, 0, 0, 0, &test);
9367 ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9369 cur_count = get_refcnt(uri);
9370 ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9371 orig_count+1, cur_count);
9372 ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
9374 if(test) IUri_Release(test);
9376 if(uri) IUri_Release(uri);
9378 if(builder) IUriBuilder_Release(builder);
9381 static void test_IUriBuilder_RemoveProperties(void) {
9382 IUriBuilder *builder = NULL;
9386 hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
9387 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9389 /* Properties that can't be removed. */
9390 const DWORD invalid = Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_RAW_URI|Uri_HAS_HOST_TYPE|
9391 Uri_HAS_SCHEME|Uri_HAS_ZONE;
9393 for(i = Uri_PROPERTY_STRING_START; i <= Uri_PROPERTY_DWORD_LAST; ++i) {
9394 hr = IUriBuilder_RemoveProperties(builder, i << 1);
9395 if((i << 1) & invalid) {
9396 ok(hr == E_INVALIDARG,
9397 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9398 hr, E_INVALIDARG, i);
9401 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9406 /* Also doesn't accept anything that's outside the range of the
9409 hr = IUriBuilder_RemoveProperties(builder, (Uri_PROPERTY_DWORD_LAST+1) << 1);
9410 ok(hr == E_INVALIDARG, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
9413 if(builder) IUriBuilder_Release(builder);
9415 for(i = 0; i < sizeof(uri_builder_remove_tests)/sizeof(uri_builder_remove_tests[0]); ++i) {
9416 uri_builder_remove_test test = uri_builder_remove_tests[i];
9420 uriW = a2w(test.uri);
9421 hr = pCreateUri(uriW, test.create_flags, 0, &uri);
9425 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9426 if(test.create_builder_todo) {
9428 ok(hr == test.create_builder_expected,
9429 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9430 hr, test.create_builder_expected, i);
9433 ok(hr == test.create_builder_expected,
9434 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9435 hr, test.create_builder_expected, i);
9438 hr = IUriBuilder_RemoveProperties(builder, test.remove_properties);
9439 if(test.remove_todo) {
9441 ok(hr == test.remove_expected,
9442 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
9443 hr, test.remove_expected, i);
9446 ok(hr == test.remove_expected,
9447 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9448 hr, test.remove_expected, i);
9451 IUri *result = NULL;
9453 hr = IUriBuilder_CreateUri(builder, test.expected_flags, 0, 0, &result);
9454 if(test.expected_todo) {
9456 ok(hr == test.expected_hres,
9457 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9458 hr, test.expected_hres, i);
9461 ok(hr == test.expected_hres,
9462 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9463 hr, test.expected_hres, i);
9466 BSTR received = NULL;
9468 hr = IUri_GetAbsoluteUri(result, &received);
9469 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08x instead.\n", hr);
9470 ok(!strcmp_aw(test.expected_uri, received),
9471 "Error: Expected %s but got %s instead on test %d.\n",
9472 test.expected_uri, wine_dbgstr_w(received), i);
9473 SysFreeString(received);
9475 if(result) IUri_Release(result);
9478 if(builder) IUriBuilder_Release(builder);
9480 if(uri) IUri_Release(uri);
9485 static void test_IUriBuilder_Misc(void) {
9489 hr = pCreateUri(http_urlW, 0, 0, &uri);
9491 IUriBuilder *builder;
9493 hr = pCreateIUriBuilder(uri, 0, 0, &builder);
9494 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9499 hr = IUriBuilder_GetPort(builder, &has, &port);
9500 ok(hr == S_OK, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9502 /* 'has' will be set to FALSE, even though uri had a port. */
9503 ok(has == FALSE, "Error: Expected 'has' to be FALSE, was %d instead.\n", has);
9504 /* Still sets 'port' to 80. */
9505 ok(port == 80, "Error: Expected the port to be 80, but, was %d instead.\n", port);
9508 if(builder) IUriBuilder_Release(builder);
9510 if(uri) IUri_Release(uri);
9513 static void test_IUriBuilderFactory(void) {
9516 IUriBuilderFactory *factory;
9517 IUriBuilder *builder;
9519 hr = pCreateUri(http_urlW, 0, 0, &uri);
9520 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
9523 hr = IUri_QueryInterface(uri, &IID_IUriBuilderFactory, (void**)&factory);
9524 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08x.\n", hr);
9525 ok(factory != NULL, "Error: Expected 'factory' to not be NULL.\n");
9528 builder = (void*) 0xdeadbeef;
9529 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 10, 0, &builder);
9530 ok(hr == E_INVALIDARG, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9532 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
9534 builder = (void*) 0xdeadbeef;
9535 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 10, &builder);
9536 ok(hr == E_INVALIDARG, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9538 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
9540 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 0, NULL);
9541 ok(hr == E_POINTER, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9545 hr = IUriBuilderFactory_CreateIUriBuilder(factory, 0, 0, &builder);
9546 ok(hr == S_OK, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9549 IUri *tmp = (void*) 0xdeadbeef;
9553 hr = IUriBuilder_GetIUri(builder, &tmp);
9554 ok(hr == S_OK, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
9556 ok(!tmp, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp);
9558 hr = IUriBuilder_GetHost(builder, &result_len, &result);
9559 ok(hr == S_FALSE, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
9562 if(builder) IUriBuilder_Release(builder);
9564 builder = (void*) 0xdeadbeef;
9565 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 10, 0, &builder);
9566 ok(hr == E_INVALIDARG, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9568 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
9570 builder = (void*) 0xdeadbeef;
9571 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 10, &builder);
9572 ok(hr == E_INVALIDARG, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9574 ok(!builder, "Error: Expected 'builder' to be NULL, but was %p.\n", builder);
9576 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 0, NULL);
9577 ok(hr == E_POINTER, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9581 hr = IUriBuilderFactory_CreateInitializedIUriBuilder(factory, 0, 0, &builder);
9582 ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9587 hr = IUriBuilder_GetIUri(builder, &tmp);
9588 ok(hr == S_OK, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
9590 ok(tmp == uri, "Error: Expected tmp to be %p, but was %p.\n", uri, tmp);
9591 if(uri) IUri_Release(uri);
9593 if(builder) IUriBuilder_Release(builder);
9595 if(factory) IUriBuilderFactory_Release(factory);
9597 if(uri) IUri_Release(uri);
9600 static void test_CoInternetCombineIUri(void) {
9602 IUri *base, *relative, *result;
9606 hr = pCreateUri(http_urlW, 0, 0, &base);
9607 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr);
9609 result = (void*) 0xdeadbeef;
9610 hr = pCoInternetCombineIUri(base, NULL, 0, &result, 0);
9611 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9612 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
9616 hr = pCreateUri(http_urlW, 0, 0, &relative);
9617 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr);
9619 result = (void*) 0xdeadbeef;
9620 hr = pCoInternetCombineIUri(NULL, relative, 0, &result, 0);
9621 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9622 ok(!result, "Error: Expected 'result' to be NULL, was %p.\n", result);
9625 hr = pCoInternetCombineIUri(base, relative, 0, NULL, 0);
9626 ok(hr == E_INVALIDARG, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, E_INVALIDARG);
9628 if(base) IUri_Release(base);
9629 if(relative) IUri_Release(relative);
9631 for(i = 0; i < sizeof(uri_combine_tests)/sizeof(uri_combine_tests[0]); ++i) {
9632 LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
9634 hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
9635 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr, i);
9637 LPWSTR relativeW = a2w(uri_combine_tests[i].relative_uri);
9639 hr = pCreateUri(relativeW, uri_combine_tests[i].relative_create_flags, 0, &relative);
9640 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr, i);
9644 hr = pCoInternetCombineIUri(base, relative, uri_combine_tests[i].combine_flags, &result, 0);
9645 if(uri_combine_tests[i].todo) {
9647 ok(hr == uri_combine_tests[i].expected,
9648 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9649 hr, uri_combine_tests[i].expected, i);
9652 ok(hr == uri_combine_tests[i].expected,
9653 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9654 hr, uri_combine_tests[i]. expected, i);
9659 for(j = 0; j < sizeof(uri_combine_tests[i].str_props)/sizeof(uri_combine_tests[i].str_props[0]); ++j) {
9660 uri_combine_str_property prop = uri_combine_tests[i].str_props[j];
9663 hr = IUri_GetPropertyBSTR(result, j, &received, 0);
9666 ok(hr == prop.expected,
9667 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9668 hr, prop.expected, i, j);
9671 ok(!strcmp_aw(prop.value, received) ||
9672 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9673 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9674 prop.value, wine_dbgstr_w(received), i, j);
9677 ok(hr == prop.expected,
9678 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9679 hr, prop.expected, i, j);
9680 ok(!strcmp_aw(prop.value, received) ||
9681 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9682 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9683 prop.value, wine_dbgstr_w(received), i, j);
9685 SysFreeString(received);
9688 for(j = 0; j < sizeof(uri_combine_tests[i].dword_props)/sizeof(uri_combine_tests[i].dword_props[0]); ++j) {
9689 uri_dword_property prop = uri_combine_tests[i].dword_props[j];
9692 hr = IUri_GetPropertyDWORD(result, j+Uri_PROPERTY_DWORD_START, &received, 0);
9695 ok(hr == prop.expected,
9696 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9697 hr, prop.expected, i, j);
9700 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9701 prop.value, received, i, j);
9704 ok(hr == prop.expected,
9705 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9706 hr, prop.expected, i, j);
9707 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9708 prop.value, received, i, j);
9712 if(result) IUri_Release(result);
9714 if(relative) IUri_Release(relative);
9715 heap_free(relativeW);
9717 if(base) IUri_Release(base);
9722 static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface,
9723 REFIID riid, void **ppv)
9725 ok(0, "unexpected call\n");
9726 return E_NOINTERFACE;
9729 static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
9734 static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
9739 static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl,
9740 PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult,
9741 DWORD *pcchResult, DWORD dwReserved)
9743 CHECK_EXPECT(ParseUrl);
9744 ok(!lstrcmpW(pwzUrl, parse_urlW), "Error: Expected %s, but got %s instead.\n",
9745 wine_dbgstr_w(parse_urlW), wine_dbgstr_w(pwzUrl));
9746 ok(ParseAction == parse_action, "Error: Expected %d, but got %d.\n", parse_action, ParseAction);
9747 ok(dwParseFlags == parse_flags, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags, dwParseFlags);
9748 ok(cchResult == 200, "Error: Got %d.\n", cchResult);
9750 memcpy(pwzResult, parse_resultW, sizeof(parse_resultW));
9751 *pcchResult = lstrlenW(parse_resultW);
9756 static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface,
9757 LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags,
9758 LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
9760 CHECK_EXPECT(CombineUrl);
9761 ok(!lstrcmpW(pwzBaseUrl, combine_baseW), "Error: Expected %s, but got %s instead.\n",
9762 wine_dbgstr_w(combine_baseW), wine_dbgstr_w(pwzBaseUrl));
9763 ok(!lstrcmpW(pwzRelativeUrl, combine_relativeW), "Error: Expected %s, but got %s instead.\n",
9764 wine_dbgstr_w(combine_relativeW), wine_dbgstr_w(pwzRelativeUrl));
9765 ok(dwCombineFlags == (URL_DONT_SIMPLIFY|URL_FILE_USE_PATHURL|URL_DONT_UNESCAPE_EXTRA_INFO),
9766 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags);
9767 ok(cchResult == INTERNET_MAX_URL_LENGTH+1, "Error: Got %d.\n", cchResult);
9769 memcpy(pwzResult, combine_resultW, sizeof(combine_resultW));
9770 *pcchResult = lstrlenW(combine_resultW);
9775 static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface,
9776 LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
9778 ok(0, "unexpected call\n");
9782 static HRESULT WINAPI InternetProtocolInfo_QueryInfo(IInternetProtocolInfo *iface,
9783 LPCWSTR pwzUrl, QUERYOPTION OueryOption, DWORD dwQueryFlags, LPVOID pBuffer,
9784 DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
9786 ok(0, "unexpected call\n");
9790 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl = {
9791 InternetProtocolInfo_QueryInterface,
9792 InternetProtocolInfo_AddRef,
9793 InternetProtocolInfo_Release,
9794 InternetProtocolInfo_ParseUrl,
9795 InternetProtocolInfo_CombineUrl,
9796 InternetProtocolInfo_CompareUrl,
9797 InternetProtocolInfo_QueryInfo
9800 static IInternetProtocolInfo protocol_info = { &InternetProtocolInfoVtbl };
9802 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
9804 if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
9805 *ppv = &protocol_info;
9809 ok(0, "unexpected call\n");
9810 return E_NOINTERFACE;
9813 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
9818 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
9823 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
9824 REFIID riid, void **ppv)
9826 ok(0, "unexpected call\n");
9830 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
9832 ok(0, "unexpected call\n");
9836 static const IClassFactoryVtbl ClassFactoryVtbl = {
9837 ClassFactory_QueryInterface,
9838 ClassFactory_AddRef,
9839 ClassFactory_Release,
9840 ClassFactory_CreateInstance,
9841 ClassFactory_LockServer
9844 static IClassFactory protocol_cf = { &ClassFactoryVtbl };
9846 static void register_protocols(void)
9848 IInternetSession *session;
9851 hres = pCoInternetGetSession(0, &session, 0);
9852 ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
9856 hres = IInternetSession_RegisterNameSpace(session, &protocol_cf, &IID_NULL,
9857 winetestW, 0, NULL, 0);
9858 ok(hres == S_OK, "RegisterNameSpace failed: %08x\n", hres);
9860 IInternetSession_Release(session);
9863 static void unregister_protocols(void) {
9864 IInternetSession *session;
9867 hr = pCoInternetGetSession(0, &session, 0);
9868 ok(hr == S_OK, "CoInternetGetSession failed: 0x%08x\n", hr);
9872 hr = IInternetSession_UnregisterNameSpace(session, &protocol_cf, winetestW);
9873 ok(hr == S_OK, "UnregisterNameSpace failed: 0x%08x\n", hr);
9875 IInternetSession_Release(session);
9878 static void test_CoInternetCombineIUri_Pluggable(void) {
9882 hr = pCreateUri(combine_baseW, 0, 0, &base);
9883 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
9885 IUri *relative = NULL;
9887 hr = pCreateUri(combine_relativeW, Uri_CREATE_ALLOW_RELATIVE, 0, &relative);
9888 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
9890 IUri *result = NULL;
9892 SET_EXPECT(CombineUrl);
9894 hr = pCoInternetCombineIUri(base, relative, URL_DONT_SIMPLIFY|URL_FILE_USE_PATHURL|URL_DONT_UNESCAPE_EXTRA_INFO,
9896 ok(hr == S_OK, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
9898 CHECK_CALLED(CombineUrl);
9901 BSTR received = NULL;
9902 hr = IUri_GetAbsoluteUri(result, &received);
9903 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08x instead.\n", hr);
9905 ok(!lstrcmpW(combine_resultW, received), "Error: Expected %s, but got %s.\n",
9906 wine_dbgstr_w(combine_resultW), wine_dbgstr_w(received));
9908 SysFreeString(received);
9910 if(result) IUri_Release(result);
9912 if(relative) IUri_Release(relative);
9914 if(base) IUri_Release(base);
9917 static void test_CoInternetCombineUrlEx(void) {
9919 IUri *base, *result;
9923 hr = pCreateUri(http_urlW, 0, 0, &base);
9924 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
9926 result = (void*) 0xdeadbeef;
9927 hr = pCoInternetCombineUrlEx(base, NULL, 0, &result, 0);
9928 ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9930 ok(!result, "Error: Expected 'result' to be NULL was %p instead.\n", result);
9933 result = (void*) 0xdeadbeef;
9934 hr = pCoInternetCombineUrlEx(NULL, http_urlW, 0, &result, 0);
9935 ok(hr == E_INVALIDARG, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9937 ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result);
9939 result = (void*) 0xdeadbeef;
9940 hr = pCoInternetCombineUrlEx(NULL, NULL, 0, &result, 0);
9941 ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9943 ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result);
9945 hr = pCoInternetCombineUrlEx(base, http_urlW, 0, NULL, 0);
9946 ok(hr == E_POINTER, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9948 if(base) IUri_Release(base);
9950 for(i = 0; i < sizeof(uri_combine_tests)/sizeof(uri_combine_tests[0]); ++i) {
9951 LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
9953 hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
9954 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr, i);
9956 LPWSTR relativeW = a2w(uri_combine_tests[i].relative_uri);
9958 hr = pCoInternetCombineUrlEx(base, relativeW, uri_combine_tests[i].combine_flags,
9960 if(uri_combine_tests[i].todo) {
9962 ok(hr == uri_combine_tests[i].expected,
9963 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9964 hr, uri_combine_tests[i].expected, i);
9967 ok(hr == uri_combine_tests[i].expected,
9968 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9969 hr, uri_combine_tests[i]. expected, i);
9974 for(j = 0; j < sizeof(uri_combine_tests[i].str_props)/sizeof(uri_combine_tests[i].str_props[0]); ++j) {
9975 uri_combine_str_property prop = uri_combine_tests[i].str_props[j];
9977 LPCSTR value = (prop.value_ex) ? prop.value_ex : prop.value;
9979 hr = IUri_GetPropertyBSTR(result, j, &received, 0);
9982 ok(hr == prop.expected,
9983 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9984 hr, prop.expected, i, j);
9987 ok(!strcmp_aw(value, received) ||
9988 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9989 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9990 value, wine_dbgstr_w(received), i, j);
9993 ok(hr == prop.expected,
9994 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9995 hr, prop.expected, i, j);
9996 ok(!strcmp_aw(value, received) ||
9997 broken(prop.broken_value && !strcmp_aw(prop.broken_value, received)),
9998 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9999 value, wine_dbgstr_w(received), i, j);
10001 SysFreeString(received);
10004 for(j = 0; j < sizeof(uri_combine_tests[i].dword_props)/sizeof(uri_combine_tests[i].dword_props[0]); ++j) {
10005 uri_dword_property prop = uri_combine_tests[i].dword_props[j];
10008 hr = IUri_GetPropertyDWORD(result, j+Uri_PROPERTY_DWORD_START, &received, 0);
10011 ok(hr == prop.expected,
10012 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10013 hr, prop.expected, i, j);
10016 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10017 prop.value, received, i, j);
10020 ok(hr == prop.expected,
10021 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
10022 hr, prop.expected, i, j);
10023 ok(prop.value == received, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
10024 prop.value, received, i, j);
10028 if(result) IUri_Release(result);
10029 heap_free(relativeW);
10031 if(base) IUri_Release(base);
10036 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10040 hr = pCreateUri(combine_baseW, 0, 0, &base);
10041 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
10042 if(SUCCEEDED(hr)) {
10043 IUri *result = NULL;
10045 SET_EXPECT(CombineUrl);
10047 hr = pCoInternetCombineUrlEx(base, combine_relativeW, URL_DONT_SIMPLIFY|URL_FILE_USE_PATHURL|URL_DONT_UNESCAPE_EXTRA_INFO,
10049 ok(hr == S_OK, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
10051 CHECK_CALLED(CombineUrl);
10053 if(SUCCEEDED(hr)) {
10054 BSTR received = NULL;
10055 hr = IUri_GetAbsoluteUri(result, &received);
10056 ok(hr == S_OK, "Error: Expected S_OK, but got 0x%08x instead.\n", hr);
10057 if(SUCCEEDED(hr)) {
10058 ok(!lstrcmpW(combine_resultW, received), "Error: Expected %s, but got %s.\n",
10059 wine_dbgstr_w(combine_resultW), wine_dbgstr_w(received));
10061 SysFreeString(received);
10063 if(result) IUri_Release(result);
10065 if(base) IUri_Release(base);
10068 static void test_CoInternetParseIUri_InvalidArgs(void) {
10074 hr = pCoInternetParseIUri(NULL, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0);
10075 ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10077 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10079 hr = pCreateUri(http_urlW, 0, 0, &uri);
10080 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
10081 if(SUCCEEDED(hr)) {
10082 DWORD expected_len;
10085 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, NULL, 0, &result, 0);
10086 ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10088 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10090 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, tmp, 3, NULL, 0);
10091 ok(hr == E_POINTER, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10095 hr = pCoInternetParseIUri(uri, PARSE_SECURITY_URL, 0, tmp, 3, &result, 0);
10096 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
10098 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10101 hr = pCoInternetParseIUri(uri, PARSE_MIME, 0, tmp, 3, &result, 0);
10102 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10104 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10107 hr = pCoInternetParseIUri(uri, PARSE_SERVER, 0, tmp, 3, &result, 0);
10108 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10110 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10113 hr = pCoInternetParseIUri(uri, PARSE_SECURITY_DOMAIN, 0, tmp, 3, &result, 0);
10114 ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10116 ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
10118 expected_len = lstrlenW(http_urlW);
10120 hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0);
10121 ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER,
10122 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10123 hr, STRSAFE_E_INSUFFICIENT_BUFFER);
10124 ok(result == expected_len, "Error: Expected 'result' to be %d, but was %d instead.\n",
10125 expected_len, result);
10127 if(uri) IUri_Release(uri);
10130 static void test_CoInternetParseIUri(void) {
10133 for(i = 0; i < sizeof(uri_parse_tests)/sizeof(uri_parse_tests[0]); ++i) {
10137 uri_parse_test test = uri_parse_tests[i];
10139 uriW = a2w(test.uri);
10140 hr = pCreateUri(uriW, test.uri_flags, 0, &uri);
10141 ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr, i);
10142 if(SUCCEEDED(hr)) {
10143 WCHAR result[INTERNET_MAX_URL_LENGTH+1];
10144 DWORD result_len = -1;
10146 hr = pCoInternetParseIUri(uri, test.action, test.flags, result, INTERNET_MAX_URL_LENGTH+1, &result_len, 0);
10149 ok(hr == test.expected,
10150 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10151 hr, test.expected, i);
10154 ok(hr == test.expected,
10155 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10156 hr, test.expected, i);
10158 if(SUCCEEDED(hr)) {
10159 DWORD len = lstrlenA(test.property);
10160 ok(!strcmp_aw(test.property, result),
10161 "Error: Expected %s but got %s instead on uri_parse_tests[%d].\n",
10162 test.property, wine_dbgstr_w(result), i);
10163 ok(len == result_len,
10164 "Error: Expected %d, but got %d instead on uri_parse_tests[%d].\n",
10165 len, result_len, i);
10168 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
10172 if(uri) IUri_Release(uri);
10177 static void test_CoInternetParseIUri_Pluggable(void) {
10181 hr = pCreateUri(parse_urlW, 0, 0, &uri);
10182 ok(SUCCEEDED(hr), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr);
10183 if(SUCCEEDED(hr)) {
10187 SET_EXPECT(ParseUrl);
10189 parse_action = PARSE_CANONICALIZE;
10190 parse_flags = URL_UNESCAPE|URL_ESCAPE_UNSAFE;
10192 hr = pCoInternetParseIUri(uri, parse_action, parse_flags, result, 200, &result_len, 0);
10193 ok(hr == S_OK, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
10195 CHECK_CALLED(ParseUrl);
10197 if(SUCCEEDED(hr)) {
10198 ok(result_len == lstrlenW(parse_resultW), "Error: Expected %d, but got %d.\n",
10199 lstrlenW(parse_resultW), result_len);
10200 ok(!lstrcmpW(result, parse_resultW), "Error: Expected %s, but got %s.\n",
10201 wine_dbgstr_w(parse_resultW), wine_dbgstr_w(result));
10204 if(uri) IUri_Release(uri);
10210 const char *base_url;
10211 DWORD base_uri_flags;
10212 const char *legacy_url;
10213 const char *uniform_url;
10214 const char *no_canon_url;
10215 const char *uri_url;
10216 } create_urlmon_test_t;
10218 static const create_urlmon_test_t create_urlmon_tests[] = {
10220 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE,
10222 "http://www.winehq.org/",
10223 "http://www.winehq.org/",
10224 "http://www.winehq.org",
10225 "http://www.winehq.org"
10228 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE,
10230 "file://c:\\dir\\file.txt",
10231 "file:///c:/dir/file.txt",
10232 "file:///c:/dir/file.txt",
10233 "file:///c:/dir/file.txt"
10236 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH,
10238 "file://c:\\dir\\file.txt",
10239 "file:///c:/dir/file.txt",
10240 "file:///c:/dir/file.txt",
10241 "file://c:\\dir\\file.txt"
10244 "dat%61",Uri_CREATE_ALLOW_RELATIVE,
10245 "http://www.winehq.org",0,
10246 "http://www.winehq.org/data",
10247 "http://www.winehq.org/data",
10248 "http://www.winehq.org:80/data",
10251 "file.txt",Uri_CREATE_ALLOW_RELATIVE,
10252 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE,
10253 "file://c:\\dir\\file.txt",
10254 "file:///c:/dir/file.txt",
10255 "file:///c:/dir/file.txt",
10258 "",Uri_CREATE_ALLOW_RELATIVE,
10266 "test",Uri_CREATE_ALLOW_RELATIVE,
10274 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
10276 "file://c:\\dir\\file.txt",
10277 "file:///c:/dir/file.txt",
10278 "file:///c:/dir/file.txt",
10279 "file:///c:/dir/file.txt",
10283 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
10284 static void _test_urlmon_display_name(unsigned line, IMoniker *mon, const char *exurl)
10286 WCHAR *display_name;
10289 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &display_name);
10290 ok_(__FILE__,line)(hres == S_OK, "GetDisplayName failed: %08x\n", hres);
10291 ok_(__FILE__,line)(!strcmp_aw(exurl, display_name), "unexpected display name: %s, expected %s\n",
10292 wine_dbgstr_w(display_name), exurl);
10294 CoTaskMemFree(display_name);
10297 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
10298 static void _test_display_uri(unsigned line, IMoniker *mon, const char *exurl)
10300 IUriContainer *uri_container;
10305 hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
10306 ok(hres == S_OK, "Could not get IUriContainer iface: %08x\n", hres);
10309 hres = IUriContainer_GetIUri(uri_container, &uri);
10310 IUriContainer_Release(uri_container);
10311 ok(hres == S_OK, "GetIUri failed: %08x\n", hres);
10312 ok(uri != NULL, "uri == NULL\n");
10314 hres = IUri_GetDisplayUri(uri, &display_uri);
10316 ok(hres == S_OK, "GetDisplayUri failed: %08x\n", hres);
10317 ok_(__FILE__,line)(!strcmp_aw(exurl, display_uri), "unexpected display uri: %s, expected %s\n",
10318 wine_dbgstr_w(display_uri), exurl);
10319 SysFreeString(display_uri);
10322 static void test_CreateURLMoniker(void)
10324 const create_urlmon_test_t *test;
10325 IMoniker *mon, *base_mon;
10326 WCHAR *url, *base_url;
10327 IUri *uri, *base_uri;
10330 for(test = create_urlmon_tests; test < create_urlmon_tests + sizeof(create_urlmon_tests)/sizeof(*create_urlmon_tests); test++) {
10331 url = a2w(test->url);
10332 base_url = a2w(test->base_url);
10335 hres = pCreateUri(base_url, test->base_uri_flags, 0, &base_uri);
10336 ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
10338 hres = pCreateURLMonikerEx2(NULL, base_uri, &base_mon, URL_MK_NO_CANONICALIZE);
10339 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08x\n", hres);
10345 hres = CreateURLMoniker(base_mon, url, &mon);
10346 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
10347 test_urlmon_display_name(mon, test->legacy_url);
10348 test_display_uri(mon, test->legacy_url);
10349 IMoniker_Release(mon);
10351 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_LEGACY);
10352 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
10353 test_urlmon_display_name(mon, test->legacy_url);
10354 test_display_uri(mon, test->legacy_url);
10355 IMoniker_Release(mon);
10357 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_UNIFORM);
10358 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
10359 test_urlmon_display_name(mon, test->uniform_url);
10360 test_display_uri(mon, test->uniform_url);
10361 IMoniker_Release(mon);
10363 hres = pCreateURLMonikerEx(base_mon, url, &mon, URL_MK_NO_CANONICALIZE);
10364 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
10365 test_urlmon_display_name(mon, test->no_canon_url);
10366 test_display_uri(mon, test->no_canon_url);
10367 IMoniker_Release(mon);
10369 hres = pCreateUri(url, test->uri_flags, 0, &uri);
10370 ok(hres == S_OK, "CreateUri failed: %08x\n", hres);
10372 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_LEGACY);
10373 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08x\n", hres);
10374 test_urlmon_display_name(mon, base_url ? test->legacy_url : test->uri_url);
10375 test_display_uri(mon, base_url ? test->legacy_url : test->uri_url);
10376 IMoniker_Release(mon);
10378 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_UNIFORM);
10379 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08x\n", hres);
10380 test_urlmon_display_name(mon, base_url ? test->uniform_url : test->uri_url);
10381 test_display_uri(mon, base_url ? test->uniform_url : test->uri_url);
10382 IMoniker_Release(mon);
10384 hres = pCreateURLMonikerEx2(base_mon, uri, &mon, URL_MK_NO_CANONICALIZE);
10385 ok(hres == S_OK, "CreateURLMonikerEx2 failed: %08x\n", hres);
10386 test_urlmon_display_name(mon, base_url ? test->no_canon_url : test->uri_url);
10387 test_display_uri(mon, base_url ? test->no_canon_url : test->uri_url);
10388 IMoniker_Release(mon);
10392 heap_free(base_url);
10394 IUri_Release(base_uri);
10396 IMoniker_Release(base_mon);
10403 hurlmon = GetModuleHandle("urlmon.dll");
10404 pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
10405 pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
10406 pCreateUriWithFragment = (void*) GetProcAddress(hurlmon, "CreateUriWithFragment");
10407 pCreateIUriBuilder = (void*) GetProcAddress(hurlmon, "CreateIUriBuilder");
10408 pCoInternetCombineIUri = (void*) GetProcAddress(hurlmon, "CoInternetCombineIUri");
10409 pCoInternetCombineUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetCombineUrlEx");
10410 pCoInternetParseIUri = (void*) GetProcAddress(hurlmon, "CoInternetParseIUri");
10411 pCreateURLMonikerEx = (void*) GetProcAddress(hurlmon, "CreateURLMonikerEx");
10412 pCreateURLMonikerEx2 = (void*) GetProcAddress(hurlmon, "CreateURLMonikerEx2");
10415 win_skip("CreateUri is not present, skipping tests.\n");
10419 trace("test CreateUri invalid flags...\n");
10420 test_CreateUri_InvalidFlags();
10422 trace("test CreateUri invalid args...\n");
10423 test_CreateUri_InvalidArgs();
10425 trace("test CreateUri invalid URIs...\n");
10426 test_CreateUri_InvalidUri();
10428 trace("test IUri_GetPropertyBSTR...\n");
10429 test_IUri_GetPropertyBSTR();
10431 trace("test IUri_GetPropertyDWORD...\n");
10432 test_IUri_GetPropertyDWORD();
10434 trace("test IUri_GetStrProperties...\n");
10435 test_IUri_GetStrProperties();
10437 trace("test IUri_GetDwordProperties...\n");
10438 test_IUri_GetDwordProperties();
10440 trace("test IUri_GetPropertyLength...\n");
10441 test_IUri_GetPropertyLength();
10443 trace("test IUri_GetProperties...\n");
10444 test_IUri_GetProperties();
10446 trace("test IUri_HasProperty...\n");
10447 test_IUri_HasProperty();
10449 trace("test IUri_IsEqual...\n");
10450 test_IUri_IsEqual();
10452 trace("test CreateUriWithFragment invalid args...\n");
10453 test_CreateUriWithFragment_InvalidArgs();
10455 trace("test CreateUriWithFragment invalid flags...\n");
10456 test_CreateUriWithFragment_InvalidFlags();
10458 trace("test CreateUriWithFragment...\n");
10459 test_CreateUriWithFragment();
10461 trace("test CreateIUriBuilder...\n");
10462 test_CreateIUriBuilder();
10464 trace("test IUriBuilder_CreateInvalidArgs...\n");
10465 test_IUriBuilder_CreateInvalidArgs();
10467 trace("test IUriBuilder...\n");
10468 test_IUriBuilder();
10470 trace("test IUriBuilder_GetInvalidArgs...\n");
10471 test_IUriBuilder_GetInvalidArgs();
10473 trace("test IUriBuilder_HasBeenModified...\n");
10474 test_IUriBuilder_HasBeenModified();
10476 trace("test IUriBuilder_IUriProperty...\n");
10477 test_IUriBuilder_IUriProperty();
10479 trace("test IUriBuilder_RemoveProperties...\n");
10480 test_IUriBuilder_RemoveProperties();
10482 trace("test IUriBuilder miscellaneous...\n");
10483 test_IUriBuilder_Misc();
10485 trace("test IUriBuilderFactory...\n");
10486 test_IUriBuilderFactory();
10488 trace("test CoInternetCombineIUri...\n");
10489 test_CoInternetCombineIUri();
10491 trace("test CoInternetCombineUrlEx...\n");
10492 test_CoInternetCombineUrlEx();
10494 trace("test CoInternetParseIUri Invalid Args...\n");
10495 test_CoInternetParseIUri_InvalidArgs();
10497 trace("test CoInternetParseIUri...\n");
10498 test_CoInternetParseIUri();
10500 register_protocols();
10502 trace("test CoInternetCombineIUri pluggable...\n");
10503 test_CoInternetCombineIUri_Pluggable();
10505 trace("test CoInternetCombineUrlEx Pluggable...\n");
10506 test_CoInternetCombineUrlEx_Pluggable();
10508 trace("test CoInternetParseIUri pluggable...\n");
10509 test_CoInternetParseIUri_Pluggable();
10511 trace("test CreateURLMoniker...\n");
10512 test_CreateURLMoniker();
10514 unregister_protocols();