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 becuase 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 get's 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
}
4297 typedef struct _invalid_uri
{
4303 static const invalid_uri invalid_uri_tests
[] = {
4304 /* Has to have a scheme name. */
4305 {"://www.winehq.org",0,FALSE
},
4306 /* Window's doesn't like URI's which are implicitly file paths without the
4307 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4309 {"C:/test/test.mp3",0,FALSE
},
4310 {"\\\\Server/test/test.mp3",0,FALSE
},
4311 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
4312 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
4313 /* Invalid schemes. */
4314 {"*abcd://not.valid.com",0,FALSE
},
4315 {"*a*b*c*d://not.valid.com",0,FALSE
},
4316 /* Not allowed to have invalid % encoded data. */
4317 {"ftp://google.co%XX/",0,FALSE
},
4318 /* To many h16 components. */
4319 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
4320 /* Not enough room for IPv4 address. */
4321 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
4322 /* Not enough h16 components. */
4323 {"http://[1:2:3:4]",0,FALSE
},
4324 /* Not enough components including IPv4. */
4325 {"http://[1:192.0.1.0]",0,FALSE
},
4326 /* Not allowed to have partial IPv4 in IPv6. */
4327 {"http://[::192.0]",0,FALSE
},
4328 /* Can't have elision of 1 h16 at beginning of address. */
4329 {"http://[::2:3:4:5:6:7:8]",0,FALSE
},
4330 /* Can't have elision of 1 h16 at end of address. */
4331 {"http://[1:2:3:4:5:6:7::]",0,FALSE
},
4332 /* Expects a valid IP Literal. */
4333 {"ftp://[not.valid.uri]/",0,FALSE
},
4334 /* Expects valid port for a known scheme type. */
4335 {"ftp://www.winehq.org:123fgh",0,FALSE
},
4336 /* Port exceeds USHORT_MAX for known scheme type. */
4337 {"ftp://www.winehq.org:65536",0,FALSE
},
4338 /* Invalid port with IPv4 address. */
4339 {"http://www.winehq.org:1abcd",0,FALSE
},
4340 /* Invalid port with IPv6 address. */
4341 {"http://[::ffff]:32xy",0,FALSE
},
4342 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4343 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
4344 /* Not allowed to have invalid % encoded data in opaque URI path. */
4345 {"news:test%XX",0,FALSE
},
4346 {"mailto:wine@winehq%G8.com",0,FALSE
},
4347 /* Known scheme types can't have invalid % encoded data in query string. */
4348 {"http://google.com/?query=te%xx",0,FALSE
},
4349 /* Invalid % encoded data in fragment of know scheme type. */
4350 {"ftp://google.com/#Test%xx",0,FALSE
},
4351 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4352 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4353 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4354 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4355 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4356 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4357 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4358 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4359 /* res URIs aren't allowed to have forbidden dos path characters in the
4362 {"res://c:\\te<st\\test/test",0,FALSE
},
4363 {"res://c:\\te>st\\test/test",0,FALSE
},
4364 {"res://c:\\te\"st\\test/test",0,FALSE
},
4365 {"res://c:\\test/te%xxst",0,FALSE
}
4368 typedef struct _uri_equality
{
4370 DWORD create_flags_a
;
4373 DWORD create_flags_b
;
4379 static const uri_equality equality_tests
[] = {
4381 "HTTP://www.winehq.org/test dir/./",0,FALSE
,
4382 "http://www.winehq.org/test dir/../test dir/",0,FALSE
,
4386 /* http://www.winehq.org/test%20dir */
4387 "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
,
4388 "http://www.winehq.org/test dir",0,FALSE
,
4392 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,FALSE
,
4393 "file:///c:/test.mp3",0,FALSE
,
4397 "ftp://ftp.winehq.org/",0,FALSE
,
4398 "ftp://ftp.winehq.org",0,FALSE
,
4402 "ftp://ftp.winehq.org/test/test2/../../testB/",0,FALSE
,
4403 "ftp://ftp.winehq.org/t%45stB/",0,FALSE
,
4407 "http://google.com/TEST",0,FALSE
,
4408 "http://google.com/test",0,FALSE
,
4412 "http://GOOGLE.com/",0,FALSE
,
4413 "http://google.com/",0,FALSE
,
4416 /* Performs case insensitive compare of host names (for known scheme types). */
4418 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4419 "ftp://google.com/",0,FALSE
,
4423 "zip://GOOGLE.com/",0,FALSE
,
4424 "zip://google.com/",0,FALSE
,
4428 "file:///c:/TEST/TeST/",0,FALSE
,
4429 "file:///c:/test/test/",0,FALSE
,
4433 "file:///server/TEST",0,FALSE
,
4434 "file:///SERVER/TEST",0,FALSE
,
4438 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4439 "http://google.com/",0,FALSE
,
4443 "ftp://google.com:21/",0,FALSE
,
4444 "ftp://google.com/",0,FALSE
,
4448 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4449 "http://google.com/",0,FALSE
,
4453 "http://google.com:70/",0,FALSE
,
4454 "http://google.com:71/",0,FALSE
,
4459 typedef struct _uri_with_fragment
{
4461 const char* fragment
;
4463 HRESULT create_expected
;
4466 const char* expected_uri
;
4468 } uri_with_fragment
;
4470 static const uri_with_fragment uri_fragment_tests
[] = {
4472 "http://google.com/","#fragment",0,S_OK
,FALSE
,
4473 "http://google.com/#fragment",FALSE
4476 "http://google.com/","fragment",0,S_OK
,FALSE
,
4477 "http://google.com/#fragment",FALSE
4480 "zip://test.com/","?test",0,S_OK
,FALSE
,
4481 "zip://test.com/#?test",FALSE
4483 /* The fragment can be empty. */
4485 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
4486 "ftp://ftp.google.com/#",FALSE
4490 typedef struct _uri_builder_property
{
4493 const char *expected_value
;
4494 Uri_PROPERTY property
;
4497 } uri_builder_property
;
4499 typedef struct _uri_builder_port
{
4507 typedef struct _uri_builder_str_property
{
4508 const char* expected
;
4511 } uri_builder_str_property
;
4513 typedef struct _uri_builder_dword_property
{
4517 } uri_builder_dword_property
;
4519 typedef struct _uri_builder_test
{
4522 HRESULT create_builder_expected
;
4523 BOOL create_builder_todo
;
4525 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
4527 uri_builder_port port_prop
;
4533 DWORD uri_simple_encode_flags
;
4534 HRESULT uri_simple_hres
;
4535 BOOL uri_simple_todo
;
4537 DWORD uri_with_flags
;
4538 DWORD uri_with_builder_flags
;
4539 DWORD uri_with_encode_flags
;
4540 HRESULT uri_with_hres
;
4543 uri_builder_str_property expected_str_props
[URI_STR_PROPERTY_COUNT
];
4544 uri_builder_dword_property expected_dword_props
[URI_DWORD_PROPERTY_COUNT
];
4547 static const uri_builder_test uri_builder_tests
[] = {
4548 { "http://google.com/",0,S_OK
,FALSE
,
4550 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
4551 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
},
4552 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
4553 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
4560 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4561 {"username:password@google.com",S_OK
},
4562 {"http://google.com/?query=x#fragment",S_OK
},
4563 {"google.com",S_OK
},
4566 {"google.com",S_OK
},
4571 {"http://username:password@google.com/?query=x#fragment",S_OK
},
4573 {"username:password",S_OK
},
4577 {Uri_HOST_DNS
,S_OK
},
4579 {URL_SCHEME_HTTP
,S_OK
},
4580 {URLZONE_INVALID
,E_NOTIMPL
}
4583 { "http://google.com/",0,S_OK
,FALSE
,
4585 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
4587 {TRUE
,TRUE
,120,S_OK
,FALSE
},
4592 {"test://google.com:120/",S_OK
},
4593 {"google.com:120",S_OK
},
4594 {"test://google.com:120/",S_OK
},
4595 {"google.com",S_OK
},
4598 {"google.com",S_OK
},
4603 {"test://google.com:120/",S_OK
},
4609 {Uri_HOST_DNS
,S_OK
},
4611 {URL_SCHEME_UNKNOWN
,S_OK
},
4612 {URLZONE_INVALID
,E_NOTIMPL
}
4615 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4617 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
4618 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
4619 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
4626 {"http://[::192.2.3.4]/",S_OK
},
4627 {"[::192.2.3.4]",S_OK
},
4628 {"http://[::192.2.3.4]/",S_OK
},
4632 {"::192.2.3.4",S_OK
},
4637 {"http://[::192.2.3.4]/",S_OK
},
4643 {Uri_HOST_IPV6
,S_OK
},
4645 {URL_SCHEME_HTTP
,S_OK
},
4646 {URLZONE_INVALID
,E_NOTIMPL
}
4649 { "http://google.com/",0,S_OK
,FALSE
,
4651 {TRUE
,"Frag","#Frag",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
4658 {"http://google.com/#Frag",S_OK
},
4659 {"google.com",S_OK
},
4660 {"http://google.com/#Frag",S_OK
},
4661 {"google.com",S_OK
},
4664 {"google.com",S_OK
},
4669 {"http://google.com/#Frag",S_OK
},
4675 {Uri_HOST_DNS
,S_OK
},
4677 {URL_SCHEME_HTTP
,S_OK
},
4678 {URLZONE_INVALID
,E_NOTIMPL
}
4681 { "http://google.com/",0,S_OK
,FALSE
,
4683 {TRUE
,"","#",Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
},
4690 {"http://google.com/#",S_OK
},
4691 {"google.com",S_OK
},
4692 {"http://google.com/#",S_OK
},
4693 {"google.com",S_OK
},
4696 {"google.com",S_OK
},
4701 {"http://google.com/#",S_OK
},
4707 {Uri_HOST_DNS
,S_OK
},
4709 {URL_SCHEME_HTTP
,S_OK
},
4710 {URLZONE_INVALID
,E_NOTIMPL
}
4713 { "http://google.com/",0,S_OK
,FALSE
,
4715 {TRUE
,":password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
4722 {"http://::password@google.com/",S_OK
},
4723 {"::password@google.com",S_OK
},
4724 {"http://google.com/",S_OK
},
4725 {"google.com",S_OK
},
4728 {"google.com",S_OK
},
4733 {"http://::password@google.com/",S_OK
},
4735 {"::password",S_OK
},
4739 {Uri_HOST_DNS
,S_OK
},
4741 {URL_SCHEME_HTTP
,S_OK
},
4742 {URLZONE_INVALID
,E_NOTIMPL
}
4745 { "test/test",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4747 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
4750 Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4752 Uri_CREATE_ALLOW_RELATIVE
,0,0,S_OK
,FALSE
,
4754 {":password@test/test",S_OK
},
4755 {":password@",S_OK
},
4756 {":password@test/test",S_OK
},
4765 {":password@test/test",S_OK
},
4771 {Uri_HOST_UNKNOWN
,S_OK
},
4773 {URL_SCHEME_UNKNOWN
,S_OK
},
4774 {URLZONE_INVALID
,E_NOTIMPL
}
4777 { "http://google.com/",0,S_OK
,FALSE
,
4779 {TRUE
,"test/test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
4786 {"http://google.com/test/test",S_OK
},
4787 {"google.com",S_OK
},
4788 {"http://google.com/test/test",S_OK
},
4789 {"google.com",S_OK
},
4792 {"google.com",S_OK
},
4794 {"/test/test",S_OK
},
4795 {"/test/test",S_OK
},
4797 {"http://google.com/test/test",S_OK
},
4803 {Uri_HOST_DNS
,S_OK
},
4805 {URL_SCHEME_HTTP
,S_OK
},
4806 {URLZONE_INVALID
,E_NOTIMPL
}
4809 { "zip:testing/test",0,S_OK
,FALSE
,
4811 {TRUE
,"test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
4835 {Uri_HOST_UNKNOWN
,S_OK
},
4837 {URL_SCHEME_UNKNOWN
,S_OK
},
4838 {URLZONE_INVALID
,E_NOTIMPL
}
4841 { "http://google.com/",0,S_OK
,FALSE
,
4845 /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */
4846 {TRUE
,FALSE
,555,S_OK
,FALSE
},
4851 {"http://google.com/",S_OK
},
4852 {"google.com",S_OK
},
4853 {"http://google.com/",S_OK
},
4854 {"google.com",S_OK
},
4857 {"google.com",S_OK
},
4862 {"http://google.com/",S_OK
},
4868 {Uri_HOST_DNS
,S_OK
},
4869 /* Still returns 80, even though earlier the port was disabled. */
4871 {URL_SCHEME_HTTP
,S_OK
},
4872 {URLZONE_INVALID
,E_NOTIMPL
}
4875 { "http://google.com/",0,S_OK
,FALSE
,
4879 /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort,
4880 * you'll get 122345 instead.
4882 {TRUE
,122345,222,S_OK
,FALSE
},
4887 {"http://google.com:222/",S_OK
},
4888 {"google.com:222",S_OK
},
4889 {"http://google.com:222/",S_OK
},
4890 {"google.com",S_OK
},
4893 {"google.com",S_OK
},
4898 {"http://google.com:222/",S_OK
},
4904 {Uri_HOST_DNS
,S_OK
},
4906 {URL_SCHEME_HTTP
,S_OK
},
4907 {URLZONE_INVALID
,E_NOTIMPL
}
4910 /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */
4911 { "http://google.com/",0,S_OK
,FALSE
,
4915 {TRUE
,TRUE
,999999,S_OK
,FALSE
},
4920 {"http://google.com:999999/",S_OK
},
4921 {"google.com:999999",S_OK
},
4922 {"http://google.com:999999/",S_OK
},
4923 {"google.com",S_OK
},
4926 {"google.com",S_OK
},
4931 {"http://google.com:999999/",S_OK
},
4937 {Uri_HOST_DNS
,S_OK
},
4939 {URL_SCHEME_HTTP
,S_OK
},
4940 {URLZONE_INVALID
,E_NOTIMPL
}
4943 { "http://google.com/",0,S_OK
,FALSE
,
4945 {TRUE
,"test","?test",Uri_PROPERTY_QUERY
,S_OK
,FALSE
},
4953 {"http://google.com/?test",S_OK
},
4954 {"google.com",S_OK
},
4955 {"http://google.com/?test",S_OK
},
4956 {"google.com",S_OK
},
4959 {"google.com",S_OK
},
4964 {"http://google.com/?test",S_OK
},
4970 {Uri_HOST_DNS
,S_OK
},
4972 {URL_SCHEME_HTTP
,S_OK
},
4973 {URLZONE_INVALID
,E_NOTIMPL
}
4976 { "http://:password@google.com/",0,S_OK
,FALSE
,
4985 {"http://:password@google.com/",S_OK
},
4986 {":password@google.com",S_OK
},
4987 {"http://google.com/",S_OK
},
4988 {"google.com",S_OK
},
4991 {"google.com",S_OK
},
4996 {"http://:password@google.com/",S_OK
},
5002 {Uri_HOST_DNS
,S_OK
},
5004 {URL_SCHEME_HTTP
,S_OK
},
5005 {URLZONE_INVALID
,E_NOTIMPL
}
5008 /* IUriBuilder doesn't need a base IUri to build a IUri. */
5009 { NULL
,0,S_OK
,FALSE
,
5011 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
},
5012 {TRUE
,"google.com",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5019 {"http://google.com/",S_OK
},
5020 {"google.com",S_OK
},
5021 {"http://google.com/",S_OK
},
5022 {"google.com",S_OK
},
5025 {"google.com",S_OK
},
5030 {"http://google.com/",S_OK
},
5036 {Uri_HOST_DNS
,S_OK
},
5038 {URL_SCHEME_HTTP
,S_OK
},
5039 {URLZONE_INVALID
,E_NOTIMPL
}
5042 /* Can't set the scheme name to NULL. */
5043 { "zip://google.com/",0,S_OK
,FALSE
,
5045 {TRUE
,NULL
,"zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5052 {"zip://google.com/",S_OK
},
5053 {"google.com",S_OK
},
5054 {"zip://google.com/",S_OK
},
5055 {"google.com",S_OK
},
5058 {"google.com",S_OK
},
5063 {"zip://google.com/",S_OK
},
5069 {Uri_HOST_DNS
,S_OK
},
5071 {URL_SCHEME_UNKNOWN
,S_OK
},
5072 {URLZONE_INVALID
,E_NOTIMPL
}
5075 /* Can't set the scheme name to an empty string. */
5076 { "zip://google.com/",0,S_OK
,FALSE
,
5078 {TRUE
,"","zip",Uri_PROPERTY_SCHEME_NAME
,E_INVALIDARG
,FALSE
}
5085 {"zip://google.com/",S_OK
},
5086 {"google.com",S_OK
},
5087 {"zip://google.com/",S_OK
},
5088 {"google.com",S_OK
},
5091 {"google.com",S_OK
},
5096 {"zip://google.com/",S_OK
},
5102 {Uri_HOST_DNS
,S_OK
},
5104 {URL_SCHEME_UNKNOWN
,S_OK
},
5105 {URLZONE_INVALID
,E_NOTIMPL
}
5108 /* -1 to CreateUri makes it use the same flags as the base IUri was created with.
5109 * CreateUriSimple always uses the flags the base IUri was created with (if any).
5111 { "http://google.com/../../",Uri_CREATE_NO_CANONICALIZE
,S_OK
,FALSE
,
5116 0,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5118 {"http://google.com/../../",S_OK
},
5119 {"google.com",S_OK
},
5120 {"http://google.com/../../",S_OK
},
5121 {"google.com",S_OK
},
5124 {"google.com",S_OK
},
5129 {"http://google.com/../../",S_OK
},
5135 {Uri_HOST_DNS
,S_OK
},
5137 {URL_SCHEME_HTTP
,S_OK
},
5138 {URLZONE_INVALID
,E_NOTIMPL
}
5141 { "http://google.com/",0,S_OK
,FALSE
,
5143 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5148 Uri_CREATE_NO_DECODE_EXTRA_INFO
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5150 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5151 {"google.com",S_OK
},
5152 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5153 {"google.com",S_OK
},
5155 {"#Fr%3C%7C%3Eg",S_OK
},
5156 {"google.com",S_OK
},
5161 {"http://google.com/#Fr<|>g",S_OK
},
5167 {Uri_HOST_DNS
,S_OK
},
5169 {URL_SCHEME_HTTP
,S_OK
},
5170 {URLZONE_INVALID
,E_NOTIMPL
}
5173 { "http://google.com/",0,S_OK
,FALSE
,
5175 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5178 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,E_INVALIDARG
,FALSE
,
5180 Uri_CREATE_CANONICALIZE
|Uri_CREATE_NO_CANONICALIZE
,UriBuilder_USE_ORIGINAL_FLAGS
,0,S_OK
,FALSE
,
5182 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5183 {"google.com",S_OK
},
5184 {"http://google.com/#Fr%3C%7C%3Eg",S_OK
},
5185 {"google.com",S_OK
},
5187 {"#Fr%3C%7C%3Eg",S_OK
},
5188 {"google.com",S_OK
},
5193 {"http://google.com/#Fr<|>g",S_OK
},
5199 {Uri_HOST_DNS
,S_OK
},
5201 {URL_SCHEME_HTTP
,S_OK
},
5202 {URLZONE_INVALID
,E_NOTIMPL
}
5205 { NULL
,0,S_OK
,FALSE
,
5207 {TRUE
,"/test/test/",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
},
5208 {TRUE
,"#Fr<|>g",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,FALSE
}
5211 0,INET_E_INVALID_URL
,FALSE
,
5212 0,INET_E_INVALID_URL
,FALSE
,
5213 0,0,0,INET_E_INVALID_URL
,FALSE
5215 { "http://google.com/",0,S_OK
,FALSE
,
5217 {TRUE
,"ht%xxtp",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,FALSE
}
5220 0,INET_E_INVALID_URL
,FALSE
,
5221 0,INET_E_INVALID_URL
,FALSE
,
5222 0,0,0,INET_E_INVALID_URL
,FALSE
5224 /* File scheme's can't have a username set. */
5225 { "file://google.com/",0,S_OK
,FALSE
,
5227 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5230 0,INET_E_INVALID_URL
,FALSE
,
5231 0,INET_E_INVALID_URL
,FALSE
,
5232 0,0,0,INET_E_INVALID_URL
,FALSE
5234 /* File schemes can't have a password set. */
5235 { "file://google.com/",0,S_OK
,FALSE
,
5237 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5240 0,INET_E_INVALID_URL
,FALSE
,
5241 0,INET_E_INVALID_URL
,FALSE
,
5242 0,0,0,INET_E_INVALID_URL
,FALSE
5244 /* UserName can't contain any character that is a delimeter for another
5245 * component that appears after it in a normal URI.
5247 { "http://google.com/",0,S_OK
,FALSE
,
5249 {TRUE
,"user:pass",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5252 0,INET_E_INVALID_URL
,FALSE
,
5253 0,INET_E_INVALID_URL
,FALSE
,
5254 0,0,0,INET_E_INVALID_URL
,FALSE
5256 { "http://google.com/",0,S_OK
,FALSE
,
5258 {TRUE
,"user@google.com",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5261 0,INET_E_INVALID_URL
,FALSE
,
5262 0,INET_E_INVALID_URL
,FALSE
,
5263 0,0,0,INET_E_INVALID_URL
,FALSE
5265 { "http://google.com/",0,S_OK
,FALSE
,
5267 {TRUE
,"user/path",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5270 0,INET_E_INVALID_URL
,FALSE
,
5271 0,INET_E_INVALID_URL
,FALSE
,
5272 0,0,0,INET_E_INVALID_URL
,FALSE
5274 { "http://google.com/",0,S_OK
,FALSE
,
5276 {TRUE
,"user?Query",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5279 0,INET_E_INVALID_URL
,FALSE
,
5280 0,INET_E_INVALID_URL
,FALSE
,
5281 0,0,0,INET_E_INVALID_URL
,FALSE
5283 { "http://google.com/",0,S_OK
,FALSE
,
5285 {TRUE
,"user#Frag",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,FALSE
}
5288 0,INET_E_INVALID_URL
,FALSE
,
5289 0,INET_E_INVALID_URL
,FALSE
,
5290 0,0,0,INET_E_INVALID_URL
,FALSE
5292 { "http://google.com/",0,S_OK
,FALSE
,
5294 {TRUE
,"pass@google.com",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5297 0,INET_E_INVALID_URL
,FALSE
,
5298 0,INET_E_INVALID_URL
,FALSE
,
5299 0,0,0,INET_E_INVALID_URL
,FALSE
5301 { "http://google.com/",0,S_OK
,FALSE
,
5303 {TRUE
,"pass/path",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5306 0,INET_E_INVALID_URL
,FALSE
,
5307 0,INET_E_INVALID_URL
,FALSE
,
5308 0,0,0,INET_E_INVALID_URL
,FALSE
5310 { "http://google.com/",0,S_OK
,FALSE
,
5312 {TRUE
,"pass?query",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5315 0,INET_E_INVALID_URL
,FALSE
,
5316 0,INET_E_INVALID_URL
,FALSE
,
5317 0,0,0,INET_E_INVALID_URL
,FALSE
5319 { "http://google.com/",0,S_OK
,FALSE
,
5321 {TRUE
,"pass#frag",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,FALSE
}
5324 0,INET_E_INVALID_URL
,FALSE
,
5325 0,INET_E_INVALID_URL
,FALSE
,
5326 0,0,0,INET_E_INVALID_URL
,FALSE
5328 { "http://google.com/",0,S_OK
,FALSE
,
5330 {TRUE
,"winehq.org/test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5333 0,INET_E_INVALID_URL
,FALSE
,
5334 0,INET_E_INVALID_URL
,FALSE
,
5335 0,0,0,INET_E_INVALID_URL
,FALSE
5337 { "http://google.com/",0,S_OK
,FALSE
,
5339 {TRUE
,"winehq.org?test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5342 0,INET_E_INVALID_URL
,FALSE
,
5343 0,INET_E_INVALID_URL
,FALSE
,
5344 0,0,0,INET_E_INVALID_URL
,FALSE
5346 { "http://google.com/",0,S_OK
,FALSE
,
5348 {TRUE
,"winehq.org#test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5351 0,INET_E_INVALID_URL
,FALSE
,
5352 0,INET_E_INVALID_URL
,FALSE
,
5353 0,0,0,INET_E_INVALID_URL
,FALSE
5355 /* Hostname is allowed to contain a ':' (even for known scheme types). */
5356 { "http://google.com/",0,S_OK
,FALSE
,
5358 {TRUE
,"winehq.org:test",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
},
5365 {"http://winehq.org:test/",S_OK
},
5366 {"winehq.org:test",S_OK
},
5367 {"http://winehq.org:test/",S_OK
},
5368 {"winehq.org:test",S_OK
},
5371 {"winehq.org:test",S_OK
},
5376 {"http://winehq.org:test/",S_OK
},
5382 {Uri_HOST_DNS
,S_OK
},
5384 {URL_SCHEME_HTTP
,S_OK
},
5385 {URLZONE_INVALID
,E_NOTIMPL
}
5388 /* Can't set the host name to NULL. */
5389 { "http://google.com/",0,S_OK
,FALSE
,
5391 {TRUE
,NULL
,"google.com",Uri_PROPERTY_HOST
,E_INVALIDARG
,FALSE
}
5398 {"http://google.com/",S_OK
},
5399 {"google.com",S_OK
},
5400 {"http://google.com/",S_OK
},
5401 {"google.com",S_OK
},
5404 {"google.com",S_OK
},
5409 {"http://google.com/",S_OK
},
5415 {Uri_HOST_DNS
,S_OK
},
5417 {URL_SCHEME_HTTP
,S_OK
},
5418 {URLZONE_INVALID
,E_NOTIMPL
}
5421 /* Can set the host name to an empty string. */
5422 { "http://google.com/",0,S_OK
,FALSE
,
5424 {TRUE
,"",NULL
,Uri_PROPERTY_HOST
,S_OK
,FALSE
}
5448 {Uri_HOST_UNKNOWN
,S_OK
},
5450 {URL_SCHEME_HTTP
,S_OK
},
5451 {URLZONE_INVALID
,E_NOTIMPL
}
5454 { "http://google.com/",0,S_OK
,FALSE
,
5456 {TRUE
,"/path?query",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5459 0,INET_E_INVALID_URL
,FALSE
,
5460 0,INET_E_INVALID_URL
,FALSE
,
5461 0,0,0,INET_E_INVALID_URL
,FALSE
5463 { "http://google.com/",0,S_OK
,FALSE
,
5465 {TRUE
,"/path#test",NULL
,Uri_PROPERTY_PATH
,S_OK
,FALSE
}
5468 0,INET_E_INVALID_URL
,FALSE
,
5469 0,INET_E_INVALID_URL
,FALSE
,
5470 0,0,0,INET_E_INVALID_URL
,FALSE
5472 { "http://google.com/",0,S_OK
,FALSE
,
5474 {TRUE
,"?path#test",NULL
,Uri_PROPERTY_QUERY
,S_OK
,FALSE
}
5477 0,INET_E_INVALID_URL
,FALSE
,
5478 0,INET_E_INVALID_URL
,FALSE
,
5479 0,0,0,INET_E_INVALID_URL
,FALSE
5483 typedef struct _uri_builder_remove_test
{
5486 HRESULT create_builder_expected
;
5487 BOOL create_builder_todo
;
5489 DWORD remove_properties
;
5490 HRESULT remove_expected
;
5493 const char *expected_uri
;
5494 DWORD expected_flags
;
5495 HRESULT expected_hres
;
5497 } uri_builder_remove_test
;
5499 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
5500 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
5501 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,FALSE
,
5502 "http://google.com/",0,S_OK
,FALSE
5504 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
5505 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,FALSE
,
5506 "http://winehq.org/",0,S_OK
,FALSE
5508 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
5509 Uri_HAS_HOST
,S_OK
,FALSE
,
5510 "zip:/?Test=x",0,S_OK
,FALSE
5512 /* Doesn't remove the whole userinfo component. */
5513 { "http://username:pass@google.com/",0,S_OK
,FALSE
,
5514 Uri_HAS_USER_INFO
,S_OK
,FALSE
,
5515 "http://username:pass@google.com/",0,S_OK
,FALSE
5517 /* Doesn't remove the domain. */
5518 { "http://google.com/",0,S_OK
,FALSE
,
5519 Uri_HAS_DOMAIN
,S_OK
,FALSE
,
5520 "http://google.com/",0,S_OK
,FALSE
5522 { "http://google.com:120/",0,S_OK
,FALSE
,
5523 Uri_HAS_AUTHORITY
,S_OK
,FALSE
,
5524 "http://google.com:120/",0,S_OK
,FALSE
5526 { "http://google.com/test.com/",0,S_OK
,FALSE
,
5527 Uri_HAS_EXTENSION
,S_OK
,FALSE
,
5528 "http://google.com/test.com/",0,S_OK
,FALSE
5530 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5531 Uri_HAS_PATH_AND_QUERY
,S_OK
,FALSE
,
5532 "http://google.com/?test=x",0,S_OK
,FALSE
5534 /* Can't remove the scheme name. */
5535 { "http://google.com/?test=x",0,S_OK
,FALSE
,
5536 Uri_HAS_SCHEME_NAME
|Uri_HAS_QUERY
,E_INVALIDARG
,FALSE
,
5537 "http://google.com/?test=x",0,S_OK
,FALSE
5541 typedef struct _uri_combine_str_property
{
5545 const char *broken_value
;
5546 const char *value_ex
;
5547 } uri_combine_str_property
;
5549 typedef struct _uri_combine_test
{
5550 const char *base_uri
;
5551 DWORD base_create_flags
;
5552 const char *relative_uri
;
5553 DWORD relative_create_flags
;
5554 DWORD combine_flags
;
5558 uri_combine_str_property str_props
[URI_STR_PROPERTY_COUNT
];
5559 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
5562 static const uri_combine_test uri_combine_tests
[] = {
5563 { "http://google.com/fun/stuff",0,
5564 "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE
,
5567 {"http://google.com/not/fun/stuff",S_OK
},
5568 {"google.com",S_OK
},
5569 {"http://google.com/not/fun/stuff",S_OK
},
5570 {"google.com",S_OK
},
5573 {"google.com",S_OK
},
5575 {"/not/fun/stuff",S_OK
},
5576 {"/not/fun/stuff",S_OK
},
5578 {"http://google.com/not/fun/stuff",S_OK
},
5584 {Uri_HOST_DNS
,S_OK
},
5586 {URL_SCHEME_HTTP
,S_OK
},
5587 {URLZONE_INVALID
,E_NOTIMPL
}
5590 { "http://google.com/test",0,
5591 "zip://test.com/cool",0,
5594 {"zip://test.com/cool",S_OK
},
5596 {"zip://test.com/cool",S_OK
},
5605 {"zip://test.com/cool",S_OK
},
5611 {Uri_HOST_DNS
,S_OK
},
5613 {URL_SCHEME_UNKNOWN
,S_OK
},
5614 {URLZONE_INVALID
,E_NOTIMPL
}
5617 { "http://google.com/use/base/path",0,
5618 "?relative",Uri_CREATE_ALLOW_RELATIVE
,
5621 {"http://google.com/use/base/path?relative",S_OK
},
5622 {"google.com",S_OK
},
5623 {"http://google.com/use/base/path?relative",S_OK
},
5624 {"google.com",S_OK
},
5627 {"google.com",S_OK
},
5629 {"/use/base/path",S_OK
},
5630 {"/use/base/path?relative",S_OK
},
5632 {"http://google.com/use/base/path?relative",S_OK
},
5638 {Uri_HOST_DNS
,S_OK
},
5640 {URL_SCHEME_HTTP
,S_OK
},
5641 {URLZONE_INVALID
,E_NOTIMPL
}
5644 { "http://google.com/path",0,
5645 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
5648 {"http://google.com/testing",S_OK
},
5649 {"google.com",S_OK
},
5650 {"http://google.com/testing",S_OK
},
5651 {"google.com",S_OK
},
5654 {"google.com",S_OK
},
5659 {"http://google.com/testing",S_OK
},
5665 {Uri_HOST_DNS
,S_OK
},
5667 {URL_SCHEME_HTTP
,S_OK
},
5668 {URLZONE_INVALID
,E_NOTIMPL
}
5671 { "http://google.com/path",0,
5672 "/test/../test/.././testing",Uri_CREATE_ALLOW_RELATIVE
,
5673 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
5675 {"http://google.com:80/test/../test/.././testing",S_OK
},
5676 {"google.com",S_OK
},
5677 {"http://google.com:80/test/../test/.././testing",S_OK
},
5678 {"google.com",S_OK
},
5681 {"google.com",S_OK
},
5683 {"/test/../test/.././testing",S_OK
},
5684 {"/test/../test/.././testing",S_OK
},
5686 {"http://google.com:80/test/../test/.././testing",S_OK
},
5692 {Uri_HOST_DNS
,S_OK
},
5694 {URL_SCHEME_HTTP
,S_OK
},
5695 {URLZONE_INVALID
,E_NOTIMPL
}
5698 { "http://winehq.org/test/abc",0,
5699 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
5702 {"http://winehq.org/test/testing/test",S_OK
},
5703 {"winehq.org",S_OK
},
5704 {"http://winehq.org/test/testing/test",S_OK
},
5705 {"winehq.org",S_OK
},
5708 {"winehq.org",S_OK
},
5710 {"/test/testing/test",S_OK
},
5711 {"/test/testing/test",S_OK
},
5713 {"http://winehq.org/test/testing/test",S_OK
},
5719 {Uri_HOST_DNS
,S_OK
},
5721 {URL_SCHEME_HTTP
,S_OK
},
5722 {URLZONE_INVALID
,E_NOTIMPL
}
5725 { "http://winehq.org/test/abc",0,
5726 "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE
,
5727 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
5729 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
5730 /* Default port is hidden in the authority. */
5731 {"winehq.org",S_OK
},
5732 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
5733 {"winehq.org",S_OK
},
5736 {"winehq.org",S_OK
},
5738 {"/test/testing/abc/../test",S_OK
},
5739 {"/test/testing/abc/../test",S_OK
},
5741 {"http://winehq.org:80/test/testing/abc/../test",S_OK
},
5747 {Uri_HOST_DNS
,S_OK
},
5749 {URL_SCHEME_HTTP
,S_OK
},
5750 {URLZONE_INVALID
,E_NOTIMPL
}
5753 { "http://winehq.org/test?query",0,
5754 "testing",Uri_CREATE_ALLOW_RELATIVE
,
5757 {"http://winehq.org/testing",S_OK
},
5758 {"winehq.org",S_OK
},
5759 {"http://winehq.org/testing",S_OK
},
5760 {"winehq.org",S_OK
},
5763 {"winehq.org",S_OK
},
5768 {"http://winehq.org/testing",S_OK
},
5774 {Uri_HOST_DNS
,S_OK
},
5776 {URL_SCHEME_HTTP
,S_OK
},
5777 {URLZONE_INVALID
,E_NOTIMPL
}
5780 { "http://winehq.org/test#frag",0,
5781 "testing",Uri_CREATE_ALLOW_RELATIVE
,
5784 {"http://winehq.org/testing",S_OK
},
5785 {"winehq.org",S_OK
},
5786 {"http://winehq.org/testing",S_OK
},
5787 {"winehq.org",S_OK
},
5790 {"winehq.org",S_OK
},
5795 {"http://winehq.org/testing",S_OK
},
5801 {Uri_HOST_DNS
,S_OK
},
5803 {URL_SCHEME_HTTP
,S_OK
},
5804 {URLZONE_INVALID
,E_NOTIMPL
}
5807 { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE
,
5808 "test",Uri_CREATE_ALLOW_RELATIVE
,
5828 {Uri_HOST_UNKNOWN
,S_OK
},
5830 {URL_SCHEME_UNKNOWN
,S_OK
},
5831 {URLZONE_INVALID
,E_NOTIMPL
}
5834 { "file:///c:/test/test",0,
5835 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
5836 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
5838 {"file://c:\\testing.mp3",S_OK
},
5840 {"file://c:\\testing.mp3",S_OK
},
5846 {"c:\\testing.mp3",S_OK
},
5847 {"c:\\testing.mp3",S_OK
},
5849 {"file://c:\\testing.mp3",S_OK
},
5855 {Uri_HOST_UNKNOWN
,S_OK
},
5857 {URL_SCHEME_FILE
,S_OK
},
5858 {URLZONE_INVALID
,E_NOTIMPL
}
5861 { "file:///c:/test/test",0,
5862 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
5865 {"file:///c:/testing.mp3",S_OK
},
5867 {"file:///c:/testing.mp3",S_OK
},
5873 {"/c:/testing.mp3",S_OK
},
5874 {"/c:/testing.mp3",S_OK
},
5876 {"file:///c:/testing.mp3",S_OK
},
5882 {Uri_HOST_UNKNOWN
,S_OK
},
5884 {URL_SCHEME_FILE
,S_OK
},
5885 {URLZONE_INVALID
,E_NOTIMPL
}
5888 { "file://test.com/test/test",0,
5889 "/testing.mp3",Uri_CREATE_ALLOW_RELATIVE
,
5890 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
5892 {"file://\\\\test.com\\testing.mp3",S_OK
},
5894 {"file://\\\\test.com\\testing.mp3",S_OK
},
5900 {"\\testing.mp3",S_OK
},
5901 {"\\testing.mp3",S_OK
},
5903 {"file://\\\\test.com\\testing.mp3",S_OK
},
5909 {Uri_HOST_DNS
,S_OK
},
5911 {URL_SCHEME_FILE
,S_OK
},
5912 {URLZONE_INVALID
,E_NOTIMPL
}
5915 /* URL_DONT_SIMPLIFY has no effect. */
5916 { "http://google.com/test",0,
5917 "zip://test.com/cool/../cool/test",0,
5918 URL_DONT_SIMPLIFY
,S_OK
,FALSE
,
5920 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
5922 {"zip://test.com/cool/test",S_OK
,FALSE
,NULL
,"zip://test.com/cool/../cool/test"},
5928 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
5929 {"/cool/test",S_OK
,FALSE
,NULL
,"/cool/../cool/test"},
5931 /* The resulting IUri has the same Raw URI as the relative URI (only IE 8).
5932 * On IE 7 it reduces the path in the Raw URI.
5934 {"zip://test.com/cool/../cool/test",S_OK
,FALSE
,"zip://test.com/cool/test"},
5940 {Uri_HOST_DNS
,S_OK
},
5942 {URL_SCHEME_UNKNOWN
,S_OK
},
5943 {URLZONE_INVALID
,E_NOTIMPL
}
5946 /* FILE_USE_PATHURL has no effect in IE 8, in IE 7 the
5947 * resulting URI is converted into a dos path.
5949 { "http://google.com/test",0,
5950 "file:///c:/test/",0,
5951 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
5953 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
5955 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
5961 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
5962 {"/c:/test/",S_OK
,FALSE
,"c:\\test\\"},
5964 {"file:///c:/test/",S_OK
,FALSE
,"file://c:\\test\\"},
5970 {Uri_HOST_UNKNOWN
,S_OK
},
5972 {URL_SCHEME_FILE
,S_OK
},
5973 {URLZONE_INVALID
,E_NOTIMPL
}
5976 { "http://google.com/test",0,
5977 "http://test.com/test#%30test",0,
5978 URL_DONT_UNESCAPE_EXTRA_INFO
,S_OK
,FALSE
,
5980 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
5982 {"http://test.com/test#0test",S_OK
,FALSE
,NULL
,"http://test.com/test#%30test"},
5985 {"#0test",S_OK
,FALSE
,NULL
,"#%30test"},
5991 /* IE 7 decodes the %30 to a 0 in the Raw URI. */
5992 {"http://test.com/test#%30test",S_OK
,FALSE
,"http://test.com/test#0test"},
5998 {Uri_HOST_DNS
,S_OK
},
6000 {URL_SCHEME_HTTP
,S_OK
},
6001 {URLZONE_INVALID
,E_NOTIMPL
}
6004 /* Windows validates the path component from the relative Uri. */
6005 { "http://google.com/test",0,
6006 "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE
,
6007 0,E_INVALIDARG
,FALSE
6009 /* Windows doesn't validate the query from the relative Uri. */
6010 { "http://google.com/test",0,
6011 "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6014 {"http://google.com/test?Tes%XXt",S_OK
},
6015 {"google.com",S_OK
},
6016 {"http://google.com/test?Tes%XXt",S_OK
},
6017 {"google.com",S_OK
},
6020 {"google.com",S_OK
},
6023 {"/test?Tes%XXt",S_OK
},
6025 {"http://google.com/test?Tes%XXt",S_OK
},
6031 {Uri_HOST_DNS
,S_OK
},
6033 {URL_SCHEME_HTTP
,S_OK
},
6034 {URLZONE_INVALID
,E_NOTIMPL
}
6037 /* Windows doesn't validate the fragment from the relative Uri. */
6038 { "http://google.com/test",0,
6039 "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE
,
6042 {"http://google.com/test#Tes%XXt",S_OK
},
6043 {"google.com",S_OK
},
6044 {"http://google.com/test#Tes%XXt",S_OK
},
6045 {"google.com",S_OK
},
6048 {"google.com",S_OK
},
6053 {"http://google.com/test#Tes%XXt",S_OK
},
6059 {Uri_HOST_DNS
,S_OK
},
6061 {URL_SCHEME_HTTP
,S_OK
},
6062 {URLZONE_INVALID
,E_NOTIMPL
}
6065 /* Creates an IUri which contains an invalid dos path char. */
6066 { "file:///c:/test",0,
6067 "/test<ing",Uri_CREATE_ALLOW_RELATIVE
,
6068 URL_FILE_USE_PATHURL
,S_OK
,FALSE
,
6070 {"file://c:\\test<ing",S_OK
},
6072 {"file://c:\\test<ing",S_OK
},
6078 {"c:\\test<ing",S_OK
},
6079 {"c:\\test<ing",S_OK
},
6081 {"file://c:\\test<ing",S_OK
},
6087 {Uri_HOST_UNKNOWN
,S_OK
},
6089 {URL_SCHEME_FILE
,S_OK
},
6090 {URLZONE_INVALID
,E_NOTIMPL
}
6093 /* Appends the path after the drive letter (if any). */
6094 { "file:///c:/test",0,
6095 "/c:/testing",Uri_CREATE_ALLOW_RELATIVE
,
6098 {"file:///c:/c:/testing",S_OK
},
6100 {"file:///c:/c:/testing",S_OK
},
6106 {"/c:/c:/testing",S_OK
},
6107 {"/c:/c:/testing",S_OK
},
6109 {"file:///c:/c:/testing",S_OK
},
6115 {Uri_HOST_UNKNOWN
,S_OK
},
6117 {URL_SCHEME_FILE
,S_OK
},
6118 {URLZONE_INVALID
,E_NOTIMPL
}
6121 /* A '/' is added if the base URI doesn't have a path and the
6122 * relative URI doesn't contain a path (since the base URI is
6125 { "http://google.com",Uri_CREATE_NO_CANONICALIZE
,
6126 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6129 {"http://google.com/?test",S_OK
},
6130 {"google.com",S_OK
},
6131 {"http://google.com/?test",S_OK
},
6132 {"google.com",S_OK
},
6135 {"google.com",S_OK
},
6140 {"http://google.com/?test",S_OK
},
6146 {Uri_HOST_DNS
,S_OK
},
6148 {URL_SCHEME_HTTP
,S_OK
},
6149 {URLZONE_INVALID
,E_NOTIMPL
}
6152 { "zip://google.com",Uri_CREATE_NO_CANONICALIZE
,
6153 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6156 {"zip://google.com/?test",S_OK
},
6157 {"google.com",S_OK
},
6158 {"zip://google.com/?test",S_OK
},
6159 {"google.com",S_OK
},
6162 {"google.com",S_OK
},
6167 {"zip://google.com/?test",S_OK
},
6173 {Uri_HOST_DNS
,S_OK
},
6175 {URL_SCHEME_UNKNOWN
,S_OK
},
6176 {URLZONE_INVALID
,E_NOTIMPL
}
6179 /* No path is appended since the base URI is opaque. */
6181 "?test",Uri_CREATE_ALLOW_RELATIVE
,
6201 {Uri_HOST_UNKNOWN
,S_OK
},
6203 {URL_SCHEME_UNKNOWN
,S_OK
},
6204 {URLZONE_INVALID
,E_NOTIMPL
}
6208 "../testing/test",Uri_CREATE_ALLOW_RELATIVE
,
6211 {"file:///c:/testing/test",S_OK
},
6213 {"file:///c:/testing/test",S_OK
},
6219 {"/c:/testing/test",S_OK
},
6220 {"/c:/testing/test",S_OK
},
6222 {"file:///c:/testing/test",S_OK
},
6228 {Uri_HOST_UNKNOWN
,S_OK
},
6230 {URL_SCHEME_FILE
,S_OK
},
6231 {URLZONE_INVALID
,E_NOTIMPL
}
6234 { "http://winehq.org/dir/testfile",0,
6235 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6238 {"http://winehq.org/dir/test?querystring",S_OK
},
6239 {"winehq.org",S_OK
},
6240 {"http://winehq.org/dir/test?querystring",S_OK
},
6241 {"winehq.org",S_OK
},
6244 {"winehq.org",S_OK
},
6247 {"/dir/test?querystring",S_OK
},
6248 {"?querystring",S_OK
},
6249 {"http://winehq.org/dir/test?querystring",S_OK
},
6255 {Uri_HOST_DNS
,S_OK
},
6257 {URL_SCHEME_HTTP
,S_OK
},
6258 {URLZONE_INVALID
,E_NOTIMPL
}
6261 { "http://winehq.org/dir/test",0,
6262 "test?querystring",Uri_CREATE_ALLOW_RELATIVE
,
6265 {"http://winehq.org/dir/test?querystring",S_OK
},
6266 {"winehq.org",S_OK
},
6267 {"http://winehq.org/dir/test?querystring",S_OK
},
6268 {"winehq.org",S_OK
},
6271 {"winehq.org",S_OK
},
6274 {"/dir/test?querystring",S_OK
},
6275 {"?querystring",S_OK
},
6276 {"http://winehq.org/dir/test?querystring",S_OK
},
6282 {Uri_HOST_DNS
,S_OK
},
6284 {URL_SCHEME_HTTP
,S_OK
},
6285 {URLZONE_INVALID
,E_NOTIMPL
}
6288 { "http://winehq.org/dir/test?querystring",0,
6289 "#hash",Uri_CREATE_ALLOW_RELATIVE
,
6292 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6293 {"winehq.org",S_OK
},
6294 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6295 {"winehq.org",S_OK
},
6298 {"winehq.org",S_OK
},
6301 {"/dir/test?querystring",S_OK
},
6302 {"?querystring",S_OK
},
6303 {"http://winehq.org/dir/test?querystring#hash",S_OK
},
6309 {Uri_HOST_DNS
,S_OK
},
6311 {URL_SCHEME_HTTP
,S_OK
},
6312 {URLZONE_INVALID
,E_NOTIMPL
}
6317 typedef struct _uri_parse_test
{
6322 const char *property
;
6327 static const uri_parse_test uri_parse_tests
[] = {
6328 /* PARSE_CANONICALIZE tests. */
6329 {"zip://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"zip://google.com/test<|>",S_OK
,FALSE
},
6330 {"http://google.com/test<|>",0,PARSE_CANONICALIZE
,0,"http://google.com/test%3C%7C%3E",S_OK
,FALSE
},
6331 {"http://google.com/%30%23%3F",0,PARSE_CANONICALIZE
,URL_UNESCAPE
,"http://google.com/0#?",S_OK
,FALSE
},
6332 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_UNSAFE
,"test %3C%7C%3E",S_OK
,FALSE
},
6333 {"test <|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_ESCAPE_SPACES_ONLY
,"test%20<|>",S_OK
,FALSE
},
6334 {"test%20<|>",Uri_CREATE_ALLOW_RELATIVE
,PARSE_CANONICALIZE
,URL_UNESCAPE
|URL_ESCAPE_UNSAFE
,"test%20%3C%7C%3E",S_OK
,FALSE
},
6335 {"http://google.com/%20",0,PARSE_CANONICALIZE
,URL_ESCAPE_PERCENT
,"http://google.com/%2520",S_OK
,FALSE
},
6336 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"http://google.com/test/../",S_OK
,FALSE
},
6337 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_NO_META
,"http://google.com/test/../",S_OK
,FALSE
},
6338 {"http://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"http://google.com/",S_OK
,FALSE
},
6339 {"zip://google.com/test/../",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,0,"zip://google.com/",S_OK
,FALSE
},
6340 {"file:///c:/test/../test",Uri_CREATE_NO_CANONICALIZE
,PARSE_CANONICALIZE
,URL_DONT_SIMPLIFY
,"file:///c:/test/../test",S_OK
,FALSE
},
6342 /* PARSE_FRIENDLY tests. */
6343 {"http://test@google.com/test#test",0,PARSE_FRIENDLY
,0,"http://google.com/test#test",S_OK
,FALSE
},
6344 {"zip://test@google.com/test",0,PARSE_FRIENDLY
,0,"zip://test@google.com/test",S_OK
,FALSE
},
6346 /* PARSE_ROOTDOCUMENT tests. */
6347 {"http://google.com:200/test/test",0,PARSE_ROOTDOCUMENT
,0,"http://google.com:200/",S_OK
,FALSE
},
6348 {"http://google.com",Uri_CREATE_NO_CANONICALIZE
,PARSE_ROOTDOCUMENT
,0,"http://google.com/",S_OK
,FALSE
},
6349 {"zip://google.com/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
6350 {"file:///c:/testing/",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
6351 {"file://server/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
6352 {"zip:test/test",0,PARSE_ROOTDOCUMENT
,0,"",S_OK
,FALSE
},
6354 /* PARSE_DOCUMENT tests. */
6355 {"http://test@google.com/test?query#frag",0,PARSE_DOCUMENT
,0,"http://test@google.com/test?query",S_OK
,FALSE
},
6356 {"http:testing#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
6357 {"file:///c:/test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
6358 {"zip://google.com/#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
6359 {"zip:test#frag",0,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
6360 {"testing#frag",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOCUMENT
,0,"",S_OK
,FALSE
},
6362 /* PARSE_PATH_FROM_URL tests. */
6363 {"file:///c:/test.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\test.mp3",S_OK
,FALSE
},
6364 {"file:///c:/t<|>est.mp3",0,PARSE_PATH_FROM_URL
,0,"c:\\t<|>est.mp3",S_OK
,FALSE
},
6365 {"file:///c:/te%XX t/",0,PARSE_PATH_FROM_URL
,0,"c:\\te%XX t\\",S_OK
,FALSE
},
6366 {"file://server/test",0,PARSE_PATH_FROM_URL
,0,"\\\\server\\test",S_OK
,FALSE
},
6367 {"http://google.com/",0,PARSE_PATH_FROM_URL
,0,"",E_INVALIDARG
,FALSE
},
6369 /* PARSE_URL_FROM_PATH tests. */
6370 /* This function almost seems to useless (just returns the absolute uri). */
6371 {"test.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"test.com",S_OK
,FALSE
},
6372 {"/test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_URL_FROM_PATH
,0,"/test/test",S_OK
,FALSE
},
6373 {"file://c:\\test\\test",Uri_CREATE_FILE_USE_DOS_PATH
,PARSE_URL_FROM_PATH
,0,"file://c:\\test\\test",S_OK
,FALSE
},
6374 {"file:c:/test",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
6375 {"http:google.com/",0,PARSE_URL_FROM_PATH
,0,"",S_OK
,FALSE
},
6377 /* PARSE_SCHEMA tests. */
6378 {"http://google.com/test",0,PARSE_SCHEMA
,0,"http",S_OK
,FALSE
},
6379 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SCHEMA
,0,"",S_OK
,FALSE
},
6381 /* PARSE_SITE tests. */
6382 {"http://google.uk.com/",0,PARSE_SITE
,0,"google.uk.com",S_OK
,FALSE
},
6383 {"http://google.com.com/",0,PARSE_SITE
,0,"google.com.com",S_OK
,FALSE
},
6384 {"google.com",Uri_CREATE_ALLOW_RELATIVE
,PARSE_SITE
,0,"",S_OK
,FALSE
},
6385 {"file://server/test",0,PARSE_SITE
,0,"server",S_OK
,FALSE
},
6387 /* PARSE_DOMAIN tests. */
6388 {"http://google.com.uk/",0,PARSE_DOMAIN
,0,"google.com.uk",S_OK
,FALSE
},
6389 {"http://google.com.com/",0,PARSE_DOMAIN
,0,"com.com",S_OK
,FALSE
},
6390 {"test/test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
6391 {"file://server/test",0,PARSE_DOMAIN
,0,"",S_OK
,FALSE
},
6393 /* PARSE_LOCATION and PARSE_ANCHOR tests. */
6394 {"http://google.com/test#Test",0,PARSE_ANCHOR
,0,"#Test",S_OK
,FALSE
},
6395 {"http://google.com/test#Test",0,PARSE_LOCATION
,0,"#Test",S_OK
,FALSE
},
6396 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_ANCHOR
,0,"",S_OK
,FALSE
},
6397 {"test",Uri_CREATE_ALLOW_RELATIVE
,PARSE_LOCATION
,0,"",S_OK
,FALSE
}
6400 static inline LPWSTR
a2w(LPCSTR str
) {
6404 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
6405 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
6406 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
6412 static inline BOOL
heap_free(void* mem
) {
6413 return HeapFree(GetProcessHeap(), 0, mem
);
6416 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
6417 LPWSTR strAW
= a2w(strA
);
6418 DWORD ret
= lstrcmpW(strAW
, strB
);
6423 static inline ULONG
get_refcnt(IUri
*uri
) {
6425 return IUri_Release(uri
);
6428 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
6433 valueW
= a2w(prop
->value
);
6434 switch(prop
->property
) {
6435 case Uri_PROPERTY_FRAGMENT
:
6436 hr
= IUriBuilder_SetFragment(builder
, valueW
);
6439 ok(hr
== prop
->expected
,
6440 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6441 hr
, prop
->expected
, test_index
);
6444 ok(hr
== prop
->expected
,
6445 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6446 hr
, prop
->expected
, test_index
);
6449 case Uri_PROPERTY_HOST
:
6450 hr
= IUriBuilder_SetHost(builder
, valueW
);
6453 ok(hr
== prop
->expected
,
6454 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6455 hr
, prop
->expected
, test_index
);
6458 ok(hr
== prop
->expected
,
6459 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6460 hr
, prop
->expected
, test_index
);
6463 case Uri_PROPERTY_PASSWORD
:
6464 hr
= IUriBuilder_SetPassword(builder
, valueW
);
6467 ok(hr
== prop
->expected
,
6468 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6469 hr
, prop
->expected
, test_index
);
6472 ok(hr
== prop
->expected
,
6473 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6474 hr
, prop
->expected
, test_index
);
6477 case Uri_PROPERTY_PATH
:
6478 hr
= IUriBuilder_SetPath(builder
, valueW
);
6481 ok(hr
== prop
->expected
,
6482 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6483 hr
, prop
->expected
, test_index
);
6486 ok(hr
== prop
->expected
,
6487 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6488 hr
, prop
->expected
, test_index
);
6491 case Uri_PROPERTY_QUERY
:
6492 hr
= IUriBuilder_SetQuery(builder
, valueW
);
6495 ok(hr
== prop
->expected
,
6496 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6497 hr
, prop
->expected
, test_index
);
6500 ok(hr
== prop
->expected
,
6501 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6502 hr
, prop
->expected
, test_index
);
6505 case Uri_PROPERTY_SCHEME_NAME
:
6506 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
6509 ok(hr
== prop
->expected
,
6510 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6511 hr
, prop
->expected
, test_index
);
6514 ok(hr
== prop
->expected
,
6515 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6516 hr
, prop
->expected
, test_index
);
6519 case Uri_PROPERTY_USER_NAME
:
6520 hr
= IUriBuilder_SetUserName(builder
, valueW
);
6523 ok(hr
== prop
->expected
,
6524 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6525 hr
, prop
->expected
, test_index
);
6528 ok(hr
== prop
->expected
,
6529 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6530 hr
, prop
->expected
, test_index
);
6534 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
6541 * Simple tests to make sure the CreateUri function handles invalid flag combinations
6544 static void test_CreateUri_InvalidFlags(void) {
6547 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
6549 IUri
*uri
= (void*) 0xdeadbeef;
6551 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
6552 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
6553 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
6554 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
6558 static void test_CreateUri_InvalidArgs(void) {
6560 IUri
*uri
= (void*) 0xdeadbeef;
6562 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
6563 static const WCHAR emptyW
[] = {0};
6565 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
6566 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
6568 hr
= pCreateUri(NULL
, 0, 0, &uri
);
6569 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
6570 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
6572 uri
= (void*) 0xdeadbeef;
6573 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
6574 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
6575 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
6577 uri
= (void*) 0xdeadbeef;
6578 hr
= pCreateUri(emptyW
, 0, 0, &uri
);
6579 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
6580 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
6583 static void test_CreateUri_InvalidUri(void) {
6586 for(i
= 0; i
< sizeof(invalid_uri_tests
)/sizeof(invalid_uri_tests
[0]); ++i
) {
6587 invalid_uri test
= invalid_uri_tests
[i
];
6592 uriW
= a2w(test
.uri
);
6593 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
6596 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6597 hr
, E_INVALIDARG
, i
);
6600 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
6601 hr
, E_INVALIDARG
, i
);
6603 if(uri
) IUri_Release(uri
);
6609 static void test_IUri_GetPropertyBSTR(void) {
6614 /* Make sure GetPropertyBSTR handles invalid args correctly. */
6615 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
6616 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6618 BSTR received
= NULL
;
6620 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
6621 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6623 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
6624 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
6625 ok(hr
== S_OK
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6626 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
6627 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
6628 SysFreeString(received
);
6630 /* Make sure it handles the ZONE property correctly. */
6632 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
6633 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
6634 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
6635 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
6636 SysFreeString(received
);
6638 if(uri
) IUri_Release(uri
);
6640 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
6641 uri_properties test
= uri_tests
[i
];
6645 uriW
= a2w(test
.uri
);
6646 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
6647 if(test
.create_todo
) {
6649 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6650 hr
, test
.create_expected
, i
);
6653 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6654 hr
, test
.create_expected
, i
);
6660 /* Checks all the string properties of the uri. */
6661 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
6662 BSTR received
= NULL
;
6663 uri_str_property prop
= test
.str_props
[j
];
6665 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
6668 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6669 hr
, prop
.expected
, i
, j
);
6672 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6673 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6674 prop
.value
, wine_dbgstr_w(received
), i
, j
);
6677 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
6678 hr
, prop
.expected
, i
, j
);
6679 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6680 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
6681 prop
.value
, wine_dbgstr_w(received
), i
, j
);
6684 SysFreeString(received
);
6688 if(uri
) IUri_Release(uri
);
6694 static void test_IUri_GetPropertyDWORD(void) {
6699 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
6700 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6702 DWORD received
= 0xdeadbeef;
6704 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
6705 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
6707 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
6708 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
6709 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
6711 if(uri
) IUri_Release(uri
);
6713 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
6714 uri_properties test
= uri_tests
[i
];
6718 uriW
= a2w(test
.uri
);
6719 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
6720 if(test
.create_todo
) {
6722 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6723 hr
, test
.create_expected
, i
);
6726 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
6727 hr
, test
.create_expected
, i
);
6733 /* Checks all the DWORD properties of the uri. */
6734 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
6736 uri_dword_property prop
= test
.dword_props
[j
];
6738 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
6741 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6742 hr
, prop
.expected
, i
, j
);
6745 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6746 prop
.value
, received
, i
, j
);
6749 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
6750 hr
, prop
.expected
, i
, j
);
6751 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
6752 prop
.value
, received
, i
, j
);
6757 if(uri
) IUri_Release(uri
);
6763 /* Tests all the 'Get*' property functions which deal with strings. */
6764 static void test_IUri_GetStrProperties(void) {
6769 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
6770 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
6771 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6773 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
6774 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6776 hr
= IUri_GetAuthority(uri
, NULL
);
6777 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6779 hr
= IUri_GetDisplayUri(uri
, NULL
);
6780 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6782 hr
= IUri_GetDomain(uri
, NULL
);
6783 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6785 hr
= IUri_GetExtension(uri
, NULL
);
6786 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6788 hr
= IUri_GetFragment(uri
, NULL
);
6789 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6791 hr
= IUri_GetHost(uri
, NULL
);
6792 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6794 hr
= IUri_GetPassword(uri
, NULL
);
6795 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6797 hr
= IUri_GetPath(uri
, NULL
);
6798 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6800 hr
= IUri_GetPathAndQuery(uri
, NULL
);
6801 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6803 hr
= IUri_GetQuery(uri
, NULL
);
6804 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6806 hr
= IUri_GetRawUri(uri
, NULL
);
6807 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6809 hr
= IUri_GetSchemeName(uri
, NULL
);
6810 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6812 hr
= IUri_GetUserInfo(uri
, NULL
);
6813 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6815 hr
= IUri_GetUserName(uri
, NULL
);
6816 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
6818 if(uri
) IUri_Release(uri
);
6820 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
6821 uri_properties test
= uri_tests
[i
];
6825 uriW
= a2w(test
.uri
);
6826 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
6827 if(test
.create_todo
) {
6829 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6830 hr
, test
.create_expected
, i
);
6833 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6834 hr
, test
.create_expected
, i
);
6838 uri_str_property prop
;
6839 BSTR received
= NULL
;
6841 /* GetAbsoluteUri() tests. */
6842 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
6843 hr
= IUri_GetAbsoluteUri(uri
, &received
);
6846 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6847 hr
, prop
.expected
, i
);
6850 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6851 "Error: Expected %s but got %s on uri_tests[%d].\n",
6852 prop
.value
, wine_dbgstr_w(received
), i
);
6855 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6856 hr
, prop
.expected
, i
);
6857 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6858 "Error: Expected %s but got %s on uri_tests[%d].\n",
6859 prop
.value
, wine_dbgstr_w(received
), i
);
6861 SysFreeString(received
);
6864 /* GetAuthority() tests. */
6865 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
6866 hr
= IUri_GetAuthority(uri
, &received
);
6869 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6870 hr
, prop
.expected
, i
);
6873 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6874 prop
.value
, wine_dbgstr_w(received
), i
);
6877 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6878 hr
, prop
.expected
, i
);
6879 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6880 prop
.value
, wine_dbgstr_w(received
), i
);
6882 SysFreeString(received
);
6885 /* GetDisplayUri() tests. */
6886 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
6887 hr
= IUri_GetDisplayUri(uri
, &received
);
6890 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6891 hr
, prop
.expected
, i
);
6894 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6895 "Error: Expected %s but got %s on uri_test[%d].\n",
6896 prop
.value
, wine_dbgstr_w(received
), i
);
6899 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6900 hr
, prop
.expected
, i
);
6901 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
6902 "Error: Expected %s but got %s on uri_tests[%d].\n",
6903 prop
.value
, wine_dbgstr_w(received
), i
);
6905 SysFreeString(received
);
6908 /* GetDomain() tests. */
6909 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
6910 hr
= IUri_GetDomain(uri
, &received
);
6913 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6914 hr
, prop
.expected
, i
);
6917 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6918 prop
.value
, wine_dbgstr_w(received
), i
);
6921 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6922 hr
, prop
.expected
, i
);
6923 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6924 prop
.value
, wine_dbgstr_w(received
), i
);
6926 SysFreeString(received
);
6929 /* GetExtension() tests. */
6930 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
6931 hr
= IUri_GetExtension(uri
, &received
);
6934 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6935 hr
, prop
.expected
, i
);
6938 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6939 prop
.value
, wine_dbgstr_w(received
), i
);
6942 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6943 hr
, prop
.expected
, i
);
6944 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6945 prop
.value
, wine_dbgstr_w(received
), i
);
6947 SysFreeString(received
);
6950 /* GetFragment() tests. */
6951 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
6952 hr
= IUri_GetFragment(uri
, &received
);
6955 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6956 hr
, prop
.expected
, i
);
6959 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6960 prop
.value
, wine_dbgstr_w(received
), i
);
6963 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6964 hr
, prop
.expected
, i
);
6965 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6966 prop
.value
, wine_dbgstr_w(received
), i
);
6968 SysFreeString(received
);
6971 /* GetHost() tests. */
6972 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
6973 hr
= IUri_GetHost(uri
, &received
);
6976 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6977 hr
, prop
.expected
, i
);
6980 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6981 prop
.value
, wine_dbgstr_w(received
), i
);
6984 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6985 hr
, prop
.expected
, i
);
6986 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
6987 prop
.value
, wine_dbgstr_w(received
), i
);
6989 SysFreeString(received
);
6992 /* GetPassword() tests. */
6993 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
6994 hr
= IUri_GetPassword(uri
, &received
);
6997 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
6998 hr
, prop
.expected
, i
);
7001 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7002 prop
.value
, wine_dbgstr_w(received
), i
);
7005 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7006 hr
, prop
.expected
, i
);
7007 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7008 prop
.value
, wine_dbgstr_w(received
), i
);
7010 SysFreeString(received
);
7013 /* GetPath() tests. */
7014 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
7015 hr
= IUri_GetPath(uri
, &received
);
7018 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7019 hr
, prop
.expected
, i
);
7022 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7023 prop
.value
, wine_dbgstr_w(received
), i
);
7026 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7027 hr
, prop
.expected
, i
);
7028 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7029 prop
.value
, wine_dbgstr_w(received
), i
);
7031 SysFreeString(received
);
7034 /* GetPathAndQuery() tests. */
7035 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
7036 hr
= IUri_GetPathAndQuery(uri
, &received
);
7039 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7040 hr
, prop
.expected
, i
);
7043 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7044 prop
.value
, wine_dbgstr_w(received
), i
);
7047 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7048 hr
, prop
.expected
, i
);
7049 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7050 prop
.value
, wine_dbgstr_w(received
), i
);
7052 SysFreeString(received
);
7055 /* GetQuery() tests. */
7056 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
7057 hr
= IUri_GetQuery(uri
, &received
);
7060 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7061 hr
, prop
.expected
, i
);
7064 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7065 prop
.value
, wine_dbgstr_w(received
), i
);
7068 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7069 hr
, prop
.expected
, i
);
7070 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7071 prop
.value
, wine_dbgstr_w(received
), i
);
7073 SysFreeString(received
);
7076 /* GetRawUri() tests. */
7077 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
7078 hr
= IUri_GetRawUri(uri
, &received
);
7081 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7082 hr
, prop
.expected
, i
);
7085 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7086 prop
.value
, wine_dbgstr_w(received
), i
);
7089 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7090 hr
, prop
.expected
, i
);
7091 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7092 prop
.value
, wine_dbgstr_w(received
), i
);
7094 SysFreeString(received
);
7097 /* GetSchemeName() tests. */
7098 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
7099 hr
= IUri_GetSchemeName(uri
, &received
);
7102 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7103 hr
, prop
.expected
, i
);
7106 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7107 prop
.value
, wine_dbgstr_w(received
), i
);
7110 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7111 hr
, prop
.expected
, i
);
7112 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7113 prop
.value
, wine_dbgstr_w(received
), i
);
7115 SysFreeString(received
);
7118 /* GetUserInfo() tests. */
7119 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
7120 hr
= IUri_GetUserInfo(uri
, &received
);
7123 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7124 hr
, prop
.expected
, i
);
7127 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7128 prop
.value
, wine_dbgstr_w(received
), i
);
7131 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7132 hr
, prop
.expected
, i
);
7133 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7134 prop
.value
, wine_dbgstr_w(received
), i
);
7136 SysFreeString(received
);
7139 /* GetUserName() tests. */
7140 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
7141 hr
= IUri_GetUserName(uri
, &received
);
7144 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7145 hr
, prop
.expected
, i
);
7148 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7149 prop
.value
, wine_dbgstr_w(received
), i
);
7152 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7153 hr
, prop
.expected
, i
);
7154 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
7155 prop
.value
, wine_dbgstr_w(received
), i
);
7157 SysFreeString(received
);
7160 if(uri
) IUri_Release(uri
);
7166 static void test_IUri_GetDwordProperties(void) {
7171 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
7172 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7173 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7175 hr
= IUri_GetHostType(uri
, NULL
);
7176 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7178 hr
= IUri_GetPort(uri
, NULL
);
7179 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7181 hr
= IUri_GetScheme(uri
, NULL
);
7182 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7184 hr
= IUri_GetZone(uri
, NULL
);
7185 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7187 if(uri
) IUri_Release(uri
);
7189 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7190 uri_properties test
= uri_tests
[i
];
7194 uriW
= a2w(test
.uri
);
7195 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7196 if(test
.create_todo
) {
7198 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7199 hr
, test
.create_expected
, i
);
7202 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7203 hr
, test
.create_expected
, i
);
7207 uri_dword_property prop
;
7210 /* Assign an insane value so tests don't accidentally pass when
7213 received
= -9999999;
7215 /* GetHostType() tests. */
7216 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
7217 hr
= IUri_GetHostType(uri
, &received
);
7220 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7221 hr
, prop
.expected
, i
);
7224 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7227 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7228 hr
, prop
.expected
, i
);
7229 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7231 received
= -9999999;
7233 /* GetPort() tests. */
7234 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
7235 hr
= IUri_GetPort(uri
, &received
);
7238 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7239 hr
, prop
.expected
, i
);
7242 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7245 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7246 hr
, prop
.expected
, i
);
7247 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7249 received
= -9999999;
7251 /* GetScheme() tests. */
7252 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
7253 hr
= IUri_GetScheme(uri
, &received
);
7256 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7257 hr
, prop
.expected
, i
);
7260 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7263 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7264 hr
, prop
.expected
, i
);
7265 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7267 received
= -9999999;
7269 /* GetZone() tests. */
7270 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
7271 hr
= IUri_GetZone(uri
, &received
);
7274 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7275 hr
, prop
.expected
, i
);
7278 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7281 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7282 hr
, prop
.expected
, i
);
7283 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
7287 if(uri
) IUri_Release(uri
);
7293 static void test_IUri_GetPropertyLength(void) {
7298 /* Make sure it handles invalid args correctly. */
7299 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7300 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7302 DWORD received
= 0xdeadbeef;
7304 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
7305 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7307 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
7308 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7309 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
7311 if(uri
) IUri_Release(uri
);
7313 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7314 uri_properties test
= uri_tests
[i
];
7318 uriW
= a2w(test
.uri
);
7319 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7320 if(test
.create_todo
) {
7322 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
7323 hr
, test
.create_expected
, i
);
7326 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
7327 hr
, test
.create_expected
, i
);
7333 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
7334 DWORD expectedLen
, brokenLen
, receivedLen
;
7335 uri_str_property prop
= test
.str_props
[j
];
7337 expectedLen
= lstrlen(prop
.value
);
7338 brokenLen
= lstrlen(prop
.broken_value
);
7340 /* This won't be necessary once GetPropertyLength is implemented. */
7343 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
7346 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7347 hr
, prop
.expected
, i
, j
);
7350 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
7351 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7352 expectedLen
, receivedLen
, i
, j
);
7355 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
7356 hr
, prop
.expected
, i
, j
);
7357 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
7358 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
7359 expectedLen
, receivedLen
, i
, j
);
7364 if(uri
) IUri_Release(uri
);
7370 static DWORD
compute_expected_props(uri_properties
*test
)
7374 for(i
=Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_STRING_LAST
; i
++) {
7375 if(test
->str_props
[i
-Uri_PROPERTY_STRING_START
].expected
== S_OK
)
7379 for(i
=Uri_PROPERTY_DWORD_START
; i
<= Uri_PROPERTY_DWORD_LAST
; i
++) {
7380 if(test
->dword_props
[i
-Uri_PROPERTY_DWORD_START
].expected
== S_OK
)
7387 static void test_IUri_GetProperties(void) {
7392 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7393 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7395 hr
= IUri_GetProperties(uri
, NULL
);
7396 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7398 if(uri
) IUri_Release(uri
);
7400 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7401 uri_properties test
= uri_tests
[i
];
7405 uriW
= a2w(test
.uri
);
7406 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7407 if(test
.create_todo
) {
7409 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
7412 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
7416 DWORD received
= 0, expected_props
;
7419 hr
= IUri_GetProperties(uri
, &received
);
7420 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7422 expected_props
= compute_expected_props(&test
);
7424 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
7425 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
7426 if(expected_props
& (1 << j
))
7427 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
7429 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
7433 if(uri
) IUri_Release(uri
);
7439 static void test_IUri_HasProperty(void) {
7444 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7445 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7447 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
7448 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7450 if(uri
) IUri_Release(uri
);
7452 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
7453 uri_properties test
= uri_tests
[i
];
7457 uriW
= a2w(test
.uri
);
7459 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7460 if(test
.create_todo
) {
7462 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
7465 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
7469 DWORD expected_props
, j
;
7471 expected_props
= compute_expected_props(&test
);
7473 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
7474 /* Assign -1, then explicitly test for TRUE or FALSE later. */
7477 hr
= IUri_HasProperty(uri
, j
, &received
);
7478 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
7481 if(expected_props
& (1 << j
)) {
7482 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
7484 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
7489 if(uri
) IUri_Release(uri
);
7495 static void test_IUri_IsEqual(void) {
7502 /* Make sure IsEqual handles invalid args correctly. */
7503 hrA
= pCreateUri(http_urlW
, 0, 0, &uriA
);
7504 hrB
= pCreateUri(http_urlW
, 0, 0, &uriB
);
7505 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
7506 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrB
, S_OK
);
7507 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
7509 hrA
= IUri_IsEqual(uriA
, NULL
, &equal
);
7510 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
7511 ok(equal
== FALSE
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
7513 hrA
= IUri_IsEqual(uriA
, uriB
, NULL
);
7514 ok(hrA
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, E_POINTER
);
7516 if(uriA
) IUri_Release(uriA
);
7517 if(uriB
) IUri_Release(uriB
);
7519 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
7520 uri_equality test
= equality_tests
[i
];
7521 LPWSTR uriA_W
, uriB_W
;
7525 uriA_W
= a2w(test
.a
);
7526 uriB_W
= a2w(test
.b
);
7528 hrA
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
7529 if(test
.create_todo_a
) {
7531 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7535 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
7539 hrB
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
7540 if(test
.create_todo_b
) {
7542 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7546 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
7550 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
7553 hrA
= IUri_IsEqual(uriA
, uriB
, &equal
);
7556 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n",
7560 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
7563 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hrA
, S_OK
, i
);
7564 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
7567 if(uriA
) IUri_Release(uriA
);
7568 if(uriB
) IUri_Release(uriB
);
7575 static void test_CreateUriWithFragment_InvalidArgs(void) {
7577 IUri
*uri
= (void*) 0xdeadbeef;
7578 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
7580 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
7581 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7582 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
7584 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
7585 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7587 /* Original URI can't already contain a fragment component. */
7588 uri
= (void*) 0xdeadbeef;
7589 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
7590 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
7591 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
7594 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
7595 static void test_CreateUriWithFragment_InvalidFlags(void) {
7598 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
7600 IUri
*uri
= (void*) 0xdeadbeef;
7602 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
7603 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
7604 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
7605 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
7609 static void test_CreateUriWithFragment(void) {
7612 for(i
= 0; i
< sizeof(uri_fragment_tests
)/sizeof(uri_fragment_tests
[0]); ++i
) {
7616 uri_with_fragment test
= uri_fragment_tests
[i
];
7618 uriW
= a2w(test
.uri
);
7619 fragW
= a2w(test
.fragment
);
7621 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
7622 if(test
.expected_todo
) {
7624 ok(hr
== test
.create_expected
,
7625 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7626 hr
, test
.create_expected
, i
);
7629 ok(hr
== test
.create_expected
,
7630 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7631 hr
, test
.create_expected
, i
);
7634 BSTR received
= NULL
;
7636 hr
= IUri_GetAbsoluteUri(uri
, &received
);
7637 if(test
.expected_todo
) {
7640 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7644 ok(!strcmp_aw(test
.expected_uri
, received
),
7645 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7646 test
.expected_uri
, wine_dbgstr_w(received
), i
);
7649 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
7651 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
7652 test
.expected_uri
, wine_dbgstr_w(received
), i
);
7655 SysFreeString(received
);
7658 if(uri
) IUri_Release(uri
);
7664 static void test_CreateIUriBuilder(void) {
7666 IUriBuilder
*builder
= NULL
;
7669 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
7670 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
7673 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
7674 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
7675 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7677 ULONG cur_count
, orig_count
;
7679 orig_count
= get_refcnt(uri
);
7680 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
7681 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7682 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
7684 cur_count
= get_refcnt(uri
);
7685 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
7687 if(builder
) IUriBuilder_Release(builder
);
7688 cur_count
= get_refcnt(uri
);
7689 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
7691 if(uri
) IUri_Release(uri
);
7694 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
7699 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
7700 if(test
->uri_todo
) {
7702 ok(hr
== test
->uri_hres
,
7703 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7704 hr
, test
->uri_hres
, test_index
);
7707 ok(hr
== test
->uri_hres
,
7708 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7709 hr
, test
->uri_hres
, test_index
);
7715 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
7716 uri_builder_str_property prop
= test
->expected_str_props
[i
];
7717 BSTR received
= NULL
;
7719 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
7722 ok(hr
== prop
.result
,
7723 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7724 hr
, prop
.result
, test_index
, i
);
7727 ok(hr
== prop
.result
,
7728 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7729 hr
, prop
.result
, test_index
, i
);
7734 ok(!strcmp_aw(prop
.expected
, received
),
7735 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7736 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7739 ok(!strcmp_aw(prop
.expected
, received
),
7740 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7741 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7744 SysFreeString(received
);
7747 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
7748 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
7749 DWORD received
= -2;
7751 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7754 ok(hr
== prop
.result
,
7755 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7756 hr
, prop
.result
, test_index
, i
);
7759 ok(hr
== prop
.result
,
7760 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7761 hr
, prop
.result
, test_index
, i
);
7766 ok(received
== prop
.expected
,
7767 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7768 prop
.expected
, received
, test_index
, i
);
7771 ok(received
== prop
.expected
,
7772 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7773 prop
.expected
, received
, test_index
, i
);
7778 if(uri
) IUri_Release(uri
);
7781 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
7786 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
7787 if(test
->uri_simple_todo
) {
7789 ok(hr
== test
->uri_simple_hres
,
7790 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7791 hr
, test
->uri_simple_hres
, test_index
);
7794 ok(hr
== test
->uri_simple_hres
,
7795 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7796 hr
, test
->uri_simple_hres
, test_index
);
7802 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
7803 uri_builder_str_property prop
= test
->expected_str_props
[i
];
7804 BSTR received
= NULL
;
7806 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
7809 ok(hr
== prop
.result
,
7810 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7811 hr
, prop
.result
, test_index
, i
);
7814 ok(hr
== prop
.result
,
7815 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7816 hr
, prop
.result
, test_index
, i
);
7821 ok(!strcmp_aw(prop
.expected
, received
),
7822 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7823 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7826 ok(!strcmp_aw(prop
.expected
, received
),
7827 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7828 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7831 SysFreeString(received
);
7834 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
7835 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
7836 DWORD received
= -2;
7838 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7841 ok(hr
== prop
.result
,
7842 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7843 hr
, prop
.result
, test_index
, i
);
7846 ok(hr
== prop
.result
,
7847 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7848 hr
, prop
.result
, test_index
, i
);
7853 ok(received
== prop
.expected
,
7854 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7855 prop
.expected
, received
, test_index
, i
);
7858 ok(received
== prop
.expected
,
7859 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7860 prop
.expected
, received
, test_index
, i
);
7865 if(uri
) IUri_Release(uri
);
7868 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
7873 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
7874 test
->uri_with_encode_flags
, 0, &uri
);
7875 if(test
->uri_with_todo
) {
7877 ok(hr
== test
->uri_with_hres
,
7878 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7879 hr
, test
->uri_with_hres
, test_index
);
7882 ok(hr
== test
->uri_with_hres
,
7883 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
7884 hr
, test
->uri_with_hres
, test_index
);
7890 for(i
= 0; i
< sizeof(test
->expected_str_props
)/sizeof(test
->expected_str_props
[0]); ++i
) {
7891 uri_builder_str_property prop
= test
->expected_str_props
[i
];
7892 BSTR received
= NULL
;
7894 hr
= IUri_GetPropertyBSTR(uri
, i
, &received
, 0);
7897 ok(hr
== prop
.result
,
7898 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7899 hr
, prop
.result
, test_index
, i
);
7902 ok(hr
== prop
.result
,
7903 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_str_props[%d].\n",
7904 hr
, prop
.result
, test_index
, i
);
7909 ok(!strcmp_aw(prop
.expected
, received
),
7910 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7911 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7914 ok(!strcmp_aw(prop
.expected
, received
),
7915 "Error: Expected %s but got %s instead on uri_builder_tests[%d].expected_str_props[%d].\n",
7916 prop
.expected
, wine_dbgstr_w(received
), test_index
, i
);
7919 SysFreeString(received
);
7922 for(i
= 0; i
< sizeof(test
->expected_dword_props
)/sizeof(test
->expected_dword_props
[0]); ++i
) {
7923 uri_builder_dword_property prop
= test
->expected_dword_props
[i
];
7924 DWORD received
= -2;
7926 hr
= IUri_GetPropertyDWORD(uri
, i
+Uri_PROPERTY_DWORD_START
, &received
, 0);
7929 ok(hr
== prop
.result
,
7930 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7931 hr
, prop
.result
, test_index
, i
);
7934 ok(hr
== prop
.result
,
7935 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].expected_dword_props[%d].\n",
7936 hr
, prop
.result
, test_index
, i
);
7941 ok(received
== prop
.expected
,
7942 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7943 prop
.expected
, received
, test_index
, i
);
7946 ok(received
== prop
.expected
,
7947 "Error: Expected %d but got %d instead on uri_builder_tests[%d].expected_dword_props[%d].\n",
7948 prop
.expected
, received
, test_index
, i
);
7953 if(uri
) IUri_Release(uri
);
7956 static void test_IUriBuilder_CreateInvalidArgs(void) {
7957 IUriBuilder
*builder
;
7960 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
7961 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7963 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
7965 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
7966 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
7967 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
7969 uri
= (void*) 0xdeadbeef;
7970 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
7971 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
7972 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
7974 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
7975 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7978 uri
= (void*) 0xdeadbeef;
7979 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
7980 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
7982 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
7984 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
7985 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7988 uri
= (void*) 0xdeadbeef;
7989 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
7990 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
7992 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
7994 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
7995 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
7997 hr
= IUriBuilder_SetIUri(builder
, test
);
7998 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8000 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
8002 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8003 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8004 ok(uri
!= NULL
, "Error: The uri was NULL.\n");
8005 if(uri
) IUri_Release(uri
);
8008 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8009 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8011 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8012 if(uri
) IUri_Release(uri
);
8015 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
8016 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8018 ok(uri
!= NULL
, "Error: uri was NULL.\n");
8019 if(uri
) IUri_Release(uri
);
8021 hr
= IUriBuilder_SetFragment(builder
, NULL
);
8022 ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8024 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
8025 uri
= (void*) 0xdeadbeef;
8026 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8027 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8028 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
8030 uri
= (void*) 0xdeadbeef;
8031 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
8032 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
8034 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8036 uri
= (void*) 0xdeadbeef;
8037 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
8038 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
8040 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
8042 if(test
) IUri_Release(test
);
8044 if(builder
) IUriBuilder_Release(builder
);
8047 /* Tests invalid args to the "Get*" functions. */
8048 static void test_IUriBuilder_GetInvalidArgs(void) {
8049 IUriBuilder
*builder
= NULL
;
8052 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
8053 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
8055 LPCWSTR received
= (void*) 0xdeadbeef;
8056 DWORD len
= -1, port
= -1;
8059 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
8060 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8062 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
8063 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8065 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8066 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
8067 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
8069 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8071 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
8072 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8074 received
= (void*) 0xdeadbeef;
8075 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
8076 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8078 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8080 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
8081 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
8083 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8085 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
8086 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8088 received
= (void*) 0xdeadbeef;
8089 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
8090 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8092 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8094 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
8095 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
8097 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8099 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
8100 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8102 received
= (void*) 0xdeadbeef;
8103 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
8104 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8106 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8108 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
8109 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
8111 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8113 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
8114 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8116 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
8117 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8119 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
8120 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
8121 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
8123 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
8125 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
8126 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8128 received
= (void*) 0xdeadbeef;
8129 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
8130 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8132 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8134 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
8135 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
8137 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8139 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
8140 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8142 received
= (void*) 0xdeadbeef;
8143 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
8144 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8146 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8148 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
8149 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
8151 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8153 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
8154 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8156 received
= (void*) 0xdeadbeef;
8157 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
8158 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8160 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
8162 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
8163 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
8165 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
8167 if(builder
) IUriBuilder_Release(builder
);
8170 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
8174 LPCWSTR received
= NULL
;
8176 const uri_builder_property
*prop
= NULL
;
8178 /* Check if the property was set earlier. */
8179 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8180 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
8181 prop
= &(test
->properties
[i
]);
8185 /* Use expected_value unless it's NULL, then use value. */
8186 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8187 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
8190 ok(hr
== (expected
? S_OK
: S_FALSE
),
8191 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8192 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8196 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8197 expected
, wine_dbgstr_w(received
), test_index
);
8200 ok(lstrlen(expected
) == len
,
8201 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8202 lstrlen(expected
), len
, test_index
);
8206 ok(hr
== (expected
? S_OK
: S_FALSE
),
8207 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8208 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8209 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8210 expected
, wine_dbgstr_w(received
), test_index
);
8211 ok(lstrlen(expected
) == len
,
8212 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8213 lstrlen(expected
), len
, test_index
);
8216 /* The property wasn't set earlier, so it should return whatever
8217 * the base IUri contains (if anything).
8220 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8222 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8223 hr
, S_OK
, test_index
);
8226 received
= (void*) 0xdeadbeef;
8229 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
8231 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8232 hr
, S_FALSE
, test_index
);
8234 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8236 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8237 received
, test_index
);
8240 BOOL has_prop
= FALSE
;
8241 BSTR expected
= NULL
;
8243 hr
= IUri_GetFragment(uri
, &expected
);
8245 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8247 has_prop
= hr
== S_OK
;
8249 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
8252 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8253 hr
, S_OK
, test_index
);
8255 ok(!lstrcmpW(expected
, received
),
8256 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8257 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8258 ok(lstrlenW(expected
) == len
,
8259 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8260 lstrlenW(expected
), len
, test_index
);
8264 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8265 hr
, S_FALSE
, test_index
);
8267 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8268 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8272 SysFreeString(expected
);
8275 if(uri
) IUri_Release(uri
);
8279 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
8283 LPCWSTR received
= NULL
;
8285 const uri_builder_property
*prop
= NULL
;
8287 /* Check if the property was set earlier. */
8288 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8289 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
8290 prop
= &(test
->properties
[i
]);
8294 /* Use expected_value unless it's NULL, then use value. */
8295 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8296 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
8299 ok(hr
== (expected
? S_OK
: S_FALSE
),
8300 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8301 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8305 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8306 expected
, wine_dbgstr_w(received
), test_index
);
8309 ok(lstrlen(expected
) == len
,
8310 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8311 lstrlen(expected
), len
, test_index
);
8315 ok(hr
== (expected
? S_OK
: S_FALSE
),
8316 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8317 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8318 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8319 expected
, wine_dbgstr_w(received
), test_index
);
8320 ok(lstrlen(expected
) == len
,
8321 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8322 lstrlen(expected
), len
, test_index
);
8325 /* The property wasn't set earlier, so it should return whatever
8326 * the base IUri contains (if anything).
8329 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8331 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8332 hr
, S_OK
, test_index
);
8335 received
= (void*) 0xdeadbeef;
8338 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
8340 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8341 hr
, S_FALSE
, test_index
);
8343 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8345 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8346 received
, test_index
);
8349 BOOL has_prop
= FALSE
;
8350 BSTR expected
= NULL
;
8352 hr
= IUri_GetHost(uri
, &expected
);
8354 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8356 has_prop
= hr
== S_OK
;
8358 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
8361 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8362 hr
, S_OK
, test_index
);
8364 ok(!lstrcmpW(expected
, received
),
8365 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8366 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8367 ok(lstrlenW(expected
) == len
,
8368 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8369 lstrlenW(expected
), len
, test_index
);
8373 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8374 hr
, S_FALSE
, test_index
);
8376 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8377 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8381 SysFreeString(expected
);
8384 if(uri
) IUri_Release(uri
);
8388 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
8392 LPCWSTR received
= NULL
;
8394 const uri_builder_property
*prop
= NULL
;
8396 /* Check if the property was set earlier. */
8397 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8398 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
8399 prop
= &(test
->properties
[i
]);
8403 /* Use expected_value unless it's NULL, then use value. */
8404 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8405 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
8408 ok(hr
== (expected
? S_OK
: S_FALSE
),
8409 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8410 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8414 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8415 expected
, wine_dbgstr_w(received
), test_index
);
8418 ok(lstrlen(expected
) == len
,
8419 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8420 lstrlen(expected
), len
, test_index
);
8424 ok(hr
== (expected
? S_OK
: S_FALSE
),
8425 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8426 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8427 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8428 expected
, wine_dbgstr_w(received
), test_index
);
8429 ok(lstrlen(expected
) == len
,
8430 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8431 lstrlen(expected
), len
, test_index
);
8434 /* The property wasn't set earlier, so it should return whatever
8435 * the base IUri contains (if anything).
8438 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8440 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8441 hr
, S_OK
, test_index
);
8444 received
= (void*) 0xdeadbeef;
8447 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
8449 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8450 hr
, S_FALSE
, test_index
);
8452 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8454 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8455 received
, test_index
);
8458 BOOL has_prop
= FALSE
;
8459 BSTR expected
= NULL
;
8461 hr
= IUri_GetPassword(uri
, &expected
);
8463 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8465 has_prop
= hr
== S_OK
;
8467 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
8470 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8471 hr
, S_OK
, test_index
);
8473 ok(!lstrcmpW(expected
, received
),
8474 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8475 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8476 ok(lstrlenW(expected
) == len
,
8477 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8478 lstrlenW(expected
), len
, test_index
);
8482 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8483 hr
, S_FALSE
, test_index
);
8485 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8486 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8490 SysFreeString(expected
);
8493 if(uri
) IUri_Release(uri
);
8497 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
8501 LPCWSTR received
= NULL
;
8503 const uri_builder_property
*prop
= NULL
;
8505 /* Check if the property was set earlier. */
8506 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8507 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
8508 prop
= &(test
->properties
[i
]);
8512 /* Use expected_value unless it's NULL, then use value. */
8513 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8514 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
8517 ok(hr
== (expected
? S_OK
: S_FALSE
),
8518 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8519 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8523 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8524 expected
, wine_dbgstr_w(received
), test_index
);
8527 ok(lstrlen(expected
) == len
,
8528 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8529 lstrlen(expected
), len
, test_index
);
8533 ok(hr
== (expected
? S_OK
: S_FALSE
),
8534 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8535 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8536 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8537 expected
, wine_dbgstr_w(received
), test_index
);
8538 ok(lstrlen(expected
) == len
,
8539 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8540 lstrlen(expected
), len
, test_index
);
8543 /* The property wasn't set earlier, so it should return whatever
8544 * the base IUri contains (if anything).
8547 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8549 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8550 hr
, S_OK
, test_index
);
8553 received
= (void*) 0xdeadbeef;
8556 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
8558 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8559 hr
, S_FALSE
, test_index
);
8561 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8563 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8564 received
, test_index
);
8567 BOOL has_prop
= FALSE
;
8568 BSTR expected
= NULL
;
8570 hr
= IUri_GetPath(uri
, &expected
);
8572 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8574 has_prop
= hr
== S_OK
;
8576 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
8579 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8580 hr
, S_OK
, test_index
);
8582 ok(!lstrcmpW(expected
, received
),
8583 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8584 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8585 ok(lstrlenW(expected
) == len
,
8586 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8587 lstrlenW(expected
), len
, test_index
);
8591 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8592 hr
, S_FALSE
, test_index
);
8594 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8595 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8599 SysFreeString(expected
);
8602 if(uri
) IUri_Release(uri
);
8606 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
8609 BOOL has_port
= FALSE
;
8610 DWORD received
= -1;
8612 if(test
->port_prop
.change
) {
8613 DWORD expected
= test
->port_prop
.value
;
8615 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
8616 if(test
->port_prop
.todo
) {
8619 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8620 hr
, S_OK
, test_index
);
8624 ok(has_port
== test
->port_prop
.set
,
8625 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
8626 test
->port_prop
.set
, has_port
, test_index
);
8629 ok(received
== expected
,
8630 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8631 expected
, received
, test_index
);
8636 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8637 hr
, S_OK
, test_index
);
8638 ok(has_port
== test
->port_prop
.set
,
8639 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8640 test
->port_prop
.set
, has_port
, test_index
);
8641 ok(received
== test
->port_prop
.value
,
8642 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
8643 test
->port_prop
.value
, received
, test_index
);
8648 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8650 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8651 hr
, S_OK
, test_index
);
8654 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
8656 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8657 hr
, S_OK
, test_index
);
8659 ok(has_port
== FALSE
,
8660 "Error: Expected has_port to be FALSE, but was %d instead on uri_builder_tests[%d].\n",
8661 has_port
, test_index
);
8662 ok(!received
, "Error: Expected received to be 0, but was %d instead on uri_builder_tests[%d].\n",
8663 received
, test_index
);
8668 hr
= IUri_GetPort(uri
, &expected
);
8670 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8673 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
8675 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8676 hr
, S_OK
, test_index
);
8679 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
8681 ok(received
== expected
,
8682 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
8683 expected
, received
, test_index
);
8687 if(uri
) IUri_Release(uri
);
8691 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
8695 LPCWSTR received
= NULL
;
8697 const uri_builder_property
*prop
= NULL
;
8699 /* Check if the property was set earlier. */
8700 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8701 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
8702 prop
= &(test
->properties
[i
]);
8706 /* Use expected_value unless it's NULL, then use value. */
8707 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8708 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
8711 ok(hr
== (expected
? S_OK
: S_FALSE
),
8712 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8713 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8717 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8718 expected
, wine_dbgstr_w(received
), test_index
);
8721 ok(lstrlen(expected
) == len
,
8722 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8723 lstrlen(expected
), len
, test_index
);
8727 ok(hr
== (expected
? S_OK
: S_FALSE
),
8728 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8729 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8730 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8731 expected
, wine_dbgstr_w(received
), test_index
);
8732 ok(lstrlen(expected
) == len
,
8733 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8734 lstrlen(expected
), len
, test_index
);
8737 /* The property wasn't set earlier, so it should return whatever
8738 * the base IUri contains (if anything).
8741 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8743 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8744 hr
, S_OK
, test_index
);
8747 received
= (void*) 0xdeadbeef;
8750 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
8752 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8753 hr
, S_FALSE
, test_index
);
8755 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8757 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8758 received
, test_index
);
8761 BOOL has_prop
= FALSE
;
8762 BSTR expected
= NULL
;
8764 hr
= IUri_GetQuery(uri
, &expected
);
8766 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8768 has_prop
= hr
== S_OK
;
8770 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
8773 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8774 hr
, S_OK
, test_index
);
8776 ok(!lstrcmpW(expected
, received
),
8777 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8778 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8779 ok(lstrlenW(expected
) == len
,
8780 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8781 lstrlenW(expected
), len
, test_index
);
8785 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8786 hr
, S_FALSE
, test_index
);
8788 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8789 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8793 SysFreeString(expected
);
8796 if(uri
) IUri_Release(uri
);
8800 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
8804 LPCWSTR received
= NULL
;
8806 const uri_builder_property
*prop
= NULL
;
8808 /* Check if the property was set earlier. */
8809 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8810 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
8811 prop
= &(test
->properties
[i
]);
8815 /* Use expected_value unless it's NULL, then use value. */
8816 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8817 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
8820 ok(hr
== (expected
? S_OK
: S_FALSE
),
8821 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8822 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8826 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8827 expected
, wine_dbgstr_w(received
), test_index
);
8830 ok(lstrlen(expected
) == len
,
8831 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8832 lstrlen(expected
), len
, test_index
);
8836 ok(hr
== (expected
? S_OK
: S_FALSE
),
8837 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8838 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8839 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8840 expected
, wine_dbgstr_w(received
), test_index
);
8841 ok(lstrlen(expected
) == len
,
8842 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8843 lstrlen(expected
), len
, test_index
);
8846 /* The property wasn't set earlier, so it should return whatever
8847 * the base IUri contains (if anything).
8850 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8852 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8853 hr
, S_OK
, test_index
);
8856 received
= (void*) 0xdeadbeef;
8859 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
8861 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8862 hr
, S_FALSE
, test_index
);
8864 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8866 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8867 received
, test_index
);
8870 BOOL has_prop
= FALSE
;
8871 BSTR expected
= NULL
;
8873 hr
= IUri_GetSchemeName(uri
, &expected
);
8875 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8877 has_prop
= hr
== S_OK
;
8879 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
8882 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8883 hr
, S_OK
, test_index
);
8885 ok(!lstrcmpW(expected
, received
),
8886 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8887 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8888 ok(lstrlenW(expected
) == len
,
8889 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8890 lstrlenW(expected
), len
, test_index
);
8894 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8895 hr
, S_FALSE
, test_index
);
8897 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
8898 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
8902 SysFreeString(expected
);
8905 if(uri
) IUri_Release(uri
);
8909 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
8913 LPCWSTR received
= NULL
;
8915 const uri_builder_property
*prop
= NULL
;
8917 /* Check if the property was set earlier. */
8918 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
8919 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
8920 prop
= &(test
->properties
[i
]);
8923 if(prop
&& prop
->value
&& *prop
->value
) {
8924 /* Use expected_value unless it's NULL, then use value. */
8925 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
8926 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
8929 ok(hr
== (expected
? S_OK
: S_FALSE
),
8930 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8931 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8935 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8936 expected
, wine_dbgstr_w(received
), test_index
);
8939 ok(lstrlen(expected
) == len
,
8940 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8941 lstrlen(expected
), len
, test_index
);
8945 ok(hr
== (expected
? S_OK
: S_FALSE
),
8946 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8947 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
8948 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
8949 expected
, wine_dbgstr_w(received
), test_index
);
8950 ok(lstrlen(expected
) == len
,
8951 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8952 lstrlen(expected
), len
, test_index
);
8955 /* The property wasn't set earlier, so it should return whatever
8956 * the base IUri contains (if anything).
8959 hr
= IUriBuilder_GetIUri(builder
, &uri
);
8961 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8962 hr
, S_OK
, test_index
);
8965 received
= (void*) 0xdeadbeef;
8968 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
8970 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8971 hr
, S_FALSE
, test_index
);
8973 ok(!len
, "Error: Expected len to be 0, but was %d instead on uri_builder_tests[%d].\n",
8975 ok(!received
, "Error: Expected received to be NULL, but was %p instead on uri_builder_tests[%d].\n",
8976 received
, test_index
);
8979 BSTR expected
= NULL
;
8980 BOOL has_prop
= FALSE
;
8982 hr
= IUri_GetUserName(uri
, &expected
);
8984 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
8986 has_prop
= hr
== S_OK
;
8988 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
8991 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
8992 hr
, S_OK
, test_index
);
8994 ok(!lstrcmpW(expected
, received
),
8995 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
8996 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
8997 ok(lstrlenW(expected
) == len
,
8998 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
8999 lstrlenW(expected
), len
, test_index
);
9003 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9004 hr
, S_FALSE
, test_index
);
9006 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
9007 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
9011 SysFreeString(expected
);
9014 if(uri
) IUri_Release(uri
);
9018 /* Tests IUriBuilder functions. */
9019 static void test_IUriBuilder(void) {
9021 IUriBuilder
*builder
;
9024 for(i
= 0; i
< sizeof(uri_builder_tests
)/sizeof(uri_builder_tests
[0]); ++i
) {
9026 uri_builder_test test
= uri_builder_tests
[i
];
9030 uriW
= a2w(test
.uri
);
9031 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
9032 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9034 if(FAILED(hr
)) continue;
9036 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9037 if(test
.create_builder_todo
) {
9039 ok(hr
== test
.create_builder_expected
,
9040 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9041 hr
, test
.create_builder_expected
, i
);
9044 ok(hr
== test
.create_builder_expected
,
9045 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9046 hr
, test
.create_builder_expected
, i
);
9050 BOOL modified
= FALSE
, received
= FALSE
;
9052 /* Perform all the string property changes. */
9053 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
9054 uri_builder_property prop
= test
.properties
[j
];
9056 change_property(builder
, &prop
, i
);
9057 if(prop
.property
!= Uri_PROPERTY_SCHEME_NAME
&&
9058 prop
.property
!= Uri_PROPERTY_HOST
)
9060 else if(prop
.value
&& *prop
.value
)
9062 else if(prop
.value
&& !*prop
.value
&& prop
.property
== Uri_PROPERTY_HOST
)
9063 /* Host name property can't be NULL, but it can be empty. */
9068 if(test
.port_prop
.change
) {
9069 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
9071 if(test
.port_prop
.todo
) {
9073 ok(hr
== test
.port_prop
.expected
,
9074 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9075 hr
, test
.port_prop
.expected
, i
);
9078 ok(hr
== test
.port_prop
.expected
,
9079 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9080 hr
, test
.port_prop
.expected
, i
);
9084 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9086 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
9089 ok(received
== modified
,
9090 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
9091 modified
, received
, i
);
9093 /* Test the "Get*" functions. */
9094 test_IUriBuilder_GetFragment(builder
, &test
, i
);
9095 test_IUriBuilder_GetHost(builder
, &test
, i
);
9096 test_IUriBuilder_GetPassword(builder
, &test
, i
);
9097 test_IUriBuilder_GetPath(builder
, &test
, i
);
9098 test_IUriBuilder_GetPort(builder
, &test
, i
);
9099 test_IUriBuilder_GetQuery(builder
, &test
, i
);
9100 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
9101 test_IUriBuilder_GetUserName(builder
, &test
, i
);
9103 test_IUriBuilder_CreateUri(builder
, &test
, i
);
9104 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
9105 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
9107 if(builder
) IUriBuilder_Release(builder
);
9108 if(uri
) IUri_Release(uri
);
9113 static void test_IUriBuilder_HasBeenModified(void) {
9115 IUriBuilder
*builder
= NULL
;
9117 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9118 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9120 static const WCHAR hostW
[] = {'g','o','o','g','l','e','.','c','o','m',0};
9124 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
9125 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9128 hr
= IUriBuilder_SetHost(builder
, hostW
);
9129 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
9132 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9133 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9136 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9138 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9139 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9144 hr
= IUriBuilder_SetIUri(builder
, uri
);
9145 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
9148 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9149 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9152 ok(received
== FALSE
, "Error: Expected received to be FALSE.\n");
9154 /* Test what happens with you call SetIUri with the same IUri again. */
9155 hr
= IUriBuilder_SetHost(builder
, hostW
);
9156 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9158 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9159 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9162 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9164 hr
= IUriBuilder_SetIUri(builder
, uri
);
9165 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9167 /* IUriBuilder already had 'uri' as it's IUri property and so Windows doesn't
9168 * reset any of the changes that were made to the IUriBuilder.
9170 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9171 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9173 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9175 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9176 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9178 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9179 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9180 ok(len
== lstrlenW(hostW
), "Error: Expected len to be %d, but was %d instead.\n",
9181 lstrlenW(hostW
), len
);
9184 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9185 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9187 hr
= IUriBuilder_SetHost(builder
, hostW
);
9188 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9189 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9190 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9193 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9195 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9196 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%09x.\n", hr
, S_OK
);
9198 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
9199 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
9202 ok(received
== TRUE
, "Error: Expected received to be TRUE.\n");
9204 hr
= IUriBuilder_GetHost(builder
, &len
, &prop
);
9205 ok(hr
== S_OK
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9207 ok(!lstrcmpW(prop
, hostW
), "Error: Expected %s but got %s instead.\n",
9208 wine_dbgstr_w(hostW
), wine_dbgstr_w(prop
));
9209 ok(len
== lstrlenW(hostW
), "Error: Expected len to %d, but was %d instead.\n",
9210 lstrlenW(hostW
), len
);
9213 if(uri
) IUri_Release(uri
);
9215 if(builder
) IUriBuilder_Release(builder
);
9218 /* Test IUriBuilder {Get,Set}IUri functions. */
9219 static void test_IUriBuilder_IUriProperty(void) {
9220 IUriBuilder
*builder
= NULL
;
9223 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9224 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9228 hr
= IUriBuilder_GetIUri(builder
, NULL
);
9229 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
9232 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9235 ULONG cur_count
, orig_count
;
9237 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
9238 orig_count
= get_refcnt(uri
);
9239 hr
= IUriBuilder_SetIUri(builder
, uri
);
9240 cur_count
= get_refcnt(uri
);
9242 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9243 orig_count
+1, cur_count
);
9245 hr
= IUriBuilder_SetIUri(builder
, NULL
);
9246 cur_count
= get_refcnt(uri
);
9248 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9249 orig_count
, cur_count
);
9251 /* CreateUri* functions will return back the same IUri if nothing has changed. */
9252 hr
= IUriBuilder_SetIUri(builder
, uri
);
9253 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9254 orig_count
= get_refcnt(uri
);
9256 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &test
);
9257 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9259 cur_count
= get_refcnt(uri
);
9260 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9261 orig_count
+1, cur_count
);
9262 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n",
9265 if(test
) IUri_Release(test
);
9268 hr
= IUriBuilder_CreateUri(builder
, -1, 0, 0, &test
);
9269 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9271 cur_count
= get_refcnt(uri
);
9272 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9273 orig_count
+1, cur_count
);
9274 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
9276 if(test
) IUri_Release(test
);
9278 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9282 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, &test
);
9283 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9285 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
9287 if(test
) IUri_Release(test
);
9289 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9290 * explicitly set (because it's a default flags).
9293 hr
= IUriBuilder_CreateUri(builder
, Uri_CREATE_CANONICALIZE
, 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
);
9304 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &test
);
9305 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9307 cur_count
= get_refcnt(uri
);
9308 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9309 orig_count
+1, cur_count
);
9310 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
9312 if(test
) IUri_Release(test
);
9315 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &test
);
9316 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
9319 cur_count
= get_refcnt(uri
);
9320 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
9321 orig_count
+1, cur_count
);
9322 ok(test
== uri
, "Error: Expected test to be %p, but was %p instead.\n", uri
, test
);
9324 if(test
) IUri_Release(test
);
9326 /* Doesn't return the same IUri, if the flag combination is different then the one that created
9330 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_ALLOW_RELATIVE
, 0, 0, 0, &test
);
9331 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9333 ok(test
!= uri
, "Error: Wasn't expecting 'test' to be 'uri'\n");
9335 if(test
) IUri_Release(test
);
9337 /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
9338 * explicitly set (because it's a default flags).
9341 hr
= IUriBuilder_CreateUriWithFlags(builder
, Uri_CREATE_CANONICALIZE
, 0, 0, 0, &test
);
9342 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
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 if(uri
) IUri_Release(uri
);
9353 if(builder
) IUriBuilder_Release(builder
);
9356 static void test_IUriBuilder_RemoveProperties(void) {
9357 IUriBuilder
*builder
= NULL
;
9361 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
9362 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9364 /* Properties that can't be removed. */
9365 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
9366 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
9368 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
9369 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
9370 if((i
<< 1) & invalid
) {
9371 ok(hr
== E_INVALIDARG
,
9372 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9373 hr
, E_INVALIDARG
, i
);
9376 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
9381 /* Also doesn't accept anything that's outside the range of the
9384 hr
= IUriBuilder_RemoveProperties(builder
, (Uri_PROPERTY_DWORD_LAST
+1) << 1);
9385 ok(hr
== E_INVALIDARG
, "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x.\n",
9388 if(builder
) IUriBuilder_Release(builder
);
9390 for(i
= 0; i
< sizeof(uri_builder_remove_tests
)/sizeof(uri_builder_remove_tests
[0]); ++i
) {
9391 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
9395 uriW
= a2w(test
.uri
);
9396 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
9400 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9401 if(test
.create_builder_todo
) {
9403 ok(hr
== test
.create_builder_expected
,
9404 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9405 hr
, test
.create_builder_expected
, i
);
9408 ok(hr
== test
.create_builder_expected
,
9409 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9410 hr
, test
.create_builder_expected
, i
);
9413 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
9414 if(test
.remove_todo
) {
9416 ok(hr
== test
.remove_expected
,
9417 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
9418 hr
, test
.remove_expected
, i
);
9421 ok(hr
== test
.remove_expected
,
9422 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
9423 hr
, test
.remove_expected
, i
);
9426 IUri
*result
= NULL
;
9428 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
9429 if(test
.expected_todo
) {
9431 ok(hr
== test
.expected_hres
,
9432 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9433 hr
, test
.expected_hres
, i
);
9436 ok(hr
== test
.expected_hres
,
9437 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
9438 hr
, test
.expected_hres
, i
);
9441 BSTR received
= NULL
;
9443 hr
= IUri_GetAbsoluteUri(result
, &received
);
9444 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
9445 ok(!strcmp_aw(test
.expected_uri
, received
),
9446 "Error: Expected %s but got %s instead on test %d.\n",
9447 test
.expected_uri
, wine_dbgstr_w(received
), i
);
9448 SysFreeString(received
);
9450 if(result
) IUri_Release(result
);
9453 if(builder
) IUriBuilder_Release(builder
);
9455 if(uri
) IUri_Release(uri
);
9460 static void test_IUriBuilder_Misc(void) {
9464 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9466 IUriBuilder
*builder
;
9468 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
9469 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9474 hr
= IUriBuilder_GetPort(builder
, &has
, &port
);
9475 ok(hr
== S_OK
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9477 /* 'has' will be set to FALSE, even though uri had a port. */
9478 ok(has
== FALSE
, "Error: Expected 'has' to be FALSE, was %d instead.\n", has
);
9479 /* Still sets 'port' to 80. */
9480 ok(port
== 80, "Error: Expected the port to be 80, but, was %d instead.\n", port
);
9483 if(builder
) IUriBuilder_Release(builder
);
9485 if(uri
) IUri_Release(uri
);
9488 static void test_IUriBuilderFactory(void) {
9491 IUriBuilderFactory
*factory
;
9492 IUriBuilder
*builder
;
9494 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
9495 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
9498 hr
= IUri_QueryInterface(uri
, &IID_IUriBuilderFactory
, (void**)&factory
);
9499 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x.\n", hr
);
9500 ok(factory
!= NULL
, "Error: Expected 'factory' to not be NULL.\n");
9503 builder
= (void*) 0xdeadbeef;
9504 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 10, 0, &builder
);
9505 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9507 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
9509 builder
= (void*) 0xdeadbeef;
9510 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 10, &builder
);
9511 ok(hr
== E_INVALIDARG
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9513 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
9515 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, NULL
);
9516 ok(hr
== E_POINTER
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9520 hr
= IUriBuilderFactory_CreateIUriBuilder(factory
, 0, 0, &builder
);
9521 ok(hr
== S_OK
, "Error: CreateInitializedIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9524 IUri
*tmp
= (void*) 0xdeadbeef;
9528 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
9529 ok(hr
== S_OK
, "Error: GetIUri returned 0x%08x, expected 0x%08x.\n",
9531 ok(!tmp
, "Error: Expected 'tmp' to be NULL, but was %p instead.\n", tmp
);
9533 hr
= IUriBuilder_GetHost(builder
, &result_len
, &result
);
9534 ok(hr
== S_FALSE
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n",
9537 if(builder
) IUriBuilder_Release(builder
);
9539 builder
= (void*) 0xdeadbeef;
9540 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 10, 0, &builder
);
9541 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9543 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
9545 builder
= (void*) 0xdeadbeef;
9546 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 10, &builder
);
9547 ok(hr
== E_INVALIDARG
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9549 ok(!builder
, "Error: Expected 'builder' to be NULL, but was %p.\n", builder
);
9551 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, NULL
);
9552 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9556 hr
= IUriBuilderFactory_CreateInitializedIUriBuilder(factory
, 0, 0, &builder
);
9557 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n",
9562 hr
= IUriBuilder_GetIUri(builder
, &tmp
);
9563 ok(hr
== S_OK
, "Error: GetIUri return 0x%08x, expected 0x%08x.\n",
9565 ok(tmp
== uri
, "Error: Expected tmp to be %p, but was %p.\n", uri
, tmp
);
9566 if(uri
) IUri_Release(uri
);
9568 if(builder
) IUriBuilder_Release(builder
);
9570 if(factory
) IUriBuilderFactory_Release(factory
);
9572 if(uri
) IUri_Release(uri
);
9575 static void test_CoInternetCombineIUri(void) {
9577 IUri
*base
, *relative
, *result
;
9581 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
9582 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
9584 result
= (void*) 0xdeadbeef;
9585 hr
= pCoInternetCombineIUri(base
, NULL
, 0, &result
, 0);
9586 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
9587 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
9591 hr
= pCreateUri(http_urlW
, 0, 0, &relative
);
9592 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x.\n", hr
);
9594 result
= (void*) 0xdeadbeef;
9595 hr
= pCoInternetCombineIUri(NULL
, relative
, 0, &result
, 0);
9596 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
9597 ok(!result
, "Error: Expected 'result' to be NULL, was %p.\n", result
);
9600 hr
= pCoInternetCombineIUri(base
, relative
, 0, NULL
, 0);
9601 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
9603 if(base
) IUri_Release(base
);
9604 if(relative
) IUri_Release(relative
);
9606 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
9607 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
9609 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
9610 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
9612 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
9614 hr
= pCreateUri(relativeW
, uri_combine_tests
[i
].relative_create_flags
, 0, &relative
);
9615 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, got 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
9619 hr
= pCoInternetCombineIUri(base
, relative
, uri_combine_tests
[i
].combine_flags
, &result
, 0);
9620 if(uri_combine_tests
[i
].todo
) {
9622 ok(hr
== uri_combine_tests
[i
].expected
,
9623 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9624 hr
, uri_combine_tests
[i
].expected
, i
);
9627 ok(hr
== uri_combine_tests
[i
].expected
,
9628 "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9629 hr
, uri_combine_tests
[i
]. expected
, i
);
9634 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
9635 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
9638 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
9641 ok(hr
== prop
.expected
,
9642 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9643 hr
, prop
.expected
, i
, j
);
9646 ok(!strcmp_aw(prop
.value
, received
) ||
9647 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
9648 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9649 prop
.value
, wine_dbgstr_w(received
), i
, j
);
9652 ok(hr
== prop
.expected
,
9653 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9654 hr
, prop
.expected
, i
, j
);
9655 ok(!strcmp_aw(prop
.value
, received
) ||
9656 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
9657 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9658 prop
.value
, wine_dbgstr_w(received
), i
, j
);
9660 SysFreeString(received
);
9663 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
9664 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
9667 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9670 ok(hr
== prop
.expected
,
9671 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9672 hr
, prop
.expected
, i
, j
);
9675 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9676 prop
.value
, received
, i
, j
);
9679 ok(hr
== prop
.expected
,
9680 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9681 hr
, prop
.expected
, i
, j
);
9682 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9683 prop
.value
, received
, i
, j
);
9687 if(result
) IUri_Release(result
);
9689 if(relative
) IUri_Release(relative
);
9690 heap_free(relativeW
);
9692 if(base
) IUri_Release(base
);
9697 static HRESULT WINAPI
InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
*iface
,
9698 REFIID riid
, void **ppv
)
9700 ok(0, "unexpected call\n");
9701 return E_NOINTERFACE
;
9704 static ULONG WINAPI
InternetProtocolInfo_AddRef(IInternetProtocolInfo
*iface
)
9709 static ULONG WINAPI
InternetProtocolInfo_Release(IInternetProtocolInfo
*iface
)
9714 static HRESULT WINAPI
InternetProtocolInfo_ParseUrl(IInternetProtocolInfo
*iface
, LPCWSTR pwzUrl
,
9715 PARSEACTION ParseAction
, DWORD dwParseFlags
, LPWSTR pwzResult
, DWORD cchResult
,
9716 DWORD
*pcchResult
, DWORD dwReserved
)
9718 CHECK_EXPECT(ParseUrl
);
9719 ok(!lstrcmpW(pwzUrl
, parse_urlW
), "Error: Expected %s, but got %s instead.\n",
9720 wine_dbgstr_w(parse_urlW
), wine_dbgstr_w(pwzUrl
));
9721 ok(ParseAction
== parse_action
, "Error: Expected %d, but got %d.\n", parse_action
, ParseAction
);
9722 ok(dwParseFlags
== parse_flags
, "Error: Expected 0x%08x, but got 0x%08x.\n", parse_flags
, dwParseFlags
);
9723 ok(cchResult
== 200, "Error: Got %d.\n", cchResult
);
9725 memcpy(pwzResult
, parse_resultW
, sizeof(parse_resultW
));
9726 *pcchResult
= lstrlenW(parse_resultW
);
9731 static HRESULT WINAPI
InternetProtocolInfo_CombineUrl(IInternetProtocolInfo
*iface
,
9732 LPCWSTR pwzBaseUrl
, LPCWSTR pwzRelativeUrl
, DWORD dwCombineFlags
,
9733 LPWSTR pwzResult
, DWORD cchResult
, DWORD
*pcchResult
, DWORD dwReserved
)
9735 CHECK_EXPECT(CombineUrl
);
9736 ok(!lstrcmpW(pwzBaseUrl
, combine_baseW
), "Error: Expected %s, but got %s instead.\n",
9737 wine_dbgstr_w(combine_baseW
), wine_dbgstr_w(pwzBaseUrl
));
9738 ok(!lstrcmpW(pwzRelativeUrl
, combine_relativeW
), "Error: Expected %s, but got %s instead.\n",
9739 wine_dbgstr_w(combine_relativeW
), wine_dbgstr_w(pwzRelativeUrl
));
9740 ok(dwCombineFlags
== (URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
),
9741 "Error: Expected 0, but got 0x%08x.\n", dwCombineFlags
);
9742 ok(cchResult
== INTERNET_MAX_URL_LENGTH
+1, "Error: Got %d.\n", cchResult
);
9744 memcpy(pwzResult
, combine_resultW
, sizeof(combine_resultW
));
9745 *pcchResult
= lstrlenW(combine_resultW
);
9750 static HRESULT WINAPI
InternetProtocolInfo_CompareUrl(IInternetProtocolInfo
*iface
,
9751 LPCWSTR pwzUrl1
, LPCWSTR pwzUrl2
, DWORD dwCompareFlags
)
9753 ok(0, "unexpected call\n");
9757 static HRESULT WINAPI
InternetProtocolInfo_QueryInfo(IInternetProtocolInfo
*iface
,
9758 LPCWSTR pwzUrl
, QUERYOPTION OueryOption
, DWORD dwQueryFlags
, LPVOID pBuffer
,
9759 DWORD cbBuffer
, DWORD
*pcbBuf
, DWORD dwReserved
)
9761 ok(0, "unexpected call\n");
9765 static const IInternetProtocolInfoVtbl InternetProtocolInfoVtbl
= {
9766 InternetProtocolInfo_QueryInterface
,
9767 InternetProtocolInfo_AddRef
,
9768 InternetProtocolInfo_Release
,
9769 InternetProtocolInfo_ParseUrl
,
9770 InternetProtocolInfo_CombineUrl
,
9771 InternetProtocolInfo_CompareUrl
,
9772 InternetProtocolInfo_QueryInfo
9775 static IInternetProtocolInfo protocol_info
= { &InternetProtocolInfoVtbl
};
9777 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
9779 if(IsEqualGUID(&IID_IInternetProtocolInfo
, riid
)) {
9780 *ppv
= &protocol_info
;
9784 ok(0, "unexpected call\n");
9785 return E_NOINTERFACE
;
9788 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
9793 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
9798 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pOuter
,
9799 REFIID riid
, void **ppv
)
9801 ok(0, "unexpected call\n");
9805 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL dolock
)
9807 ok(0, "unexpected call\n");
9811 static const IClassFactoryVtbl ClassFactoryVtbl
= {
9812 ClassFactory_QueryInterface
,
9813 ClassFactory_AddRef
,
9814 ClassFactory_Release
,
9815 ClassFactory_CreateInstance
,
9816 ClassFactory_LockServer
9819 static IClassFactory protocol_cf
= { &ClassFactoryVtbl
};
9821 static void register_protocols(void)
9823 IInternetSession
*session
;
9826 hres
= pCoInternetGetSession(0, &session
, 0);
9827 ok(hres
== S_OK
, "CoInternetGetSession failed: %08x\n", hres
);
9831 hres
= IInternetSession_RegisterNameSpace(session
, &protocol_cf
, &IID_NULL
,
9832 winetestW
, 0, NULL
, 0);
9833 ok(hres
== S_OK
, "RegisterNameSpace failed: %08x\n", hres
);
9835 IInternetSession_Release(session
);
9838 static void unregister_protocols(void) {
9839 IInternetSession
*session
;
9842 hr
= pCoInternetGetSession(0, &session
, 0);
9843 ok(hr
== S_OK
, "CoInternetGetSession failed: 0x%08x\n", hr
);
9847 hr
= IInternetSession_UnregisterNameSpace(session
, &protocol_cf
, winetestW
);
9848 ok(hr
== S_OK
, "UnregisterNameSpace failed: 0x%08x\n", hr
);
9850 IInternetSession_Release(session
);
9853 static void test_CoInternetCombineIUri_Pluggable(void) {
9857 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
9858 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
9860 IUri
*relative
= NULL
;
9862 hr
= pCreateUri(combine_relativeW
, Uri_CREATE_ALLOW_RELATIVE
, 0, &relative
);
9863 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
9865 IUri
*result
= NULL
;
9867 SET_EXPECT(CombineUrl
);
9869 hr
= pCoInternetCombineIUri(base
, relative
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
9871 ok(hr
== S_OK
, "Error: CoInternetCombineIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
9873 CHECK_CALLED(CombineUrl
);
9876 BSTR received
= NULL
;
9877 hr
= IUri_GetAbsoluteUri(result
, &received
);
9878 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
9880 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
9881 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
9883 SysFreeString(received
);
9885 if(result
) IUri_Release(result
);
9887 if(relative
) IUri_Release(relative
);
9889 if(base
) IUri_Release(base
);
9892 static void test_CoInternetCombineUrlEx(void) {
9894 IUri
*base
, *result
;
9898 hr
= pCreateUri(http_urlW
, 0, 0, &base
);
9899 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
9901 result
= (void*) 0xdeadbeef;
9902 hr
= pCoInternetCombineUrlEx(base
, NULL
, 0, &result
, 0);
9903 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9905 ok(!result
, "Error: Expected 'result' to be NULL was %p instead.\n", result
);
9908 result
= (void*) 0xdeadbeef;
9909 hr
= pCoInternetCombineUrlEx(NULL
, http_urlW
, 0, &result
, 0);
9910 ok(hr
== E_INVALIDARG
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9912 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
9914 result
= (void*) 0xdeadbeef;
9915 hr
= pCoInternetCombineUrlEx(NULL
, NULL
, 0, &result
, 0);
9916 ok(hr
== E_UNEXPECTED
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9918 ok(!result
, "Error: Expected 'result' to be NULL, but was %p instead.\n", result
);
9920 hr
= pCoInternetCombineUrlEx(base
, http_urlW
, 0, NULL
, 0);
9921 ok(hr
== E_POINTER
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n",
9923 if(base
) IUri_Release(base
);
9925 for(i
= 0; i
< sizeof(uri_combine_tests
)/sizeof(uri_combine_tests
[0]); ++i
) {
9926 LPWSTR baseW
= a2w(uri_combine_tests
[i
].base_uri
);
9928 hr
= pCreateUri(baseW
, uri_combine_tests
[i
].base_create_flags
, 0, &base
);
9929 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_combine_tests[%d].\n", hr
, i
);
9931 LPWSTR relativeW
= a2w(uri_combine_tests
[i
].relative_uri
);
9933 hr
= pCoInternetCombineUrlEx(base
, relativeW
, uri_combine_tests
[i
].combine_flags
,
9935 if(uri_combine_tests
[i
].todo
) {
9937 ok(hr
== uri_combine_tests
[i
].expected
,
9938 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9939 hr
, uri_combine_tests
[i
].expected
, i
);
9942 ok(hr
== uri_combine_tests
[i
].expected
,
9943 "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].\n",
9944 hr
, uri_combine_tests
[i
]. expected
, i
);
9949 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].str_props
)/sizeof(uri_combine_tests
[i
].str_props
[0]); ++j
) {
9950 uri_combine_str_property prop
= uri_combine_tests
[i
].str_props
[j
];
9952 LPCSTR value
= (prop
.value_ex
) ? prop
.value_ex
: prop
.value
;
9954 hr
= IUri_GetPropertyBSTR(result
, j
, &received
, 0);
9957 ok(hr
== prop
.expected
,
9958 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9959 hr
, prop
.expected
, i
, j
);
9962 ok(!strcmp_aw(value
, received
) ||
9963 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
9964 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9965 value
, wine_dbgstr_w(received
), i
, j
);
9968 ok(hr
== prop
.expected
,
9969 "Error: IUri_GetPropertyBSTR returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].str_props[%d].\n",
9970 hr
, prop
.expected
, i
, j
);
9971 ok(!strcmp_aw(value
, received
) ||
9972 broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
9973 "Error: Expected %s but got %s instead on uri_combine_tests[%d].str_props[%d].\n",
9974 value
, wine_dbgstr_w(received
), i
, j
);
9976 SysFreeString(received
);
9979 for(j
= 0; j
< sizeof(uri_combine_tests
[i
].dword_props
)/sizeof(uri_combine_tests
[i
].dword_props
[0]); ++j
) {
9980 uri_dword_property prop
= uri_combine_tests
[i
].dword_props
[j
];
9983 hr
= IUri_GetPropertyDWORD(result
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
9986 ok(hr
== prop
.expected
,
9987 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9988 hr
, prop
.expected
, i
, j
);
9991 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9992 prop
.value
, received
, i
, j
);
9995 ok(hr
== prop
.expected
,
9996 "Error: IUri_GetPropertyDWORD returned 0x%08x, expected 0x%08x on uri_combine_tests[%d].dword_props[%d].\n",
9997 hr
, prop
.expected
, i
, j
);
9998 ok(prop
.value
== received
, "Error: Expected %d, but got %d instead on uri_combine_tests[%d].dword_props[%d].\n",
9999 prop
.value
, received
, i
, j
);
10003 if(result
) IUri_Release(result
);
10004 heap_free(relativeW
);
10006 if(base
) IUri_Release(base
);
10011 static void test_CoInternetCombineUrlEx_Pluggable(void) {
10015 hr
= pCreateUri(combine_baseW
, 0, 0, &base
);
10016 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10017 if(SUCCEEDED(hr
)) {
10018 IUri
*result
= NULL
;
10020 SET_EXPECT(CombineUrl
);
10022 hr
= pCoInternetCombineUrlEx(base
, combine_relativeW
, URL_DONT_SIMPLIFY
|URL_FILE_USE_PATHURL
|URL_DONT_UNESCAPE_EXTRA_INFO
,
10024 ok(hr
== S_OK
, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10026 CHECK_CALLED(CombineUrl
);
10028 if(SUCCEEDED(hr
)) {
10029 BSTR received
= NULL
;
10030 hr
= IUri_GetAbsoluteUri(result
, &received
);
10031 ok(hr
== S_OK
, "Error: Expected S_OK, but got 0x%08x instead.\n", hr
);
10032 if(SUCCEEDED(hr
)) {
10033 ok(!lstrcmpW(combine_resultW
, received
), "Error: Expected %s, but got %s.\n",
10034 wine_dbgstr_w(combine_resultW
), wine_dbgstr_w(received
));
10036 SysFreeString(received
);
10038 if(result
) IUri_Release(result
);
10040 if(base
) IUri_Release(base
);
10043 static void test_CoInternetParseIUri_InvalidArgs(void) {
10049 hr
= pCoInternetParseIUri(NULL
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10050 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10052 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10054 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
10055 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x.\n", hr
);
10056 if(SUCCEEDED(hr
)) {
10057 DWORD expected_len
;
10060 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, NULL
, 0, &result
, 0);
10061 ok(hr
== E_INVALIDARG
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10063 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10065 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, NULL
, 0);
10066 ok(hr
== E_POINTER
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10070 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_URL
, 0, tmp
, 3, &result
, 0);
10071 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
10073 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10076 hr
= pCoInternetParseIUri(uri
, PARSE_MIME
, 0, tmp
, 3, &result
, 0);
10077 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10079 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10082 hr
= pCoInternetParseIUri(uri
, PARSE_SERVER
, 0, tmp
, 3, &result
, 0);
10083 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10085 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10088 hr
= pCoInternetParseIUri(uri
, PARSE_SECURITY_DOMAIN
, 0, tmp
, 3, &result
, 0);
10089 ok(hr
== E_FAIL
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10091 ok(!result
, "Error: Expected 'result' to be 0, but was %d.\n", result
);
10093 expected_len
= lstrlenW(http_urlW
);
10095 hr
= pCoInternetParseIUri(uri
, PARSE_CANONICALIZE
, 0, tmp
, 3, &result
, 0);
10096 ok(hr
== STRSAFE_E_INSUFFICIENT_BUFFER
,
10097 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
10098 hr
, STRSAFE_E_INSUFFICIENT_BUFFER
);
10099 ok(result
== expected_len
, "Error: Expected 'result' to be %d, but was %d instead.\n",
10100 expected_len
, result
);
10102 if(uri
) IUri_Release(uri
);
10105 static void test_CoInternetParseIUri(void) {
10108 for(i
= 0; i
< sizeof(uri_parse_tests
)/sizeof(uri_parse_tests
[0]); ++i
) {
10112 uri_parse_test test
= uri_parse_tests
[i
];
10114 uriW
= a2w(test
.uri
);
10115 hr
= pCreateUri(uriW
, test
.uri_flags
, 0, &uri
);
10116 ok(SUCCEEDED(hr
), "Error: CreateUri returned 0x%08x on uri_parse_tests[%d].\n", hr
, i
);
10117 if(SUCCEEDED(hr
)) {
10118 WCHAR result
[INTERNET_MAX_URL_LENGTH
+1];
10119 DWORD result_len
= -1;
10121 hr
= pCoInternetParseIUri(uri
, test
.action
, test
.flags
, result
, INTERNET_MAX_URL_LENGTH
+1, &result_len
, 0);
10124 ok(hr
== test
.expected
,
10125 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10126 hr
, test
.expected
, i
);
10129 ok(hr
== test
.expected
,
10130 "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x on uri_parse_tests[%d].\n",
10131 hr
, test
.expected
, i
);
10133 if(SUCCEEDED(hr
)) {
10134 DWORD len
= lstrlenA(test
.property
);
10135 ok(!strcmp_aw(test
.property
, result
),
10136 "Error: Expected %s but got %s instead on uri_parse_tests[%d].\n",
10137 test
.property
, wine_dbgstr_w(result
), i
);
10138 ok(len
== result_len
,
10139 "Error: Expected %d, but got %d instead on uri_parse_tests[%d].\n",
10140 len
, result_len
, i
);
10143 "Error: Expected 'result_len' to be 0, but was %d on uri_parse_tests[%d].\n",
10147 if(uri
) IUri_Release(uri
);
10152 static void test_CoInternetParseIUri_Pluggable(void) {
10156 hr
= pCreateUri(parse_urlW
, 0, 0, &uri
);
10157 ok(SUCCEEDED(hr
), "Error: Expected CreateUri to succeed, but got 0x%08x.\n", hr
);
10158 if(SUCCEEDED(hr
)) {
10162 SET_EXPECT(ParseUrl
);
10164 parse_action
= PARSE_CANONICALIZE
;
10165 parse_flags
= URL_UNESCAPE
|URL_ESCAPE_UNSAFE
;
10167 hr
= pCoInternetParseIUri(uri
, parse_action
, parse_flags
, result
, 200, &result_len
, 0);
10168 ok(hr
== S_OK
, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
10170 CHECK_CALLED(ParseUrl
);
10172 if(SUCCEEDED(hr
)) {
10173 ok(result_len
== lstrlenW(parse_resultW
), "Error: Expected %d, but got %d.\n",
10174 lstrlenW(parse_resultW
), result_len
);
10175 ok(!lstrcmpW(result
, parse_resultW
), "Error: Expected %s, but got %s.\n",
10176 wine_dbgstr_w(parse_resultW
), wine_dbgstr_w(result
));
10179 if(uri
) IUri_Release(uri
);
10185 const char *base_url
;
10186 DWORD base_uri_flags
;
10187 const char *legacy_url
;
10188 const char *uniform_url
;
10189 const char *no_canon_url
;
10190 const char *uri_url
;
10191 } create_urlmon_test_t
;
10193 static const create_urlmon_test_t create_urlmon_tests
[] = {
10195 "http://www.winehq.org",Uri_CREATE_NO_CANONICALIZE
,
10197 "http://www.winehq.org/",
10198 "http://www.winehq.org/",
10199 "http://www.winehq.org",
10200 "http://www.winehq.org"
10203 "file://c:\\dir\\file.txt",Uri_CREATE_NO_CANONICALIZE
,
10205 "file://c:\\dir\\file.txt",
10206 "file:///c:/dir/file.txt",
10207 "file:///c:/dir/file.txt",
10208 "file:///c:/dir/file.txt"
10211 "file://c:\\dir\\file.txt",Uri_CREATE_FILE_USE_DOS_PATH
,
10213 "file://c:\\dir\\file.txt",
10214 "file:///c:/dir/file.txt",
10215 "file:///c:/dir/file.txt",
10216 "file://c:\\dir\\file.txt"
10219 "dat%61",Uri_CREATE_ALLOW_RELATIVE
,
10220 "http://www.winehq.org",0,
10221 "http://www.winehq.org/data",
10222 "http://www.winehq.org/data",
10223 "http://www.winehq.org:80/data",
10226 "file.txt",Uri_CREATE_ALLOW_RELATIVE
,
10227 "file://c:\\dir\\x.txt",Uri_CREATE_NO_CANONICALIZE
,
10228 "file://c:\\dir\\file.txt",
10229 "file:///c:/dir/file.txt",
10230 "file:///c:/dir/file.txt",
10233 "",Uri_CREATE_ALLOW_RELATIVE
,
10241 "test",Uri_CREATE_ALLOW_RELATIVE
,
10249 "c:\\dir\\file.txt",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
10251 "file://c:\\dir\\file.txt",
10252 "file:///c:/dir/file.txt",
10253 "file:///c:/dir/file.txt",
10254 "file:///c:/dir/file.txt",
10258 #define test_urlmon_display_name(a,b) _test_urlmon_display_name(__LINE__,a,b)
10259 static void _test_urlmon_display_name(unsigned line
, IMoniker
*mon
, const char *exurl
)
10261 WCHAR
*display_name
;
10264 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &display_name
);
10265 ok_(__FILE__
,line
)(hres
== S_OK
, "GetDisplayName failed: %08x\n", hres
);
10266 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_name
), "unexpected display name: %s, expected %s\n",
10267 wine_dbgstr_w(display_name
), exurl
);
10269 CoTaskMemFree(display_name
);
10272 #define test_display_uri(a,b) _test_display_uri(__LINE__,a,b)
10273 static void _test_display_uri(unsigned line
, IMoniker
*mon
, const char *exurl
)
10275 IUriContainer
*uri_container
;
10280 hres
= IMoniker_QueryInterface(mon
, &IID_IUriContainer
, (void**)&uri_container
);
10281 ok(hres
== S_OK
, "Could not get IUriContainer iface: %08x\n", hres
);
10284 hres
= IUriContainer_GetIUri(uri_container
, &uri
);
10285 IUriContainer_Release(uri_container
);
10286 ok(hres
== S_OK
, "GetIUri failed: %08x\n", hres
);
10287 ok(uri
!= NULL
, "uri == NULL\n");
10289 hres
= IUri_GetDisplayUri(uri
, &display_uri
);
10291 ok(hres
== S_OK
, "GetDisplayUri failed: %08x\n", hres
);
10292 ok_(__FILE__
,line
)(!strcmp_aw(exurl
, display_uri
), "unexpected display uri: %s, expected %s\n",
10293 wine_dbgstr_w(display_uri
), exurl
);
10294 SysFreeString(display_uri
);
10297 static void test_CreateURLMoniker(void)
10299 const create_urlmon_test_t
*test
;
10300 IMoniker
*mon
, *base_mon
;
10301 WCHAR
*url
, *base_url
;
10302 IUri
*uri
, *base_uri
;
10305 for(test
= create_urlmon_tests
; test
< create_urlmon_tests
+ sizeof(create_urlmon_tests
)/sizeof(*create_urlmon_tests
); test
++) {
10306 url
= a2w(test
->url
);
10307 base_url
= a2w(test
->base_url
);
10310 hres
= pCreateUri(base_url
, test
->base_uri_flags
, 0, &base_uri
);
10311 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
10313 hres
= pCreateURLMonikerEx2(NULL
, base_uri
, &base_mon
, URL_MK_NO_CANONICALIZE
);
10314 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
10320 hres
= CreateURLMoniker(base_mon
, url
, &mon
);
10321 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
10322 test_urlmon_display_name(mon
, test
->legacy_url
);
10323 test_display_uri(mon
, test
->legacy_url
);
10324 IMoniker_Release(mon
);
10326 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_LEGACY
);
10327 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
10328 test_urlmon_display_name(mon
, test
->legacy_url
);
10329 test_display_uri(mon
, test
->legacy_url
);
10330 IMoniker_Release(mon
);
10332 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_UNIFORM
);
10333 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
10334 test_urlmon_display_name(mon
, test
->uniform_url
);
10335 test_display_uri(mon
, test
->uniform_url
);
10336 IMoniker_Release(mon
);
10338 hres
= pCreateURLMonikerEx(base_mon
, url
, &mon
, URL_MK_NO_CANONICALIZE
);
10339 ok(hres
== S_OK
, "CreateURLMoniker failed: %08x\n", hres
);
10340 test_urlmon_display_name(mon
, test
->no_canon_url
);
10341 test_display_uri(mon
, test
->no_canon_url
);
10342 IMoniker_Release(mon
);
10344 hres
= pCreateUri(url
, test
->uri_flags
, 0, &uri
);
10345 ok(hres
== S_OK
, "CreateUri failed: %08x\n", hres
);
10347 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_LEGACY
);
10348 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
10349 test_urlmon_display_name(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
10350 test_display_uri(mon
, base_url
? test
->legacy_url
: test
->uri_url
);
10351 IMoniker_Release(mon
);
10353 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_UNIFORM
);
10354 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
10355 test_urlmon_display_name(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
10356 test_display_uri(mon
, base_url
? test
->uniform_url
: test
->uri_url
);
10357 IMoniker_Release(mon
);
10359 hres
= pCreateURLMonikerEx2(base_mon
, uri
, &mon
, URL_MK_NO_CANONICALIZE
);
10360 ok(hres
== S_OK
, "CreateURLMonikerEx2 failed: %08x\n", hres
);
10361 test_urlmon_display_name(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
10362 test_display_uri(mon
, base_url
? test
->no_canon_url
: test
->uri_url
);
10363 IMoniker_Release(mon
);
10367 heap_free(base_url
);
10369 IUri_Release(base_uri
);
10371 IMoniker_Release(base_mon
);
10378 hurlmon
= GetModuleHandle("urlmon.dll");
10379 pCoInternetGetSession
= (void*) GetProcAddress(hurlmon
, "CoInternetGetSession");
10380 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
10381 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
10382 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
10383 pCoInternetCombineIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineIUri");
10384 pCoInternetCombineUrlEx
= (void*) GetProcAddress(hurlmon
, "CoInternetCombineUrlEx");
10385 pCoInternetParseIUri
= (void*) GetProcAddress(hurlmon
, "CoInternetParseIUri");
10386 pCreateURLMonikerEx
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx");
10387 pCreateURLMonikerEx2
= (void*) GetProcAddress(hurlmon
, "CreateURLMonikerEx2");
10390 win_skip("CreateUri is not present, skipping tests.\n");
10394 trace("test CreateUri invalid flags...\n");
10395 test_CreateUri_InvalidFlags();
10397 trace("test CreateUri invalid args...\n");
10398 test_CreateUri_InvalidArgs();
10400 trace("test CreateUri invalid URIs...\n");
10401 test_CreateUri_InvalidUri();
10403 trace("test IUri_GetPropertyBSTR...\n");
10404 test_IUri_GetPropertyBSTR();
10406 trace("test IUri_GetPropertyDWORD...\n");
10407 test_IUri_GetPropertyDWORD();
10409 trace("test IUri_GetStrProperties...\n");
10410 test_IUri_GetStrProperties();
10412 trace("test IUri_GetDwordProperties...\n");
10413 test_IUri_GetDwordProperties();
10415 trace("test IUri_GetPropertyLength...\n");
10416 test_IUri_GetPropertyLength();
10418 trace("test IUri_GetProperties...\n");
10419 test_IUri_GetProperties();
10421 trace("test IUri_HasProperty...\n");
10422 test_IUri_HasProperty();
10424 trace("test IUri_IsEqual...\n");
10425 test_IUri_IsEqual();
10427 trace("test CreateUriWithFragment invalid args...\n");
10428 test_CreateUriWithFragment_InvalidArgs();
10430 trace("test CreateUriWithFragment invalid flags...\n");
10431 test_CreateUriWithFragment_InvalidFlags();
10433 trace("test CreateUriWithFragment...\n");
10434 test_CreateUriWithFragment();
10436 trace("test CreateIUriBuilder...\n");
10437 test_CreateIUriBuilder();
10439 trace("test IUriBuilder_CreateInvalidArgs...\n");
10440 test_IUriBuilder_CreateInvalidArgs();
10442 trace("test IUriBuilder...\n");
10443 test_IUriBuilder();
10445 trace("test IUriBuilder_GetInvalidArgs...\n");
10446 test_IUriBuilder_GetInvalidArgs();
10448 trace("test IUriBuilder_HasBeenModified...\n");
10449 test_IUriBuilder_HasBeenModified();
10451 trace("test IUriBuilder_IUriProperty...\n");
10452 test_IUriBuilder_IUriProperty();
10454 trace("test IUriBuilder_RemoveProperties...\n");
10455 test_IUriBuilder_RemoveProperties();
10457 trace("test IUriBuilder miscellaneous...\n");
10458 test_IUriBuilder_Misc();
10460 trace("test IUriBuilderFactory...\n");
10461 test_IUriBuilderFactory();
10463 trace("test CoInternetCombineIUri...\n");
10464 test_CoInternetCombineIUri();
10466 trace("test CoInternetCombineUrlEx...\n");
10467 test_CoInternetCombineUrlEx();
10469 trace("test CoInternetParseIUri Invalid Args...\n");
10470 test_CoInternetParseIUri_InvalidArgs();
10472 trace("test CoInternetParseIUri...\n");
10473 test_CoInternetParseIUri();
10475 register_protocols();
10477 trace("test CoInternetCombineIUri pluggable...\n");
10478 test_CoInternetCombineIUri_Pluggable();
10480 trace("test CoInternetCombineUrlEx Pluggable...\n");
10481 test_CoInternetCombineUrlEx_Pluggable();
10483 trace("test CoInternetParseIUri pluggable...\n");
10484 test_CoInternetParseIUri_Pluggable();
10486 trace("test CreateURLMoniker...\n");
10487 test_CreateURLMoniker();
10489 unregister_protocols();