4 * Copyright 2010 Thomas Mullaly
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <wine/test.h>
32 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
33 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
34 #define URI_BUILDER_STR_PROPERTY_COUNT 7
36 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
37 static HRESULT (WINAPI
*pCreateUriWithFragment
)(LPCWSTR
, LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
38 static HRESULT (WINAPI
*pCreateIUriBuilder
)(IUri
*, DWORD
, DWORD_PTR
, IUriBuilder
**);
40 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
41 '.','o','r','g','/',0};
42 static const WCHAR http_url_fragW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
43 '.','o','r','g','/','#','F','r','a','g',0};
45 typedef struct _uri_create_flag_test
{
48 } uri_create_flag_test
;
50 static const uri_create_flag_test invalid_flag_tests
[] = {
51 /* Set of invalid flag combinations to test for. */
52 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
53 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
54 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
55 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
56 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
59 typedef struct _uri_str_property
{
63 const char* broken_value
;
66 typedef struct _uri_dword_property
{
72 typedef struct _uri_properties
{
75 HRESULT create_expected
;
80 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
81 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
84 static const uri_properties uri_tests
[] = {
85 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
86 /* A flag bitmap containing all the Uri_HAS_* flags that correspond to this uri. */
87 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
88 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
89 Uri_HAS_PORT
|Uri_HAS_SCHEME
,
92 {"http://www.winehq.org/",S_OK
,FALSE
}, /* ABSOLUTE_URI */
93 {"www.winehq.org",S_OK
,FALSE
}, /* AUTHORITY */
94 {"http://www.winehq.org/",S_OK
,FALSE
}, /* DISPLAY_URI */
95 {"winehq.org",S_OK
,FALSE
}, /* DOMAIN */
96 {"",S_FALSE
,FALSE
}, /* EXTENSION */
97 {"",S_FALSE
,FALSE
}, /* FRAGMENT */
98 {"www.winehq.org",S_OK
,FALSE
}, /* HOST */
99 {"",S_FALSE
,FALSE
}, /* PASSWORD */
100 {"/",S_OK
,FALSE
}, /* PATH */
101 {"/",S_OK
,FALSE
}, /* PATH_AND_QUERY */
102 {"",S_FALSE
,FALSE
}, /* QUERY */
103 {"http://www.winehq.org/tests/../tests/../..",S_OK
,FALSE
}, /* RAW_URI */
104 {"http",S_OK
,FALSE
}, /* SCHEME_NAME */
105 {"",S_FALSE
,FALSE
}, /* USER_INFO */
106 {"",S_FALSE
,FALSE
} /* USER_NAME */
109 {Uri_HOST_DNS
,S_OK
,FALSE
}, /* HOST_TYPE */
110 {80,S_OK
,FALSE
}, /* PORT */
111 {URL_SCHEME_HTTP
,S_OK
,FALSE
}, /* SCHEME */
112 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
} /* ZONE */
115 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
116 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
117 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
118 Uri_HAS_PORT
|Uri_HAS_SCHEME
,
121 {"http://winehq.org/tests",S_OK
,FALSE
},
122 {"winehq.org",S_OK
,FALSE
},
123 {"http://winehq.org/tests",S_OK
,FALSE
},
124 {"winehq.org",S_OK
,FALSE
},
127 {"winehq.org",S_OK
,FALSE
},
129 {"/tests",S_OK
,FALSE
},
130 {"/tests",S_OK
,FALSE
},
132 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
138 {Uri_HOST_DNS
,S_OK
,FALSE
},
140 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
141 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
144 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
145 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
146 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
147 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
150 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
151 {"www.winehq.org",S_OK
,FALSE
},
152 {"http://www.winehq.org/?query=x&return=y",S_OK
,FALSE
},
153 {"winehq.org",S_OK
,FALSE
},
156 {"www.winehq.org",S_OK
,FALSE
},
159 {"/?query=x&return=y",S_OK
,FALSE
},
160 {"?query=x&return=y",S_OK
,FALSE
},
161 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
167 {Uri_HOST_DNS
,S_OK
,FALSE
},
169 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
170 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
173 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
174 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|Uri_HAS_PATH
|
175 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|
176 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
179 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
180 {"usEr%3Ainfo@example.com",S_OK
,FALSE
},
181 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
182 {"example.com",S_OK
,FALSE
},
185 {"example.com",S_OK
,FALSE
},
187 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
188 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,FALSE
},
190 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
192 {"usEr%3Ainfo",S_OK
,FALSE
},
193 {"usEr%3Ainfo",S_OK
,FALSE
}
196 {Uri_HOST_DNS
,S_OK
,FALSE
},
198 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
199 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
202 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
203 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_EXTENSION
|
204 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
205 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
209 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
210 {"winepass:wine@ftp.winehq.org:9999",S_OK
,FALSE
},
211 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,FALSE
},
212 {"winehq.org",S_OK
,FALSE
},
215 {"ftp.winehq.org",S_OK
,FALSE
},
217 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
218 {"/dir/foo%20bar.txt",S_OK
,FALSE
},
220 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
222 {"winepass:wine",S_OK
,FALSE
},
223 {"winepass",S_OK
,FALSE
}
226 {Uri_HOST_DNS
,S_OK
,FALSE
},
228 {URL_SCHEME_FTP
,S_OK
,FALSE
},
229 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
232 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
233 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
234 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
237 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
239 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
245 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
246 {"/c:/tests/foo%2520bar.mp3",S_OK
,FALSE
},
248 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
254 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
256 {URL_SCHEME_FILE
,S_OK
,FALSE
},
257 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
260 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
261 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
262 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
265 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
267 {"file:///tests/test%20file.README.txt",S_OK
,FALSE
},
273 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
274 {"/tests/test%20file.README.txt",S_OK
,FALSE
},
276 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
282 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
284 {URL_SCHEME_FILE
,S_OK
,FALSE
},
285 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
288 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
289 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
290 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
293 {"urn:nothing:should:happen here",S_OK
,FALSE
},
295 {"urn:nothing:should:happen here",S_OK
,FALSE
},
301 {"nothing:should:happen here",S_OK
,FALSE
},
302 {"nothing:should:happen here",S_OK
,FALSE
},
304 {"urn:nothing:should:happen here",S_OK
,FALSE
},
310 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
312 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
313 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
316 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
317 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
318 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
319 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
322 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
323 {"127.0.0.1",S_OK
,FALSE
},
324 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,FALSE
},
328 {"127.0.0.1",S_OK
,FALSE
},
330 {"/test%20dir/test.txt",S_OK
,FALSE
},
331 {"/test%20dir/test.txt",S_OK
,FALSE
},
333 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
339 {Uri_HOST_IPV4
,S_OK
,FALSE
},
341 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
342 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
345 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
346 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
347 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
348 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
351 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
352 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK
,FALSE
},
353 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,FALSE
},
357 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,FALSE
},
362 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
368 {Uri_HOST_IPV6
,S_OK
,FALSE
},
370 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
371 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
374 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
375 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
376 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
377 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
380 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
381 {"[::13.1.68.3]",S_OK
,FALSE
},
382 {"ftp://[::13.1.68.3]/",S_OK
,FALSE
},
386 {"::13.1.68.3",S_OK
,FALSE
},
391 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
397 {Uri_HOST_IPV6
,S_OK
,FALSE
},
399 {URL_SCHEME_FTP
,S_OK
,FALSE
},
400 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
403 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
404 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
405 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
406 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
409 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
410 {"[fedc:ba98::3210]",S_OK
,FALSE
},
411 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
415 {"fedc:ba98::3210",S_OK
,FALSE
},
420 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
426 {Uri_HOST_IPV6
,S_OK
,FALSE
},
428 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
429 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
432 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
433 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
434 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
435 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
438 {"1234://www.winehq.org/",S_OK
,FALSE
},
439 {"www.winehq.org",S_OK
,FALSE
},
440 {"1234://www.winehq.org/",S_OK
,FALSE
},
441 {"winehq.org",S_OK
,FALSE
},
444 {"www.winehq.org",S_OK
,FALSE
},
449 {"1234://www.winehq.org",S_OK
,FALSE
},
455 {Uri_HOST_DNS
,S_OK
,FALSE
},
457 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
458 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
461 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
462 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
463 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
464 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
467 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
469 {"file:///C:/test/test.mp3",S_OK
,FALSE
},
475 {"/C:/test/test.mp3",S_OK
,FALSE
},
476 {"/C:/test/test.mp3",S_OK
,FALSE
},
478 {"C:/test/test.mp3",S_OK
,FALSE
},
484 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
486 {URL_SCHEME_FILE
,S_OK
,FALSE
},
487 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
490 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
491 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
492 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
493 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_HOST
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
494 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
497 {"file://server/test.mp3",S_OK
,FALSE
},
498 {"server",S_OK
,FALSE
},
499 {"file://server/test.mp3",S_OK
,FALSE
},
503 {"server",S_OK
,FALSE
},
505 {"/test.mp3",S_OK
,FALSE
},
506 {"/test.mp3",S_OK
,FALSE
},
508 {"\\\\Server/test.mp3",S_OK
,FALSE
},
514 {Uri_HOST_DNS
,S_OK
,FALSE
},
516 {URL_SCHEME_FILE
,S_OK
,FALSE
},
517 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
520 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
521 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
522 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
526 {"*:www.winehq.org/test",S_OK
,FALSE
},
527 {"www.winehq.org",S_OK
,FALSE
},
528 {"*:www.winehq.org/test",S_OK
,FALSE
},
529 {"winehq.org",S_OK
,FALSE
},
532 {"www.winehq.org",S_OK
,FALSE
},
534 {"/test",S_OK
,FALSE
},
535 {"/test",S_OK
,FALSE
},
537 {"www.winehq.org/test",S_OK
,FALSE
},
543 {Uri_HOST_DNS
,S_OK
,FALSE
},
545 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
546 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
549 /* Valid since the '*' is the only character in the scheme name. */
550 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
551 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
552 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
556 {"*:www.winehq.org/test",S_OK
,FALSE
},
557 {"www.winehq.org",S_OK
,FALSE
},
558 {"*:www.winehq.org/test",S_OK
,FALSE
},
559 {"winehq.org",S_OK
,FALSE
},
562 {"www.winehq.org",S_OK
,FALSE
},
564 {"/test",S_OK
,FALSE
},
565 {"/test",S_OK
,FALSE
},
567 {"*:www.winehq.org/test",S_OK
,FALSE
},
573 {Uri_HOST_DNS
,S_OK
,FALSE
},
575 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
576 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
579 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
580 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
581 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
584 {"/../some dir/test.ext",S_OK
,FALSE
},
586 {"/../some dir/test.ext",S_OK
,FALSE
},
592 {"/../some dir/test.ext",S_OK
,FALSE
},
593 {"/../some dir/test.ext",S_OK
,FALSE
},
595 {"/../some dir/test.ext",S_OK
,FALSE
},
601 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
603 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
604 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
607 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
608 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|Uri_HAS_PATH
|
609 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
612 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
614 {"*://implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
620 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
621 {"//implicit/wildcard/uri%20scheme",S_OK
,FALSE
},
623 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
629 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
631 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
632 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
635 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and its an unknown scheme. */
636 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, S_OK
, FALSE
,
637 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
638 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME_NAME
|
642 {"zip:/.//google.com",S_OK
,FALSE
},
644 {"zip:/.//google.com",S_OK
,FALSE
},
650 {"/.//google.com",S_OK
,FALSE
},
651 {"/.//google.com",S_OK
,FALSE
},
653 {"zip://google.com",S_OK
,FALSE
},
659 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
661 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
662 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
665 /* Windows uses the first occurrence of ':' to delimit the userinfo. */
666 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
667 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
668 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
669 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
673 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
674 {"user:pass:word@winehq.org",S_OK
,FALSE
},
675 {"ftp://winehq.org/",S_OK
,FALSE
},
676 {"winehq.org",S_OK
,FALSE
},
679 {"winehq.org",S_OK
,FALSE
},
680 {"pass:word",S_OK
,FALSE
},
684 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
686 {"user:pass:word",S_OK
,FALSE
},
690 {Uri_HOST_DNS
,S_OK
,FALSE
},
692 {URL_SCHEME_FTP
,S_OK
,FALSE
},
693 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
696 /* Make sure % encoded unreserved characters are decoded. */
697 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
698 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
699 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
700 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
704 {"ftp://wINe:PASS@ftp.google.com/",S_OK
,FALSE
},
705 {"wINe:PASS@ftp.google.com",S_OK
,FALSE
},
706 {"ftp://ftp.google.com/",S_OK
,FALSE
},
707 {"google.com",S_OK
,FALSE
},
710 {"ftp.google.com",S_OK
,FALSE
},
715 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
717 {"wINe:PASS",S_OK
,FALSE
},
721 {Uri_HOST_DNS
,S_OK
,FALSE
},
723 {URL_SCHEME_FTP
,S_OK
,FALSE
},
724 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
727 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
728 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK
, FALSE
,
729 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
730 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
731 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
735 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
736 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK
,FALSE
},
737 {"ftp://ftp.google.com/",S_OK
,FALSE
},
738 {"google.com",S_OK
,FALSE
},
741 {"ftp.google.com",S_OK
,FALSE
},
742 {"PA%7B%7D",S_OK
,FALSE
},
746 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
748 {"w%5D%5Be:PA%7B%7D",S_OK
,FALSE
},
749 {"w%5D%5Be",S_OK
,FALSE
}
752 {Uri_HOST_DNS
,S_OK
,FALSE
},
754 {URL_SCHEME_FTP
,S_OK
,FALSE
},
755 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
758 /* You're allowed to have an empty password portion in the userinfo section. */
759 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
760 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
761 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
762 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
766 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
767 {"empty:@ftp.google.com",S_OK
,FALSE
},
768 {"ftp://ftp.google.com/",S_OK
,FALSE
},
769 {"google.com",S_OK
,FALSE
},
772 {"ftp.google.com",S_OK
,FALSE
},
777 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
779 {"empty:",S_OK
,FALSE
},
783 {Uri_HOST_DNS
,S_OK
,FALSE
},
785 {URL_SCHEME_FTP
,S_OK
,FALSE
},
786 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
789 /* Make sure forbidden characters in "userinfo" get encoded. */
790 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
791 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
792 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
793 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
797 {"ftp://%22%20%22weird@ftp.google.com/",S_OK
,FALSE
},
798 {"%22%20%22weird@ftp.google.com",S_OK
,FALSE
},
799 {"ftp://ftp.google.com/",S_OK
,FALSE
},
800 {"google.com",S_OK
,FALSE
},
803 {"ftp.google.com",S_OK
,FALSE
},
808 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
810 {"%22%20%22weird",S_OK
,FALSE
},
811 {"%22%20%22weird",S_OK
,FALSE
}
814 {Uri_HOST_DNS
,S_OK
,FALSE
},
816 {URL_SCHEME_FTP
,S_OK
,FALSE
},
817 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
820 /* Make sure the forbidden characters don't get percent encoded. */
821 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
822 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
823 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
824 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
828 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
829 {"\" \"weird@ftp.google.com",S_OK
,FALSE
},
830 {"ftp://ftp.google.com/",S_OK
,FALSE
},
831 {"google.com",S_OK
,FALSE
},
834 {"ftp.google.com",S_OK
,FALSE
},
839 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
841 {"\" \"weird",S_OK
,FALSE
},
842 {"\" \"weird",S_OK
,FALSE
}
845 {Uri_HOST_DNS
,S_OK
,FALSE
},
847 {URL_SCHEME_FTP
,S_OK
,FALSE
},
848 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
851 /* Allowed to have invalid % encoded because its an unknown scheme type. */
852 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
853 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
854 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
855 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
858 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
859 {"%xy:word@winehq.org",S_OK
,FALSE
},
860 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
861 {"winehq.org",S_OK
,FALSE
},
864 {"winehq.org",S_OK
,FALSE
},
869 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
871 {"%xy:word",S_OK
,FALSE
},
875 {Uri_HOST_DNS
,S_OK
,FALSE
},
877 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
878 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
881 /* Unreserved, percent encoded characters aren't decoded in the userinfo becuase the scheme
884 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
885 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
886 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
887 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
890 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
891 {"%2E:%52%53ord@winehq.org",S_OK
,FALSE
},
892 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
893 {"winehq.org",S_OK
,FALSE
},
896 {"winehq.org",S_OK
,FALSE
},
897 {"%52%53ord",S_OK
,FALSE
},
901 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
903 {"%2E:%52%53ord",S_OK
,FALSE
},
907 {Uri_HOST_DNS
,S_OK
,FALSE
},
909 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
910 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
913 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
914 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
915 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
916 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
920 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
921 {"[](),'test':word@winehq.org",S_OK
,FALSE
},
922 {"ftp://winehq.org/",S_OK
,FALSE
},
923 {"winehq.org",S_OK
,FALSE
},
926 {"winehq.org",S_OK
,FALSE
},
931 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
933 {"[](),'test':word",S_OK
,FALSE
},
934 {"[](),'test'",S_OK
,FALSE
}
937 {Uri_HOST_DNS
,S_OK
,FALSE
},
939 {URL_SCHEME_FTP
,S_OK
,FALSE
},
940 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
943 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
944 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
945 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
946 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
949 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
951 {"ftp://test/?:word@winehq.org/",S_OK
,FALSE
},
958 {"/?:word@winehq.org/",S_OK
,FALSE
},
959 {"?:word@winehq.org/",S_OK
,FALSE
},
960 {"ftp://test?:word@winehq.org/",S_OK
,FALSE
},
966 {Uri_HOST_DNS
,S_OK
,FALSE
},
968 {URL_SCHEME_FTP
,S_OK
,FALSE
},
969 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
972 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
973 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_FRAGMENT
|Uri_HAS_HOST
|
974 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
975 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
978 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
980 {"ftp://test/#:word@winehq.org/",S_OK
,FALSE
},
983 {"#:word@winehq.org/",S_OK
,FALSE
},
989 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
995 {Uri_HOST_DNS
,S_OK
,FALSE
},
997 {URL_SCHEME_FTP
,S_OK
,FALSE
},
998 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1001 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1002 { "zip://test\\:word@winehq.org/", 0, S_OK
, FALSE
,
1003 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
1004 Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1005 Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1008 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1009 {"test\\:word@winehq.org",S_OK
,FALSE
},
1010 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1011 {"winehq.org",S_OK
,FALSE
},
1014 {"winehq.org",S_OK
,FALSE
},
1015 {"word",S_OK
,FALSE
},
1019 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1021 {"test\\:word",S_OK
,FALSE
},
1022 {"test\\",S_OK
,FALSE
}
1025 {Uri_HOST_DNS
,S_OK
,FALSE
},
1027 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1028 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1031 /* It normalizes IPv4 addresses correctly. */
1032 { "http://127.000.000.100/", 0, S_OK
, FALSE
,
1033 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1034 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1035 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1038 {"http://127.0.0.100/",S_OK
,FALSE
},
1039 {"127.0.0.100",S_OK
,FALSE
},
1040 {"http://127.0.0.100/",S_OK
,FALSE
},
1044 {"127.0.0.100",S_OK
,FALSE
},
1049 {"http://127.000.000.100/",S_OK
,FALSE
},
1050 {"http",S_OK
,FALSE
},
1055 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1057 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1058 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1061 /* Make sure it normalizes partial IPv4 addresses correctly. */
1062 { "http://127.0/", 0, S_OK
, FALSE
,
1063 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1064 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1065 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1068 {"http://127.0.0.0/",S_OK
,FALSE
},
1069 {"127.0.0.0",S_OK
,FALSE
},
1070 {"http://127.0.0.0/",S_OK
,FALSE
},
1074 {"127.0.0.0",S_OK
,FALSE
},
1079 {"http://127.0/",S_OK
,FALSE
},
1080 {"http",S_OK
,FALSE
},
1085 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1087 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1088 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1091 /* Make sure it converts implicit IPv4's correctly. */
1092 { "http://123456/", 0, S_OK
, FALSE
,
1093 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1094 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1095 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1098 {"http://0.1.226.64/",S_OK
,FALSE
},
1099 {"0.1.226.64",S_OK
,FALSE
},
1100 {"http://0.1.226.64/",S_OK
,FALSE
},
1104 {"0.1.226.64",S_OK
,FALSE
},
1109 {"http://123456/",S_OK
,FALSE
},
1110 {"http",S_OK
,FALSE
},
1115 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1117 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1118 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1122 { "http://4294967295/", 0, S_OK
, FALSE
,
1123 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1124 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1125 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1128 {"http://255.255.255.255/",S_OK
,FALSE
},
1129 {"255.255.255.255",S_OK
,FALSE
},
1130 {"http://255.255.255.255/",S_OK
,FALSE
},
1134 {"255.255.255.255",S_OK
,FALSE
},
1139 {"http://4294967295/",S_OK
,FALSE
},
1140 {"http",S_OK
,FALSE
},
1145 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1147 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1148 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1152 { "http://4294967296/", 0, S_OK
, FALSE
,
1153 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1154 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1155 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1158 {"http://4294967296/",S_OK
,FALSE
},
1159 {"4294967296",S_OK
,FALSE
},
1160 {"http://4294967296/",S_OK
,FALSE
},
1164 {"4294967296",S_OK
,FALSE
},
1169 {"http://4294967296/",S_OK
,FALSE
},
1170 {"http",S_OK
,FALSE
},
1175 {Uri_HOST_DNS
,S_OK
,FALSE
},
1177 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1178 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1181 /* Window's doesn't normalize IP address for unknown schemes. */
1182 { "1234://4294967295/", 0, S_OK
, FALSE
,
1183 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1184 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1185 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1188 {"1234://4294967295/",S_OK
,FALSE
},
1189 {"4294967295",S_OK
,FALSE
},
1190 {"1234://4294967295/",S_OK
,FALSE
},
1194 {"4294967295",S_OK
,FALSE
},
1199 {"1234://4294967295/",S_OK
,FALSE
},
1200 {"1234",S_OK
,FALSE
},
1205 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1207 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1208 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1211 /* Window's doesn't normalize IP address for unknown schemes. */
1212 { "1234://127.001/", 0, S_OK
, FALSE
,
1213 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1214 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1215 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1218 {"1234://127.001/",S_OK
,FALSE
},
1219 {"127.001",S_OK
,FALSE
},
1220 {"1234://127.001/",S_OK
,FALSE
},
1224 {"127.001",S_OK
,FALSE
},
1229 {"1234://127.001/",S_OK
,FALSE
},
1230 {"1234",S_OK
,FALSE
},
1235 {Uri_HOST_IPV4
,S_OK
,FALSE
},
1237 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1238 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1241 { "http://[FEDC:BA98::3210]", 0, S_OK
, FALSE
,
1242 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1243 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1244 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1247 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1248 {"[fedc:ba98::3210]",S_OK
,FALSE
},
1249 {"http://[fedc:ba98::3210]/",S_OK
,FALSE
},
1253 {"fedc:ba98::3210",S_OK
,FALSE
},
1258 {"http://[FEDC:BA98::3210]",S_OK
,FALSE
},
1259 {"http",S_OK
,FALSE
},
1264 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1266 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1267 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1270 { "http://[::]", 0, S_OK
, FALSE
,
1271 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1272 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1273 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1276 {"http://[::]/",S_OK
,FALSE
},
1277 {"[::]",S_OK
,FALSE
},
1278 {"http://[::]/",S_OK
,FALSE
},
1287 {"http://[::]",S_OK
,FALSE
},
1288 {"http",S_OK
,FALSE
},
1293 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1295 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1296 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1299 { "http://[FEDC:BA98::]", 0, S_OK
, FALSE
,
1300 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1301 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1302 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1305 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1306 {"[fedc:ba98::]",S_OK
,FALSE
},
1307 {"http://[fedc:ba98::]/",S_OK
,FALSE
},
1311 {"fedc:ba98::",S_OK
,FALSE
},
1316 {"http://[FEDC:BA98::]",S_OK
,FALSE
},
1317 {"http",S_OK
,FALSE
},
1322 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1324 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1325 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1328 /* Valid even with 2 byte elision because it doesn't appear the beginning or end. */
1329 { "http://[1::3:4:5:6:7:8]", 0, S_OK
, FALSE
,
1330 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1331 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1332 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1335 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1336 {"[1:0:3:4:5:6:7:8]",S_OK
,FALSE
},
1337 {"http://[1:0:3:4:5:6:7:8]/",S_OK
,FALSE
},
1341 {"1:0:3:4:5:6:7:8",S_OK
,FALSE
},
1346 {"http://[1::3:4:5:6:7:8]",S_OK
,FALSE
},
1347 {"http",S_OK
,FALSE
},
1352 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1354 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1355 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1358 { "http://[v2.34]/", 0, S_OK
, FALSE
,
1359 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1360 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1361 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1364 {"http://[v2.34]/",S_OK
,FALSE
},
1365 {"[v2.34]",S_OK
,FALSE
},
1366 {"http://[v2.34]/",S_OK
,FALSE
},
1370 {"[v2.34]",S_OK
,FALSE
},
1375 {"http://[v2.34]/",S_OK
,FALSE
},
1376 {"http",S_OK
,FALSE
},
1381 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
1383 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1384 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1387 /* Windows ignores ':' if they appear after a '[' on a non-IPLiteral host. */
1388 { "http://[xyz:12345.com/test", 0, S_OK
, FALSE
,
1389 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1390 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1391 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1394 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1395 {"[xyz:12345.com",S_OK
,FALSE
},
1396 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1397 {"[xyz:12345.com",S_OK
,FALSE
},
1400 {"[xyz:12345.com",S_OK
,FALSE
},
1402 {"/test",S_OK
,FALSE
},
1403 {"/test",S_OK
,FALSE
},
1405 {"http://[xyz:12345.com/test",S_OK
,FALSE
},
1406 {"http",S_OK
,FALSE
},
1411 {Uri_HOST_DNS
,S_OK
,FALSE
},
1413 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1414 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1417 /* Valid URI since the '[' and ']' don't appear at the beginning and end
1418 * of the host name (respectively).
1420 { "ftp://www.[works].com/", 0, S_OK
, FALSE
,
1421 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1422 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1423 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1426 {"ftp://www.[works].com/",S_OK
,FALSE
},
1427 {"www.[works].com",S_OK
,FALSE
},
1428 {"ftp://www.[works].com/",S_OK
,FALSE
},
1429 {"[works].com",S_OK
,FALSE
},
1432 {"www.[works].com",S_OK
,FALSE
},
1437 {"ftp://www.[works].com/",S_OK
,FALSE
},
1443 {Uri_HOST_DNS
,S_OK
,FALSE
},
1445 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1446 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1449 /* Considers ':' a delimiter since it appears after the ']'. */
1450 { "http://www.google.com]:12345/", 0, S_OK
, FALSE
,
1451 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1452 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1453 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1456 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1457 {"www.google.com]:12345",S_OK
,FALSE
},
1458 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1459 {"google.com]",S_OK
,FALSE
},
1462 {"www.google.com]",S_OK
,FALSE
},
1467 {"http://www.google.com]:12345/",S_OK
,FALSE
},
1468 {"http",S_OK
,FALSE
},
1473 {Uri_HOST_DNS
,S_OK
,FALSE
},
1475 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1476 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1479 /* Unknown scheme types can have invalid % encoded data in the hostname. */
1480 { "zip://w%XXw%GEw.google.com/", 0, S_OK
, FALSE
,
1481 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1482 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1483 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1486 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1487 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1488 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1489 {"google.com",S_OK
,FALSE
},
1492 {"w%XXw%GEw.google.com",S_OK
,FALSE
},
1497 {"zip://w%XXw%GEw.google.com/",S_OK
,FALSE
},
1503 {Uri_HOST_DNS
,S_OK
,FALSE
},
1505 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1506 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1509 /* Unknown scheme types hostname doesn't get lower cased. */
1510 { "zip://GOOGLE.com/", 0, S_OK
, FALSE
,
1511 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1512 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1513 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1516 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1517 {"GOOGLE.com",S_OK
,FALSE
},
1518 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1519 {"GOOGLE.com",S_OK
,FALSE
},
1522 {"GOOGLE.com",S_OK
,FALSE
},
1527 {"zip://GOOGLE.com/",S_OK
,FALSE
},
1533 {Uri_HOST_DNS
,S_OK
,FALSE
},
1535 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1536 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1539 /* Hostname get's lower cased for known scheme types. */
1540 { "http://WWW.GOOGLE.com/", 0, S_OK
, FALSE
,
1541 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1542 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1543 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1546 {"http://www.google.com/",S_OK
,FALSE
},
1547 {"www.google.com",S_OK
,FALSE
},
1548 {"http://www.google.com/",S_OK
,FALSE
},
1549 {"google.com",S_OK
,FALSE
},
1552 {"www.google.com",S_OK
,FALSE
},
1557 {"http://WWW.GOOGLE.com/",S_OK
,FALSE
},
1558 {"http",S_OK
,FALSE
},
1563 {Uri_HOST_DNS
,S_OK
,FALSE
},
1565 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1566 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1569 /* Characters that get % encoded in the hostname also have their percent
1570 * encoded forms lower cased.
1572 { "http://www.%7Cgoogle|.com/", 0, S_OK
, FALSE
,
1573 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1574 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1575 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1578 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1579 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1580 {"http://www.%7cgoogle%7c.com/",S_OK
,FALSE
},
1581 {"%7cgoogle%7c.com",S_OK
,FALSE
},
1584 {"www.%7cgoogle%7c.com",S_OK
,FALSE
},
1589 {"http://www.%7Cgoogle|.com/",S_OK
,FALSE
},
1590 {"http",S_OK
,FALSE
},
1595 {Uri_HOST_DNS
,S_OK
,FALSE
},
1597 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1598 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1601 /* IPv4 addresses attached to IPv6 can be included in elisions. */
1602 { "http://[1:2:3:4:5:6:0.0.0.0]", 0, S_OK
, FALSE
,
1603 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1604 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1605 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1608 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1609 {"[1:2:3:4:5:6::]",S_OK
,FALSE
},
1610 {"http://[1:2:3:4:5:6::]/",S_OK
,FALSE
},
1614 {"1:2:3:4:5:6::",S_OK
,FALSE
},
1619 {"http://[1:2:3:4:5:6:0.0.0.0]",S_OK
,FALSE
},
1620 {"http",S_OK
,FALSE
},
1625 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1627 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1628 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1631 /* IPv4 addresses get normalized. */
1632 { "http://[::001.002.003.000]", 0, S_OK
, FALSE
,
1633 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1634 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1635 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1638 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1639 {"[::1.2.3.0]",S_OK
,FALSE
},
1640 {"http://[::1.2.3.0]/",S_OK
,FALSE
},
1644 {"::1.2.3.0",S_OK
,FALSE
},
1649 {"http://[::001.002.003.000]",S_OK
,FALSE
},
1650 {"http",S_OK
,FALSE
},
1655 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1657 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1658 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1661 /* Windows doesn't do anything to IPv6's in unknown schemes. */
1662 { "zip://[0001:0:000:0004:0005:0006:001.002.003.000]", 0, S_OK
, FALSE
,
1663 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1664 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1665 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1668 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1669 {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1670 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK
,FALSE
},
1674 {"0001:0:000:0004:0005:0006:001.002.003.000",S_OK
,FALSE
},
1679 {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK
,FALSE
},
1685 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1687 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1688 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1691 /* IPv4 address is converted into 2 h16 components. */
1692 { "http://[ffff::192.222.111.32]", 0, S_OK
, FALSE
,
1693 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1694 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1695 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1698 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1699 {"[ffff::c0de:6f20]",S_OK
,FALSE
},
1700 {"http://[ffff::c0de:6f20]/",S_OK
,FALSE
},
1704 {"ffff::c0de:6f20",S_OK
,FALSE
},
1709 {"http://[ffff::192.222.111.32]",S_OK
,FALSE
},
1710 {"http",S_OK
,FALSE
},
1715 {Uri_HOST_IPV6
,S_OK
,FALSE
},
1717 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1718 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1721 /* Max value for a port. */
1722 { "http://google.com:65535", 0, S_OK
, FALSE
,
1723 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1724 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1725 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1728 {"http://google.com:65535/",S_OK
,FALSE
},
1729 {"google.com:65535",S_OK
,FALSE
},
1730 {"http://google.com:65535/",S_OK
,FALSE
},
1731 {"google.com",S_OK
,FALSE
},
1734 {"google.com",S_OK
,FALSE
},
1739 {"http://google.com:65535",S_OK
,FALSE
},
1740 {"http",S_OK
,FALSE
},
1745 {Uri_HOST_DNS
,S_OK
,FALSE
},
1747 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1748 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1751 { "zip://google.com:65536", 0, S_OK
, FALSE
,
1752 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1753 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1754 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1757 {"zip://google.com:65536/",S_OK
,FALSE
},
1758 {"google.com:65536",S_OK
,FALSE
},
1759 {"zip://google.com:65536/",S_OK
,FALSE
},
1760 {"google.com:65536",S_OK
,FALSE
},
1763 {"google.com:65536",S_OK
,FALSE
},
1768 {"zip://google.com:65536",S_OK
,FALSE
},
1774 {Uri_HOST_DNS
,S_OK
,FALSE
},
1776 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1777 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1780 { "zip://google.com:65536:25", 0, S_OK
, FALSE
,
1781 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1782 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1783 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1786 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1787 {"google.com:65536:25",S_OK
,FALSE
},
1788 {"zip://google.com:65536:25/",S_OK
,FALSE
},
1789 {"google.com:65536:25",S_OK
,FALSE
},
1792 {"google.com:65536:25",S_OK
,FALSE
},
1797 {"zip://google.com:65536:25",S_OK
,FALSE
},
1803 {Uri_HOST_DNS
,S_OK
,FALSE
},
1805 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1806 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1809 { "zip://[::ffff]:abcd", 0, S_OK
, FALSE
,
1810 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|
1811 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1812 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1815 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1816 {"[::ffff]:abcd",S_OK
,FALSE
},
1817 {"zip://[::ffff]:abcd/",S_OK
,FALSE
},
1821 {"[::ffff]:abcd",S_OK
,FALSE
},
1826 {"zip://[::ffff]:abcd",S_OK
,FALSE
},
1832 {Uri_HOST_DNS
,S_OK
,FALSE
},
1834 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1835 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1838 { "zip://127.0.0.1:abcd", 0, S_OK
, FALSE
,
1839 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1840 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1841 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1844 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1845 {"127.0.0.1:abcd",S_OK
,FALSE
},
1846 {"zip://127.0.0.1:abcd/",S_OK
,FALSE
},
1847 {"0.1:abcd",S_OK
,FALSE
},
1850 {"127.0.0.1:abcd",S_OK
,FALSE
},
1855 {"zip://127.0.0.1:abcd",S_OK
,FALSE
},
1861 {Uri_HOST_DNS
,S_OK
,FALSE
},
1863 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1864 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1867 /* Port is just copied over. */
1868 { "http://google.com:00035", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1869 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1870 Uri_HAS_HOST
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1873 {"http://google.com:00035",S_OK
,FALSE
},
1874 {"google.com:00035",S_OK
,FALSE
},
1875 {"http://google.com:00035",S_OK
,FALSE
,"http://google.com:35"},
1876 {"google.com",S_OK
,FALSE
},
1879 {"google.com",S_OK
,FALSE
},
1884 {"http://google.com:00035",S_OK
,FALSE
},
1885 {"http",S_OK
,FALSE
},
1890 {Uri_HOST_DNS
,S_OK
,FALSE
},
1892 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1893 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1896 /* Default port is copied over. */
1897 { "http://google.com:80", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
1898 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1899 Uri_HAS_HOST
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1902 {"http://google.com:80",S_OK
,FALSE
},
1903 {"google.com:80",S_OK
,FALSE
},
1904 {"http://google.com:80",S_OK
,FALSE
},
1905 {"google.com",S_OK
,FALSE
},
1908 {"google.com",S_OK
,FALSE
},
1913 {"http://google.com:80",S_OK
,FALSE
},
1914 {"http",S_OK
,FALSE
},
1919 {Uri_HOST_DNS
,S_OK
,FALSE
},
1921 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1922 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1925 { "http://google.com.uk", 0, S_OK
, FALSE
,
1926 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1927 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1928 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1931 {"http://google.com.uk/",S_OK
,FALSE
},
1932 {"google.com.uk",S_OK
,FALSE
},
1933 {"http://google.com.uk/",S_OK
,FALSE
},
1934 {"google.com.uk",S_OK
,FALSE
},
1937 {"google.com.uk",S_OK
,FALSE
},
1942 {"http://google.com.uk",S_OK
,FALSE
},
1943 {"http",S_OK
,FALSE
},
1948 {Uri_HOST_DNS
,S_OK
,FALSE
},
1950 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1951 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1954 { "http://google.com.com", 0, S_OK
, FALSE
,
1955 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1956 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1957 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1960 {"http://google.com.com/",S_OK
,FALSE
},
1961 {"google.com.com",S_OK
,FALSE
},
1962 {"http://google.com.com/",S_OK
,FALSE
},
1963 {"com.com",S_OK
,FALSE
},
1966 {"google.com.com",S_OK
,FALSE
},
1971 {"http://google.com.com",S_OK
,FALSE
},
1972 {"http",S_OK
,FALSE
},
1977 {Uri_HOST_DNS
,S_OK
,FALSE
},
1979 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
1980 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1983 { "http://google.uk.1", 0, S_OK
, FALSE
,
1984 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1985 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1986 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1989 {"http://google.uk.1/",S_OK
,FALSE
},
1990 {"google.uk.1",S_OK
,FALSE
},
1991 {"http://google.uk.1/",S_OK
,FALSE
},
1992 {"google.uk.1",S_OK
,FALSE
},
1995 {"google.uk.1",S_OK
,FALSE
},
2000 {"http://google.uk.1",S_OK
,FALSE
},
2001 {"http",S_OK
,FALSE
},
2006 {Uri_HOST_DNS
,S_OK
,FALSE
},
2008 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2009 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2012 /* Since foo isn't a recognized 3 character TLD its considered the domain name. */
2013 { "http://google.foo.uk", 0, S_OK
, FALSE
,
2014 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
2015 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2016 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2019 {"http://google.foo.uk/",S_OK
,FALSE
},
2020 {"google.foo.uk",S_OK
,FALSE
},
2021 {"http://google.foo.uk/",S_OK
,FALSE
},
2022 {"foo.uk",S_OK
,FALSE
},
2025 {"google.foo.uk",S_OK
,FALSE
},
2030 {"http://google.foo.uk",S_OK
,FALSE
},
2031 {"http",S_OK
,FALSE
},
2036 {Uri_HOST_DNS
,S_OK
,FALSE
},
2038 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2039 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2042 { "http://.com", 0, S_OK
, FALSE
,
2043 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
2044 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2045 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2048 {"http://.com/",S_OK
,FALSE
},
2049 {".com",S_OK
,FALSE
},
2050 {"http://.com/",S_OK
,FALSE
},
2051 {".com",S_OK
,FALSE
},
2054 {".com",S_OK
,FALSE
},
2059 {"http://.com",S_OK
,FALSE
},
2060 {"http",S_OK
,FALSE
},
2065 {Uri_HOST_DNS
,S_OK
,FALSE
},
2067 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2068 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2071 { "http://.uk", 0, S_OK
, FALSE
,
2072 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2073 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2074 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2077 {"http://.uk/",S_OK
,FALSE
},
2079 {"http://.uk/",S_OK
,FALSE
},
2088 {"http://.uk",S_OK
,FALSE
},
2089 {"http",S_OK
,FALSE
},
2094 {Uri_HOST_DNS
,S_OK
,FALSE
},
2096 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2097 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2100 { "http://www.co.google.com.[]", 0, S_OK
, FALSE
,
2101 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
2102 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2103 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2106 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2107 {"www.co.google.com.[]",S_OK
,FALSE
},
2108 {"http://www.co.google.com.[]/",S_OK
,FALSE
},
2109 {"google.com.[]",S_OK
,FALSE
},
2112 {"www.co.google.com.[]",S_OK
,FALSE
},
2117 {"http://www.co.google.com.[]",S_OK
,FALSE
},
2118 {"http",S_OK
,FALSE
},
2123 {Uri_HOST_DNS
,S_OK
,FALSE
},
2125 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2126 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2129 { "http://co.uk", 0, S_OK
, FALSE
,
2130 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2131 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2132 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2135 {"http://co.uk/",S_OK
,FALSE
},
2136 {"co.uk",S_OK
,FALSE
},
2137 {"http://co.uk/",S_OK
,FALSE
},
2141 {"co.uk",S_OK
,FALSE
},
2146 {"http://co.uk",S_OK
,FALSE
},
2147 {"http",S_OK
,FALSE
},
2152 {Uri_HOST_DNS
,S_OK
,FALSE
},
2154 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2155 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2158 { "http://www.co.google.us.test", 0, S_OK
, FALSE
,
2159 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
2160 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2161 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2164 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2165 {"www.co.google.us.test",S_OK
,FALSE
},
2166 {"http://www.co.google.us.test/",S_OK
,FALSE
},
2167 {"us.test",S_OK
,FALSE
},
2170 {"www.co.google.us.test",S_OK
,FALSE
},
2175 {"http://www.co.google.us.test",S_OK
,FALSE
},
2176 {"http",S_OK
,FALSE
},
2181 {Uri_HOST_DNS
,S_OK
,FALSE
},
2183 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2184 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2187 { "http://gov.uk", 0, S_OK
, FALSE
,
2188 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2189 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2190 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2193 {"http://gov.uk/",S_OK
,FALSE
},
2194 {"gov.uk",S_OK
,FALSE
},
2195 {"http://gov.uk/",S_OK
,FALSE
},
2199 {"gov.uk",S_OK
,FALSE
},
2204 {"http://gov.uk",S_OK
,FALSE
},
2205 {"http",S_OK
,FALSE
},
2210 {Uri_HOST_DNS
,S_OK
,FALSE
},
2212 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2213 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2216 { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2217 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
2218 Uri_HAS_HOST
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2221 {"zip://www.google.com\\test",S_OK
,FALSE
},
2222 {"www.google.com\\test",S_OK
,FALSE
},
2223 {"zip://www.google.com\\test",S_OK
,FALSE
},
2224 {"google.com\\test",S_OK
,FALSE
},
2227 {"www.google.com\\test",S_OK
,FALSE
},
2232 {"zip://www.google.com\\test",S_OK
,FALSE
},
2238 {Uri_HOST_DNS
,S_OK
,FALSE
},
2240 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2241 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2244 { "urn:excepts:bad:%XY:encoded", 0, S_OK
, FALSE
,
2245 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2246 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2249 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2251 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2257 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2258 {"excepts:bad:%XY:encoded",S_OK
,FALSE
},
2260 {"urn:excepts:bad:%XY:encoded",S_OK
,FALSE
},
2266 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2268 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2269 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2272 /* Since the original URI doesn't contain an extra '/' before the path no % encoded values
2273 * are decoded and all '%' are encoded.
2275 { "file://C:/te%3Es%2Et/tes%t.mp3", 0, S_OK
, FALSE
,
2276 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
2277 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2280 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2282 {"file:///C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2284 {".mp3",S_OK
,FALSE
},
2288 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2289 {"/C:/te%253Es%252Et/tes%25t.mp3",S_OK
,FALSE
},
2291 {"file://C:/te%3Es%2Et/tes%t.mp3",S_OK
,FALSE
},
2292 {"file",S_OK
,FALSE
},
2297 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2299 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2300 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2303 /* Since there's a '/' in front of the drive letter, any percent encoded, non-forbidden character
2304 * is decoded and only %'s in front of invalid hex digits are encoded.
2306 { "file:///C:/te%3Es%2Et/t%23es%t.mp3", 0, S_OK
, FALSE
,
2307 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
2308 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2311 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2313 {"file:///C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2315 {".mp3",S_OK
,FALSE
},
2319 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2320 {"/C:/te%3Es.t/t#es%25t.mp3",S_OK
,FALSE
},
2322 {"file:///C:/te%3Es%2Et/t%23es%t.mp3",S_OK
,FALSE
},
2323 {"file",S_OK
,FALSE
},
2328 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2330 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2331 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2334 /* Only unreserved percent encoded characters are decoded for known schemes that aren't file. */
2335 { "http://[::001.002.003.000]/%3F%23%2E%54/test", 0, S_OK
, FALSE
,
2336 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2337 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2338 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2341 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2342 {"[::1.2.3.0]",S_OK
,FALSE
},
2343 {"http://[::1.2.3.0]/%3F%23.T/test",S_OK
,FALSE
},
2347 {"::1.2.3.0",S_OK
,FALSE
},
2349 {"/%3F%23.T/test",S_OK
,FALSE
},
2350 {"/%3F%23.T/test",S_OK
,FALSE
},
2352 {"http://[::001.002.003.000]/%3F%23%2E%54/test",S_OK
,FALSE
},
2353 {"http",S_OK
,FALSE
},
2358 {Uri_HOST_IPV6
,S_OK
,FALSE
},
2360 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2361 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2364 /* Forbidden characters are always encoded for file URIs. */
2365 { "file:///C:/\"test\"/test.mp3", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2366 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
2367 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2370 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2372 {"file:///C:/%22test%22/test.mp3",S_OK
,FALSE
},
2374 {".mp3",S_OK
,FALSE
},
2378 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2379 {"/C:/%22test%22/test.mp3",S_OK
,FALSE
},
2381 {"file:///C:/\"test\"/test.mp3",S_OK
,FALSE
},
2382 {"file",S_OK
,FALSE
},
2387 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2389 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2390 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2393 /* Forbidden characters are never encoded for unknown scheme types. */
2394 { "1234://4294967295/<|>\" test<|>", 0, S_OK
, FALSE
,
2395 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2396 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2397 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2400 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2401 {"4294967295",S_OK
,FALSE
},
2402 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2406 {"4294967295",S_OK
,FALSE
},
2408 {"/<|>\" test<|>",S_OK
,FALSE
},
2409 {"/<|>\" test<|>",S_OK
,FALSE
},
2411 {"1234://4294967295/<|>\" test<|>",S_OK
,FALSE
},
2412 {"1234",S_OK
,FALSE
},
2417 {Uri_HOST_IPV4
,S_OK
,FALSE
},
2419 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2420 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2423 /* Make sure forbidden characters are percent encoded. */
2424 { "http://gov.uk/<|> test<|>", 0, S_OK
, FALSE
,
2425 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2426 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2427 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2430 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2431 {"gov.uk",S_OK
,FALSE
},
2432 {"http://gov.uk/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2436 {"gov.uk",S_OK
,FALSE
},
2438 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2439 {"/%3C%7C%3E%20test%3C%7C%3E",S_OK
,FALSE
},
2441 {"http://gov.uk/<|> test<|>",S_OK
,FALSE
},
2442 {"http",S_OK
,FALSE
},
2447 {Uri_HOST_DNS
,S_OK
,FALSE
},
2449 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2450 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2453 { "http://gov.uk/test/../test2/././../test3/.././././", 0, S_OK
, FALSE
,
2454 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2455 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2456 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2459 {"http://gov.uk/",S_OK
,FALSE
},
2460 {"gov.uk",S_OK
,FALSE
},
2461 {"http://gov.uk/",S_OK
,FALSE
},
2465 {"gov.uk",S_OK
,FALSE
},
2470 {"http://gov.uk/test/../test2/././../test3/.././././",S_OK
,FALSE
},
2471 {"http",S_OK
,FALSE
},
2476 {Uri_HOST_DNS
,S_OK
,FALSE
},
2478 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2479 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2482 { "http://gov.uk/test/test2/../../..", 0, S_OK
, FALSE
,
2483 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2484 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2485 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2488 {"http://gov.uk/",S_OK
,FALSE
},
2489 {"gov.uk",S_OK
,FALSE
},
2490 {"http://gov.uk/",S_OK
,FALSE
},
2494 {"gov.uk",S_OK
,FALSE
},
2499 {"http://gov.uk/test/test2/../../..",S_OK
,FALSE
},
2500 {"http",S_OK
,FALSE
},
2505 {Uri_HOST_DNS
,S_OK
,FALSE
},
2507 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2508 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2511 { "http://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2512 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2513 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2514 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2517 {"http://gov.uk/",S_OK
,FALSE
},
2518 {"gov.uk",S_OK
,FALSE
},
2519 {"http://gov.uk/",S_OK
,FALSE
},
2523 {"gov.uk",S_OK
,FALSE
},
2528 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2529 {"http",S_OK
,FALSE
},
2534 {Uri_HOST_DNS
,S_OK
,FALSE
},
2536 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2537 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2540 { "file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3", 0, S_OK
, FALSE
,
2541 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
2542 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2545 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2547 {"file:///c:/foo%2520bar.mp3",S_OK
,FALSE
},
2549 {".mp3",S_OK
,FALSE
},
2553 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2554 {"/c:/foo%2520bar.mp3",S_OK
,FALSE
},
2556 {"file://c:\\tests\\../tests\\./.\\..\\foo%20bar.mp3",S_OK
,FALSE
},
2557 {"file",S_OK
,FALSE
},
2562 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2564 {URL_SCHEME_FILE
,S_OK
,FALSE
},
2565 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2568 /* Dot removal happens for unknown scheme types. */
2569 { "zip://gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2570 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
2571 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2572 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2575 {"zip://gov.uk/",S_OK
,FALSE
},
2576 {"gov.uk",S_OK
,FALSE
},
2577 {"zip://gov.uk/",S_OK
,FALSE
},
2581 {"gov.uk",S_OK
,FALSE
},
2586 {"zip://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2592 {Uri_HOST_DNS
,S_OK
,FALSE
},
2594 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2595 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2598 /* Dot removal doesn't happen if NO_CANONICALIZE is set. */
2599 { "http://gov.uk/test/test2/../../.", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2600 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
2601 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2602 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
2605 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2606 {"gov.uk",S_OK
,FALSE
},
2607 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2611 {"gov.uk",S_OK
,FALSE
},
2613 {"/test/test2/../../.",S_OK
,FALSE
},
2614 {"/test/test2/../../.",S_OK
,FALSE
},
2616 {"http://gov.uk/test/test2/../../.",S_OK
,FALSE
},
2617 {"http",S_OK
,FALSE
},
2622 {Uri_HOST_DNS
,S_OK
,FALSE
},
2624 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2625 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2628 /* Dot removal doesn't happen for wildcard scheme types. */
2629 { "*:gov.uk/test/test2/../../.", 0, S_OK
, FALSE
,
2630 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
2631 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
2632 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2635 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2636 {"gov.uk",S_OK
,FALSE
},
2637 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2641 {"gov.uk",S_OK
,FALSE
},
2643 {"/test/test2/../../.",S_OK
,FALSE
},
2644 {"/test/test2/../../.",S_OK
,FALSE
},
2646 {"*:gov.uk/test/test2/../../.",S_OK
,FALSE
},
2652 {Uri_HOST_DNS
,S_OK
,FALSE
},
2654 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
2655 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2658 /* Forbidden characters are encoded for opaque known scheme types. */
2659 { "mailto:\"acco<|>unt@example.com\"", 0, S_OK
, FALSE
,
2660 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2661 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2664 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2666 {"mailto:%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2668 {".com%22",S_OK
,FALSE
},
2672 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2673 {"%22acco%3C%7C%3Eunt@example.com%22",S_OK
,FALSE
},
2675 {"mailto:\"acco<|>unt@example.com\"",S_OK
,FALSE
},
2676 {"mailto",S_OK
,FALSE
},
2681 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2683 {URL_SCHEME_MAILTO
,S_OK
,FALSE
},
2684 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2687 { "news:test.tes<|>t.com", 0, S_OK
, FALSE
,
2688 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2689 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2692 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2694 {"news:test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2696 {".com",S_OK
,FALSE
},
2700 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2701 {"test.tes%3C%7C%3Et.com",S_OK
,FALSE
},
2703 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2704 {"news",S_OK
,FALSE
},
2709 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2711 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2712 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2715 /* Don't encode forbidden characters. */
2716 { "news:test.tes<|>t.com", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2717 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2718 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2721 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2723 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2725 {".com",S_OK
,FALSE
},
2729 {"test.tes<|>t.com",S_OK
,FALSE
},
2730 {"test.tes<|>t.com",S_OK
,FALSE
},
2732 {"news:test.tes<|>t.com",S_OK
,FALSE
},
2733 {"news",S_OK
,FALSE
},
2738 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2740 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2741 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2744 /* Forbidden characters aren't encoded for unknown, opaque URIs. */
2745 { "urn:test.tes<|>t.com", 0, S_OK
, FALSE
,
2746 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2747 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2750 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2752 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2754 {".com",S_OK
,FALSE
},
2758 {"test.tes<|>t.com",S_OK
,FALSE
},
2759 {"test.tes<|>t.com",S_OK
,FALSE
},
2761 {"urn:test.tes<|>t.com",S_OK
,FALSE
},
2767 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2769 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2770 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2773 /* Percent encoded unreserved characters are decoded for known opaque URIs. */
2774 { "news:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2775 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2776 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2779 {"news:test.test.com",S_OK
,FALSE
},
2781 {"news:test.test.com",S_OK
,FALSE
},
2783 {".com",S_OK
,FALSE
},
2787 {"test.test.com",S_OK
,FALSE
},
2788 {"test.test.com",S_OK
,FALSE
},
2790 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2791 {"news",S_OK
,FALSE
},
2796 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2798 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2799 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2802 /* Percent encoded characters are still decoded for known scheme types. */
2803 { "news:test.%74%65%73%74.com", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
2804 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2805 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2808 {"news:test.test.com",S_OK
,FALSE
},
2810 {"news:test.test.com",S_OK
,FALSE
},
2812 {".com",S_OK
,FALSE
},
2816 {"test.test.com",S_OK
,FALSE
},
2817 {"test.test.com",S_OK
,FALSE
},
2819 {"news:test.%74%65%73%74.com",S_OK
,FALSE
},
2820 {"news",S_OK
,FALSE
},
2825 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2827 {URL_SCHEME_NEWS
,S_OK
,FALSE
},
2828 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2831 /* Percent encoded characters aren't decoded for unknown scheme types. */
2832 { "urn:test.%74%65%73%74.com", 0, S_OK
, FALSE
,
2833 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
2834 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2837 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2839 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2841 {".com",S_OK
,FALSE
},
2845 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2846 {"test.%74%65%73%74.com",S_OK
,FALSE
},
2848 {"urn:test.%74%65%73%74.com",S_OK
,FALSE
},
2854 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
2856 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2857 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
2860 /* Unknown scheme types can have invalid % encoded data in query string. */
2861 { "zip://www.winehq.org/tests/..?query=%xx&return=y", 0, S_OK
, FALSE
,
2862 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
2863 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
2864 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2867 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2868 {"www.winehq.org",S_OK
,FALSE
},
2869 {"zip://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2870 {"winehq.org",S_OK
,FALSE
},
2873 {"www.winehq.org",S_OK
,FALSE
},
2876 {"/?query=%xx&return=y",S_OK
,FALSE
},
2877 {"?query=%xx&return=y",S_OK
,FALSE
},
2878 {"zip://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2884 {Uri_HOST_DNS
,S_OK
,FALSE
},
2886 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
2887 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2890 /* Known scheme types can have invalid % encoded data with the right flags. */
2891 { "http://www.winehq.org/tests/..?query=%xx&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2892 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
2893 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
2894 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2897 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2898 {"www.winehq.org",S_OK
,FALSE
},
2899 {"http://www.winehq.org/?query=%xx&return=y",S_OK
,FALSE
},
2900 {"winehq.org",S_OK
,FALSE
},
2903 {"www.winehq.org",S_OK
,FALSE
},
2906 {"/?query=%xx&return=y",S_OK
,FALSE
},
2907 {"?query=%xx&return=y",S_OK
,FALSE
},
2908 {"http://www.winehq.org/tests/..?query=%xx&return=y",S_OK
,FALSE
},
2909 {"http",S_OK
,FALSE
},
2914 {Uri_HOST_DNS
,S_OK
,FALSE
},
2916 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2917 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2920 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2921 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
2922 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
2923 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
2924 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2927 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2928 {"www.winehq.org",S_OK
,FALSE
},
2929 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2930 {"winehq.org",S_OK
,FALSE
},
2933 {"www.winehq.org",S_OK
,FALSE
},
2936 {"/?query=<|>&return=y",S_OK
,FALSE
},
2937 {"?query=<|>&return=y",S_OK
,FALSE
},
2938 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2939 {"http",S_OK
,FALSE
},
2944 {Uri_HOST_DNS
,S_OK
,FALSE
},
2946 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2947 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2950 /* Forbidden characters in query aren't percent encoded for known scheme types with this flag. */
2951 { "http://www.winehq.org/tests/..?query=<|>&return=y", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
2952 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
2953 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
2954 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2957 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2958 {"www.winehq.org",S_OK
,FALSE
},
2959 {"http://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
2960 {"winehq.org",S_OK
,FALSE
},
2963 {"www.winehq.org",S_OK
,FALSE
},
2966 {"/?query=<|>&return=y",S_OK
,FALSE
},
2967 {"?query=<|>&return=y",S_OK
,FALSE
},
2968 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2969 {"http",S_OK
,FALSE
},
2974 {Uri_HOST_DNS
,S_OK
,FALSE
},
2976 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
2977 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
2980 /* Forbidden characters are encoded for known scheme types. */
2981 { "http://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
2982 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
2983 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
2984 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
2987 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2988 {"www.winehq.org",S_OK
,FALSE
},
2989 {"http://www.winehq.org/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2990 {"winehq.org",S_OK
,FALSE
},
2993 {"www.winehq.org",S_OK
,FALSE
},
2996 {"/?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2997 {"?query=%3C%7C%3E&return=y",S_OK
,FALSE
},
2998 {"http://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
2999 {"http",S_OK
,FALSE
},
3004 {Uri_HOST_DNS
,S_OK
,FALSE
},
3006 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3007 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3010 /* Forbidden characters are not encoded for unknown scheme types. */
3011 { "zip://www.winehq.org/tests/..?query=<|>&return=y", 0, S_OK
, FALSE
,
3012 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
3013 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
3014 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3017 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
3018 {"www.winehq.org",S_OK
,FALSE
},
3019 {"zip://www.winehq.org/?query=<|>&return=y",S_OK
,FALSE
},
3020 {"winehq.org",S_OK
,FALSE
},
3023 {"www.winehq.org",S_OK
,FALSE
},
3026 {"/?query=<|>&return=y",S_OK
,FALSE
},
3027 {"?query=<|>&return=y",S_OK
,FALSE
},
3028 {"zip://www.winehq.org/tests/..?query=<|>&return=y",S_OK
,FALSE
},
3034 {Uri_HOST_DNS
,S_OK
,FALSE
},
3036 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3037 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3040 /* Percent encoded, unreserved characters are decoded for known scheme types. */
3041 { "http://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
3042 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
3043 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
3044 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3047 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
3048 {"www.winehq.org",S_OK
,FALSE
},
3049 {"http://www.winehq.org/?query=01&return=y",S_OK
,FALSE
},
3050 {"winehq.org",S_OK
,FALSE
},
3053 {"www.winehq.org",S_OK
,FALSE
},
3056 {"/?query=01&return=y",S_OK
,FALSE
},
3057 {"?query=01&return=y",S_OK
,FALSE
},
3058 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
3059 {"http",S_OK
,FALSE
},
3064 {Uri_HOST_DNS
,S_OK
,FALSE
},
3066 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3067 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3070 /* Percent encoded, unreserved characters aren't decoded for unknown scheme types. */
3071 { "zip://www.winehq.org/tests/..?query=%30%31&return=y", 0, S_OK
, FALSE
,
3072 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
3073 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
3074 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3077 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3078 {"www.winehq.org",S_OK
,FALSE
},
3079 {"zip://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3080 {"winehq.org",S_OK
,FALSE
},
3083 {"www.winehq.org",S_OK
,FALSE
},
3086 {"/?query=%30%31&return=y",S_OK
,FALSE
},
3087 {"?query=%30%31&return=y",S_OK
,FALSE
},
3088 {"zip://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
3094 {Uri_HOST_DNS
,S_OK
,FALSE
},
3096 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3097 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3100 /* Percent encoded characters aren't decoded when NO_DECODE_EXTRA_INFO is set. */
3101 { "http://www.winehq.org/tests/..?query=%30%31&return=y", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3102 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
3103 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
3104 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3107 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3108 {"www.winehq.org",S_OK
,FALSE
},
3109 {"http://www.winehq.org/?query=%30%31&return=y",S_OK
,FALSE
},
3110 {"winehq.org",S_OK
,FALSE
},
3113 {"www.winehq.org",S_OK
,FALSE
},
3116 {"/?query=%30%31&return=y",S_OK
,FALSE
},
3117 {"?query=%30%31&return=y",S_OK
,FALSE
},
3118 {"http://www.winehq.org/tests/..?query=%30%31&return=y",S_OK
,FALSE
},
3119 {"http",S_OK
,FALSE
},
3124 {Uri_HOST_DNS
,S_OK
,FALSE
},
3126 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3127 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3130 { "http://www.winehq.org?query=12&return=y", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3131 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
3132 Uri_HAS_DOMAIN
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_PORT
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
3133 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3136 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3137 {"www.winehq.org",S_OK
,FALSE
},
3138 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3139 {"winehq.org",S_OK
,FALSE
},
3142 {"www.winehq.org",S_OK
,FALSE
},
3145 {"?query=12&return=y",S_OK
,FALSE
},
3146 {"?query=12&return=y",S_OK
,FALSE
},
3147 {"http://www.winehq.org?query=12&return=y",S_OK
,FALSE
},
3148 {"http",S_OK
,FALSE
},
3153 {Uri_HOST_DNS
,S_OK
,FALSE
},
3155 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3156 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3159 /* Unknown scheme types can have invalid % encoded data in fragments. */
3160 { "zip://www.winehq.org/tests/#Te%xx", 0, S_OK
, FALSE
,
3161 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3162 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3163 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3166 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3167 {"www.winehq.org",S_OK
,FALSE
},
3168 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3169 {"winehq.org",S_OK
,FALSE
},
3171 {"#Te%xx",S_OK
,FALSE
},
3172 {"www.winehq.org",S_OK
,FALSE
},
3174 {"/tests/",S_OK
,FALSE
},
3175 {"/tests/",S_OK
,FALSE
},
3177 {"zip://www.winehq.org/tests/#Te%xx",S_OK
,FALSE
},
3183 {Uri_HOST_DNS
,S_OK
,FALSE
},
3185 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3186 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3189 /* Forbidden characters in fragment aren't encoded for unknown schemes. */
3190 { "zip://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
3191 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3192 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3193 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3196 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3197 {"www.winehq.org",S_OK
,FALSE
},
3198 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3199 {"winehq.org",S_OK
,FALSE
},
3201 {"#Te<|>",S_OK
,FALSE
},
3202 {"www.winehq.org",S_OK
,FALSE
},
3204 {"/tests/",S_OK
,FALSE
},
3205 {"/tests/",S_OK
,FALSE
},
3207 {"zip://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3213 {Uri_HOST_DNS
,S_OK
,FALSE
},
3215 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3216 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3219 /* Forbidden characters in the fragment are percent encoded for known schemes. */
3220 { "http://www.winehq.org/tests/#Te<|>", 0, S_OK
, FALSE
,
3221 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3222 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3223 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3226 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
3227 {"www.winehq.org",S_OK
,FALSE
},
3228 {"http://www.winehq.org/tests/#Te%3C%7C%3E",S_OK
,FALSE
},
3229 {"winehq.org",S_OK
,FALSE
},
3231 {"#Te%3C%7C%3E",S_OK
,FALSE
},
3232 {"www.winehq.org",S_OK
,FALSE
},
3234 {"/tests/",S_OK
,FALSE
},
3235 {"/tests/",S_OK
,FALSE
},
3237 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3238 {"http",S_OK
,FALSE
},
3243 {Uri_HOST_DNS
,S_OK
,FALSE
},
3245 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3246 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3249 /* Forbidden characters aren't encoded in the fragment with this flag. */
3250 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3251 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3252 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3253 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3256 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3257 {"www.winehq.org",S_OK
,FALSE
},
3258 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3259 {"winehq.org",S_OK
,FALSE
},
3261 {"#Te<|>",S_OK
,FALSE
},
3262 {"www.winehq.org",S_OK
,FALSE
},
3264 {"/tests/",S_OK
,FALSE
},
3265 {"/tests/",S_OK
,FALSE
},
3267 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3268 {"http",S_OK
,FALSE
},
3273 {Uri_HOST_DNS
,S_OK
,FALSE
},
3275 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3276 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3279 /* Forbidden characters aren't encoded in the fragment with this flag. */
3280 { "http://www.winehq.org/tests/#Te<|>", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
3281 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3282 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3283 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3286 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3287 {"www.winehq.org",S_OK
,FALSE
},
3288 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3289 {"winehq.org",S_OK
,FALSE
},
3291 {"#Te<|>",S_OK
,FALSE
},
3292 {"www.winehq.org",S_OK
,FALSE
},
3294 {"/tests/",S_OK
,FALSE
},
3295 {"/tests/",S_OK
,FALSE
},
3297 {"http://www.winehq.org/tests/#Te<|>",S_OK
,FALSE
},
3298 {"http",S_OK
,FALSE
},
3303 {Uri_HOST_DNS
,S_OK
,FALSE
},
3305 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3306 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3309 /* Percent encoded, unreserved characters aren't decoded for known scheme types. */
3310 { "zip://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3311 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3312 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3313 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3316 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3317 {"www.winehq.org",S_OK
,FALSE
},
3318 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3319 {"winehq.org",S_OK
,FALSE
},
3321 {"#Te%30%31%32",S_OK
,FALSE
},
3322 {"www.winehq.org",S_OK
,FALSE
},
3324 {"/tests/",S_OK
,FALSE
},
3325 {"/tests/",S_OK
,FALSE
},
3327 {"zip://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3333 {Uri_HOST_DNS
,S_OK
,FALSE
},
3335 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3336 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3339 /* Percent encoded, unreserved characters are decoded for known schemes. */
3340 { "http://www.winehq.org/tests/#Te%30%31%32", 0, S_OK
, FALSE
,
3341 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3342 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3343 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3346 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3347 {"www.winehq.org",S_OK
,FALSE
},
3348 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3349 {"winehq.org",S_OK
,FALSE
},
3351 {"#Te012",S_OK
,FALSE
},
3352 {"www.winehq.org",S_OK
,FALSE
},
3354 {"/tests/",S_OK
,FALSE
},
3355 {"/tests/",S_OK
,FALSE
},
3357 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3358 {"http",S_OK
,FALSE
},
3363 {Uri_HOST_DNS
,S_OK
,FALSE
},
3365 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3366 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3369 /* Percent encoded, unreserved characters are decoded even if NO_CANONICALIZE is set. */
3370 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_CANONICALIZE
, S_OK
, FALSE
,
3371 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3372 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3373 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3376 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3377 {"www.winehq.org",S_OK
,FALSE
},
3378 {"http://www.winehq.org/tests/#Te012",S_OK
,FALSE
},
3379 {"winehq.org",S_OK
,FALSE
},
3381 {"#Te012",S_OK
,FALSE
},
3382 {"www.winehq.org",S_OK
,FALSE
},
3384 {"/tests/",S_OK
,FALSE
},
3385 {"/tests/",S_OK
,FALSE
},
3387 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3388 {"http",S_OK
,FALSE
},
3393 {Uri_HOST_DNS
,S_OK
,FALSE
},
3395 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3396 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3399 /* Percent encoded, unreserved characters aren't decoded when NO_DECODE_EXTRA is set. */
3400 { "http://www.winehq.org/tests/#Te%30%31%32", Uri_CREATE_NO_DECODE_EXTRA_INFO
, S_OK
, FALSE
,
3401 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_FRAGMENT
|
3402 Uri_HAS_HOST
|Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3403 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3406 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3407 {"www.winehq.org",S_OK
,FALSE
},
3408 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3409 {"winehq.org",S_OK
,FALSE
},
3411 {"#Te%30%31%32",S_OK
,FALSE
},
3412 {"www.winehq.org",S_OK
,FALSE
},
3414 {"/tests/",S_OK
,FALSE
},
3415 {"/tests/",S_OK
,FALSE
},
3417 {"http://www.winehq.org/tests/#Te%30%31%32",S_OK
,FALSE
},
3418 {"http",S_OK
,FALSE
},
3423 {Uri_HOST_DNS
,S_OK
,FALSE
},
3425 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3426 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
3429 /* Leading/Trailing whitespace is removed. */
3430 { " http://google.com/ ", 0, S_OK
, FALSE
,
3431 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
3432 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3433 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3436 {"http://google.com/",S_OK
,FALSE
},
3437 {"google.com",S_OK
,FALSE
},
3438 {"http://google.com/",S_OK
,FALSE
},
3439 {"google.com",S_OK
,FALSE
},
3442 {"google.com",S_OK
,FALSE
},
3447 {"http://google.com/",S_OK
,FALSE
},
3448 {"http",S_OK
,FALSE
},
3453 {Uri_HOST_DNS
,S_OK
,FALSE
},
3455 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3456 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3459 { "\t\t\r\nhttp\n://g\noogle.co\rm/\n\n\n", 0, S_OK
, FALSE
,
3460 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
3461 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3462 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3465 {"http://google.com/",S_OK
,FALSE
},
3466 {"google.com",S_OK
,FALSE
},
3467 {"http://google.com/",S_OK
,FALSE
},
3468 {"google.com",S_OK
,FALSE
},
3471 {"google.com",S_OK
,FALSE
},
3476 {"http://google.com/",S_OK
,FALSE
},
3477 {"http",S_OK
,FALSE
},
3482 {Uri_HOST_DNS
,S_OK
,FALSE
},
3484 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3485 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3488 { "http://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3489 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
3490 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3491 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3494 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3495 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3496 {"http://g%0aoogle.co%0dm/%0A%0A%0A",S_OK
,FALSE
},
3497 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3500 {"g%0aoogle.co%0dm",S_OK
,FALSE
},
3502 {"/%0A%0A%0A",S_OK
,FALSE
},
3503 {"/%0A%0A%0A",S_OK
,FALSE
},
3505 {"http://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3506 {"http",S_OK
,FALSE
},
3511 {Uri_HOST_DNS
,S_OK
,FALSE
},
3513 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3514 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3517 { "zip://g\noogle.co\rm/\n\n\n", Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, S_OK
, FALSE
,
3518 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
3519 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
3520 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3523 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3524 {"g\noogle.co\rm",S_OK
,FALSE
},
3525 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3526 {"g\noogle.co\rm",S_OK
,FALSE
},
3529 {"g\noogle.co\rm",S_OK
,FALSE
},
3531 {"/\n\n\n",S_OK
,FALSE
},
3532 {"/\n\n\n",S_OK
,FALSE
},
3534 {"zip://g\noogle.co\rm/\n\n\n",S_OK
,FALSE
},
3540 {Uri_HOST_DNS
,S_OK
,FALSE
},
3542 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3543 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3546 /* Since file URLs are usually hierarchical, it returns an empty string
3547 * for the absolute URI property since it was declared as an opaque URI.
3549 { "file:index.html", 0, S_OK
, FALSE
,
3550 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
3551 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
, FALSE
,
3555 {"file:index.html",S_OK
,FALSE
},
3557 {".html",S_OK
,FALSE
},
3561 {"index.html",S_OK
,FALSE
},
3562 {"index.html",S_OK
,FALSE
},
3564 {"file:index.html",S_OK
,FALSE
},
3565 {"file",S_OK
,FALSE
},
3572 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3573 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3576 /* Doesn't have an absolute since it's opaque, but gets it port set. */
3577 { "http:test.com/index.html", 0, S_OK
, FALSE
,
3578 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
3579 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
, FALSE
,
3583 {"http:test.com/index.html",S_OK
,FALSE
},
3585 {".html",S_OK
,FALSE
},
3589 {"test.com/index.html",S_OK
,FALSE
},
3590 {"test.com/index.html",S_OK
,FALSE
},
3592 {"http:test.com/index.html",S_OK
,FALSE
},
3593 {"http",S_OK
,FALSE
},
3598 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3600 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3601 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3604 { "ftp:test.com/index.html", 0, S_OK
, FALSE
,
3605 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
3606 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
, FALSE
,
3610 {"ftp:test.com/index.html",S_OK
,FALSE
},
3612 {".html",S_OK
,FALSE
},
3616 {"test.com/index.html",S_OK
,FALSE
},
3617 {"test.com/index.html",S_OK
,FALSE
},
3619 {"ftp:test.com/index.html",S_OK
,FALSE
},
3625 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3627 {URL_SCHEME_FTP
,S_OK
,FALSE
},
3628 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3631 { "file://C|/test.mp3", 0, S_OK
, FALSE
,
3632 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
3633 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3636 {"file:///C:/test.mp3",S_OK
,FALSE
},
3638 {"file:///C:/test.mp3",S_OK
,FALSE
},
3640 {".mp3",S_OK
,FALSE
},
3644 {"/C:/test.mp3",S_OK
,FALSE
},
3645 {"/C:/test.mp3",S_OK
,FALSE
},
3647 {"file://C|/test.mp3",S_OK
,FALSE
},
3648 {"file",S_OK
,FALSE
},
3653 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3655 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3656 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3659 { "file:///C|/test.mp3", 0, S_OK
, FALSE
,
3660 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
3661 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
3664 {"file:///C:/test.mp3",S_OK
,FALSE
},
3666 {"file:///C:/test.mp3",S_OK
,FALSE
},
3668 {".mp3",S_OK
,FALSE
},
3672 {"/C:/test.mp3",S_OK
,FALSE
},
3673 {"/C:/test.mp3",S_OK
,FALSE
},
3675 {"file:///C|/test.mp3",S_OK
,FALSE
},
3676 {"file",S_OK
,FALSE
},
3681 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3683 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3684 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3687 /* Extra '/' isn't added before "c:" since USE_DOS_PATH is set and '/' are converted
3690 { "file://c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3691 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3692 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3693 |Uri_HAS_SCHEME
, FALSE
,
3695 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3697 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3699 {".html",S_OK
,FALSE
},
3703 {"c:\\dir\\index.html",S_OK
,FALSE
},
3704 {"c:\\dir\\index.html",S_OK
,FALSE
},
3706 {"file://c:/dir/index.html",S_OK
,FALSE
},
3707 {"file",S_OK
,FALSE
},
3714 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3715 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3718 /* Extra '/' after "file://" is removed. */
3719 { "file:///c:/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3720 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3721 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3722 |Uri_HAS_SCHEME
, FALSE
,
3724 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3726 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3728 {".html",S_OK
,FALSE
},
3732 {"c:\\dir\\index.html",S_OK
,FALSE
},
3733 {"c:\\dir\\index.html",S_OK
,FALSE
},
3735 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3736 {"file",S_OK
,FALSE
},
3743 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3744 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3747 { "file://c|/dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3748 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3749 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3750 |Uri_HAS_SCHEME
, FALSE
,
3752 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3754 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3756 {".html",S_OK
,FALSE
},
3760 {"c:\\dir\\index.html",S_OK
,FALSE
},
3761 {"c:\\dir\\index.html",S_OK
,FALSE
},
3763 {"file://c|/dir\\index.html",S_OK
,FALSE
},
3764 {"file",S_OK
,FALSE
},
3771 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3772 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3775 /* The backslashes after the scheme name are converted to forward slashes. */
3776 { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3777 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3778 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3779 |Uri_HAS_SCHEME
, FALSE
,
3781 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3783 {"file://c:\\dir\\index.html",S_OK
,FALSE
},
3785 {".html",S_OK
,FALSE
},
3789 {"c:\\dir\\index.html",S_OK
,FALSE
},
3790 {"c:\\dir\\index.html",S_OK
,FALSE
},
3792 {"file:\\\\c:\\dir\\index.html",S_OK
,FALSE
},
3793 {"file",S_OK
,FALSE
},
3800 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3801 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3804 { "file:\\\\c:/dir/index.html", 0, S_OK
, FALSE
,
3805 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3806 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3807 |Uri_HAS_SCHEME
, FALSE
,
3809 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3811 {"file:///c:/dir/index.html",S_OK
,FALSE
},
3813 {".html",S_OK
,FALSE
},
3817 {"/c:/dir/index.html",S_OK
,FALSE
},
3818 {"/c:/dir/index.html",S_OK
,FALSE
},
3820 {"file:\\\\c:/dir/index.html",S_OK
,FALSE
},
3821 {"file",S_OK
,FALSE
},
3828 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3829 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3832 { "http:\\\\google.com", 0, S_OK
, FALSE
,
3833 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
3834 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
3835 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
3838 {"http://google.com/",S_OK
,FALSE
},
3839 {"google.com",S_OK
,FALSE
},
3840 {"http://google.com/",S_OK
,FALSE
},
3841 {"google.com",S_OK
,FALSE
},
3844 {"google.com",S_OK
,FALSE
},
3849 {"http:\\\\google.com",S_OK
,FALSE
},
3850 {"http",S_OK
,FALSE
},
3855 {Uri_HOST_DNS
,S_OK
,FALSE
},
3857 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
3858 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3861 /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */
3862 { "zip:\\\\google.com", 0, S_OK
, FALSE
,
3863 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
3864 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_SCHEME
|
3868 {"zip:\\\\google.com",S_OK
,FALSE
},
3870 {"zip:\\\\google.com",S_OK
,FALSE
},
3872 {".com",S_OK
,FALSE
},
3876 {"\\\\google.com",S_OK
,FALSE
},
3877 {"\\\\google.com",S_OK
,FALSE
},
3879 {"zip:\\\\google.com",S_OK
,FALSE
},
3885 {Uri_HOST_UNKNOWN
,S_OK
,FALSE
},
3887 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
3888 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3891 /* Dot segements aren't removed. */
3892 { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3893 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3894 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3895 |Uri_HAS_SCHEME
, FALSE
,
3897 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3899 {"file://c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3901 {".html",S_OK
,FALSE
},
3905 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3906 {"c:\\dir\\..\\..\\.\\index.html",S_OK
,FALSE
},
3908 {"file://c:\\dir\\../..\\./index.html",S_OK
,FALSE
},
3909 {"file",S_OK
,FALSE
},
3916 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3917 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3920 /* Forbidden characters aren't percent encoded. */
3921 { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3922 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
3923 |Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
3924 |Uri_HAS_SCHEME
, FALSE
,
3926 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3928 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3930 {".html",S_OK
,FALSE
},
3934 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3935 {"c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3937 {"file://c:\\dir\\i^|ndex.html",S_OK
,FALSE
},
3938 {"file",S_OK
,FALSE
},
3945 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3946 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3949 /* The '\' are still converted to '/' even though it's an opaque file URI. */
3950 { "file:c:\\dir\\../..\\index.html", 0, S_OK
, FALSE
,
3951 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
3952 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
, FALSE
,
3956 {"file:c:/dir/../../index.html",S_OK
,FALSE
},
3958 {".html",S_OK
,FALSE
},
3962 {"c:/dir/../../index.html",S_OK
,FALSE
},
3963 {"c:/dir/../../index.html",S_OK
,FALSE
},
3965 {"file:c:\\dir\\../..\\index.html",S_OK
,FALSE
},
3966 {"file",S_OK
,FALSE
},
3973 {URL_SCHEME_FILE
,S_OK
,FALSE
},
3974 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
3977 /* '/' are still converted to '\' even though it's an opaque URI. */
3978 { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
3979 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
3980 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
, FALSE
,
3984 {"file:c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3986 {".html",S_OK
,FALSE
},
3990 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3991 {"c:\\dir\\..\\..\\index.html",S_OK
,FALSE
},
3993 {"file:c:/dir\\../..\\index.html",S_OK
,FALSE
},
3994 {"file",S_OK
,FALSE
},
4001 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4002 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4005 /* Forbidden characters aren't percent encoded. */
4006 { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH
, S_OK
, FALSE
,
4007 Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
4008 |Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
, FALSE
,
4012 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
4014 {".html",S_OK
,FALSE
},
4018 {"c:\\in^|dex.html",S_OK
,FALSE
},
4019 {"c:\\in^|dex.html",S_OK
,FALSE
},
4021 {"file:c:\\in^|dex.html",S_OK
,FALSE
},
4022 {"file",S_OK
,FALSE
},
4029 {URL_SCHEME_FILE
,S_OK
,FALSE
},
4030 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
4035 typedef struct _invalid_uri
{
4041 static const invalid_uri invalid_uri_tests
[] = {
4042 /* Has to have a scheme name. */
4043 {"://www.winehq.org",0,FALSE
},
4044 /* Window's doesn't like URI's which are implicitly file paths without the
4045 * ALLOW_IMPLICIT_FILE_SCHEME flag set.
4047 {"C:/test/test.mp3",0,FALSE
},
4048 {"\\\\Server/test/test.mp3",0,FALSE
},
4049 {"C:/test/test.mp3",Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
,FALSE
},
4050 {"\\\\Server/test/test.mp3",Uri_CREATE_ALLOW_RELATIVE
,FALSE
},
4051 /* Invalid schemes. */
4052 {"*abcd://not.valid.com",0,FALSE
},
4053 {"*a*b*c*d://not.valid.com",0,FALSE
},
4054 /* Not allowed to have invalid % encoded data. */
4055 {"ftp://google.co%XX/",0,FALSE
},
4056 /* To many h16 components. */
4057 {"http://[1:2:3:4:5:6:7:8:9]",0,FALSE
},
4058 /* Not enough room for IPv4 address. */
4059 {"http://[1:2:3:4:5:6:7:192.0.1.0]",0,FALSE
},
4060 /* Not enough h16 components. */
4061 {"http://[1:2:3:4]",0,FALSE
},
4062 /* Not enough components including IPv4. */
4063 {"http://[1:192.0.1.0]",0,FALSE
},
4064 /* Not allowed to have partial IPv4 in IPv6. */
4065 {"http://[::192.0]",0,FALSE
},
4066 /* Can't have elision of 1 h16 at beginning of address. */
4067 {"http://[::2:3:4:5:6:7:8]",0,FALSE
},
4068 /* Can't have elision of 1 h16 at end of address. */
4069 {"http://[1:2:3:4:5:6:7::]",0,FALSE
},
4070 /* Expects a valid IP Literal. */
4071 {"ftp://[not.valid.uri]/",0,FALSE
},
4072 /* Expects valid port for a known scheme type. */
4073 {"ftp://www.winehq.org:123fgh",0,FALSE
},
4074 /* Port exceeds USHORT_MAX for known scheme type. */
4075 {"ftp://www.winehq.org:65536",0,FALSE
},
4076 /* Invalid port with IPv4 address. */
4077 {"http://www.winehq.org:1abcd",0,FALSE
},
4078 /* Invalid port with IPv6 address. */
4079 {"http://[::ffff]:32xy",0,FALSE
},
4080 /* Not allowed to have backslashes with NO_CANONICALIZE. */
4081 {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE
,FALSE
},
4082 /* Not allowed to have invalid % encoded data in opaque URI path. */
4083 {"news:test%XX",0,FALSE
},
4084 {"mailto:wine@winehq%G8.com",0,FALSE
},
4085 /* Known scheme types can't have invalid % encoded data in query string. */
4086 {"http://google.com/?query=te%xx",0,FALSE
},
4087 /* Invalid % encoded data in fragment of know scheme type. */
4088 {"ftp://google.com/#Test%xx",0,FALSE
},
4089 {" http://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4090 {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,FALSE
},
4091 {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4092 {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4093 {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4094 {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4095 {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
},
4096 {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH
,FALSE
}
4099 typedef struct _uri_equality
{
4101 DWORD create_flags_a
;
4104 DWORD create_flags_b
;
4110 static const uri_equality equality_tests
[] = {
4112 "HTTP://www.winehq.org/test dir/./",0,FALSE
,
4113 "http://www.winehq.org/test dir/../test dir/",0,FALSE
,
4117 /* http://www.winehq.org/test%20dir */
4118 "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
,
4119 "http://www.winehq.org/test dir",0,FALSE
,
4123 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,FALSE
,
4124 "file:///c:/test.mp3",0,FALSE
,
4128 "ftp://ftp.winehq.org/",0,FALSE
,
4129 "ftp://ftp.winehq.org",0,FALSE
,
4133 "ftp://ftp.winehq.org/test/test2/../../testB/",0,FALSE
,
4134 "ftp://ftp.winehq.org/t%45stB/",0,FALSE
,
4138 "http://google.com/TEST",0,FALSE
,
4139 "http://google.com/test",0,FALSE
,
4143 "http://GOOGLE.com/",0,FALSE
,
4144 "http://google.com/",0,FALSE
,
4147 /* Performs case insensitive compare of host names (for known scheme types). */
4149 "ftp://GOOGLE.com/",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4150 "ftp://google.com/",0,FALSE
,
4154 "zip://GOOGLE.com/",0,FALSE
,
4155 "zip://google.com/",0,FALSE
,
4159 "file:///c:/TEST/TeST/",0,FALSE
,
4160 "file:///c:/test/test/",0,FALSE
,
4164 "file:///server/TEST",0,FALSE
,
4165 "file:///SERVER/TEST",0,FALSE
,
4169 "http://google.com",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4170 "http://google.com/",0,FALSE
,
4174 "ftp://google.com:21/",0,FALSE
,
4175 "ftp://google.com/",0,FALSE
,
4179 "http://google.com:80/",Uri_CREATE_NO_CANONICALIZE
,FALSE
,
4180 "http://google.com/",0,FALSE
,
4184 "http://google.com:70/",0,FALSE
,
4185 "http://google.com:71/",0,FALSE
,
4190 typedef struct _uri_with_fragment
{
4192 const char* fragment
;
4194 HRESULT create_expected
;
4197 const char* expected_uri
;
4199 } uri_with_fragment
;
4201 static const uri_with_fragment uri_fragment_tests
[] = {
4203 "http://google.com/","#fragment",0,S_OK
,FALSE
,
4204 "http://google.com/#fragment",FALSE
4207 "http://google.com/","fragment",0,S_OK
,FALSE
,
4208 "http://google.com/#fragment",FALSE
4211 "zip://test.com/","?test",0,S_OK
,FALSE
,
4212 "zip://test.com/#?test",FALSE
4214 /* The fragment can be empty. */
4216 "ftp://ftp.google.com/","",0,S_OK
,FALSE
,
4217 "ftp://ftp.google.com/#",FALSE
4221 typedef struct _uri_builder_property
{
4224 const char *expected_value
;
4225 Uri_PROPERTY property
;
4228 } uri_builder_property
;
4230 typedef struct _uri_builder_port
{
4238 typedef struct _uri_builder_test
{
4241 HRESULT create_builder_expected
;
4242 BOOL create_builder_todo
;
4244 uri_builder_property properties
[URI_BUILDER_STR_PROPERTY_COUNT
];
4246 uri_builder_port port_prop
;
4248 const char *uri_expected
;
4253 const char *uri_simple_expected
;
4254 DWORD uri_simple_encode_flags
;
4255 HRESULT uri_simple_hres
;
4256 BOOL uri_simple_todo
;
4258 const char *uri_with_expected
;
4259 DWORD uri_with_flags
;
4260 DWORD uri_with_builder_flags
;
4261 DWORD uri_with_encode_flags
;
4262 HRESULT uri_with_hres
;
4266 static const uri_builder_test uri_builder_tests
[] = {
4267 { "http://google.com/",0,S_OK
,FALSE
,
4269 {TRUE
,"#fragment",NULL
,Uri_PROPERTY_FRAGMENT
,S_OK
,TRUE
},
4270 {TRUE
,"password",NULL
,Uri_PROPERTY_PASSWORD
,S_OK
,TRUE
},
4271 {TRUE
,"?query=x",NULL
,Uri_PROPERTY_QUERY
,S_OK
,TRUE
},
4272 {TRUE
,"username",NULL
,Uri_PROPERTY_USER_NAME
,S_OK
,TRUE
}
4275 "http://username:password@google.com/?query=x#fragment",0,S_OK
,TRUE
,
4276 "http://username:password@google.com/?query=x#fragment",0,S_OK
,TRUE
,
4277 "http://username:password@google.com/?query=x#fragment",0,0,0,S_OK
,TRUE
4279 { "http://google.com/",0,S_OK
,FALSE
,
4281 {TRUE
,"test",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,TRUE
}
4283 {TRUE
,TRUE
,120,S_OK
,TRUE
},
4284 "test://google.com:120/",0,S_OK
,TRUE
,
4285 "test://google.com:120/",0,S_OK
,TRUE
,
4286 "test://google.com:120/",0,0,0,S_OK
,TRUE
4288 { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE
,S_OK
,FALSE
,
4290 {TRUE
,"http",NULL
,Uri_PROPERTY_SCHEME_NAME
,S_OK
,TRUE
},
4291 {TRUE
,"::192.2.3.4",NULL
,Uri_PROPERTY_HOST
,S_OK
,TRUE
},
4292 {TRUE
,NULL
,NULL
,Uri_PROPERTY_PATH
,S_OK
,TRUE
}
4295 "http://[::192.2.3.4]/",0,S_OK
,TRUE
,
4296 "http://[::192.2.3.4]/",0,S_OK
,TRUE
,
4297 "http://[::192.2.3.4]/",0,0,0,S_OK
,TRUE
4301 typedef struct _uri_builder_remove_test
{
4304 HRESULT create_builder_expected
;
4305 BOOL create_builder_todo
;
4307 DWORD remove_properties
;
4308 HRESULT remove_expected
;
4311 const char *expected_uri
;
4312 DWORD expected_flags
;
4313 HRESULT expected_hres
;
4315 } uri_builder_remove_test
;
4317 static const uri_builder_remove_test uri_builder_remove_tests
[] = {
4318 { "http://google.com/test?test=y#Frag",0,S_OK
,FALSE
,
4319 Uri_HAS_FRAGMENT
|Uri_HAS_PATH
|Uri_HAS_QUERY
,S_OK
,TRUE
,
4320 "http://google.com/",0,S_OK
,TRUE
4322 { "http://user:pass@winehq.org/",0,S_OK
,FALSE
,
4323 Uri_HAS_USER_NAME
|Uri_HAS_PASSWORD
,S_OK
,TRUE
,
4324 "http://winehq.org/",0,S_OK
,TRUE
4326 { "zip://google.com?Test=x",0,S_OK
,FALSE
,
4327 Uri_HAS_HOST
,S_OK
,TRUE
,
4328 "zip:/?Test=x",0,S_OK
,TRUE
4332 static inline LPWSTR
a2w(LPCSTR str
) {
4336 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
4337 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
4338 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
4344 static inline BOOL
heap_free(void* mem
) {
4345 return HeapFree(GetProcessHeap(), 0, mem
);
4348 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
4349 LPWSTR strAW
= a2w(strA
);
4350 DWORD ret
= lstrcmpW(strAW
, strB
);
4355 static inline ULONG
get_refcnt(IUri
*uri
) {
4357 return IUri_Release(uri
);
4360 static void change_property(IUriBuilder
*builder
, const uri_builder_property
*prop
,
4365 valueW
= a2w(prop
->value
);
4366 switch(prop
->property
) {
4367 case Uri_PROPERTY_FRAGMENT
:
4368 hr
= IUriBuilder_SetFragment(builder
, valueW
);
4371 ok(hr
== prop
->expected
,
4372 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4373 hr
, prop
->expected
, test_index
);
4376 ok(hr
== prop
->expected
,
4377 "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4378 hr
, prop
->expected
, test_index
);
4381 case Uri_PROPERTY_HOST
:
4382 hr
= IUriBuilder_SetHost(builder
, valueW
);
4385 ok(hr
== prop
->expected
,
4386 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4387 hr
, prop
->expected
, test_index
);
4390 ok(hr
== prop
->expected
,
4391 "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4392 hr
, prop
->expected
, test_index
);
4395 case Uri_PROPERTY_PASSWORD
:
4396 hr
= IUriBuilder_SetPassword(builder
, valueW
);
4399 ok(hr
== prop
->expected
,
4400 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4401 hr
, prop
->expected
, test_index
);
4404 ok(hr
== prop
->expected
,
4405 "Error: IUriBuilder_SetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4406 hr
, prop
->expected
, test_index
);
4409 case Uri_PROPERTY_PATH
:
4410 hr
= IUriBuilder_SetPath(builder
, valueW
);
4413 ok(hr
== prop
->expected
,
4414 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4415 hr
, prop
->expected
, test_index
);
4418 ok(hr
== prop
->expected
,
4419 "Error: IUriBuilder_SetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4420 hr
, prop
->expected
, test_index
);
4423 case Uri_PROPERTY_QUERY
:
4424 hr
= IUriBuilder_SetQuery(builder
, valueW
);
4427 ok(hr
== prop
->expected
,
4428 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4429 hr
, prop
->expected
, test_index
);
4432 ok(hr
== prop
->expected
,
4433 "Error: IUriBuilder_SetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4434 hr
, prop
->expected
, test_index
);
4437 case Uri_PROPERTY_SCHEME_NAME
:
4438 hr
= IUriBuilder_SetSchemeName(builder
, valueW
);
4441 ok(hr
== prop
->expected
,
4442 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4443 hr
, prop
->expected
, test_index
);
4446 ok(hr
== prop
->expected
,
4447 "Error: IUriBuilder_SetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4448 hr
, prop
->expected
, test_index
);
4451 case Uri_PROPERTY_USER_NAME
:
4452 hr
= IUriBuilder_SetUserName(builder
, valueW
);
4455 ok(hr
== prop
->expected
,
4456 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4457 hr
, prop
->expected
, test_index
);
4460 ok(hr
== prop
->expected
,
4461 "Error: IUriBuilder_SetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
4462 hr
, prop
->expected
, test_index
);
4466 trace("Unsupported operation for %d on uri_builder_tests[%d].\n", prop
->property
, test_index
);
4473 * Simple tests to make sure the CreateUri function handles invalid flag combinations
4476 static void test_CreateUri_InvalidFlags(void) {
4479 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
4481 IUri
*uri
= (void*) 0xdeadbeef;
4483 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
4484 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
4485 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
4486 ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
);
4490 static void test_CreateUri_InvalidArgs(void) {
4492 IUri
*uri
= (void*) 0xdeadbeef;
4494 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
4496 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
4497 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
4499 hr
= pCreateUri(NULL
, 0, 0, &uri
);
4500 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
4501 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
4503 uri
= (void*) 0xdeadbeef;
4504 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
4505 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
4506 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
4509 static void test_CreateUri_InvalidUri(void) {
4512 for(i
= 0; i
< sizeof(invalid_uri_tests
)/sizeof(invalid_uri_tests
[0]); ++i
) {
4513 invalid_uri test
= invalid_uri_tests
[i
];
4518 uriW
= a2w(test
.uri
);
4519 hr
= pCreateUri(uriW
, test
.flags
, 0, &uri
);
4522 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
4523 hr
, E_INVALIDARG
, i
);
4526 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x on invalid_uri_tests[%d].\n",
4527 hr
, E_INVALIDARG
, i
);
4529 if(uri
) IUri_Release(uri
);
4535 static void test_IUri_GetPropertyBSTR(void) {
4540 /* Make sure GetPropertyBSTR handles invalid args correctly. */
4541 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
4542 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
4544 BSTR received
= NULL
;
4546 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
4547 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4549 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
4550 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
4551 ok(hr
== S_OK
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
4552 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
4553 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
4554 SysFreeString(received
);
4556 /* Make sure it handles the ZONE property correctly. */
4558 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
4559 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
4560 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
4561 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
4562 SysFreeString(received
);
4564 if(uri
) IUri_Release(uri
);
4566 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
4567 uri_properties test
= uri_tests
[i
];
4571 uriW
= a2w(test
.uri
);
4572 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
4573 if(test
.create_todo
) {
4575 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
4576 hr
, test
.create_expected
, i
);
4579 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
4580 hr
, test
.create_expected
, i
);
4586 /* Checks all the string properties of the uri. */
4587 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
4588 BSTR received
= NULL
;
4589 uri_str_property prop
= test
.str_props
[j
];
4591 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
4594 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
4595 hr
, prop
.expected
, i
, j
);
4598 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
4599 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
4600 prop
.value
, wine_dbgstr_w(received
), i
, j
);
4603 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
4604 hr
, prop
.expected
, i
, j
);
4605 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
4606 "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
4607 prop
.value
, wine_dbgstr_w(received
), i
, j
);
4610 SysFreeString(received
);
4614 if(uri
) IUri_Release(uri
);
4620 static void test_IUri_GetPropertyDWORD(void) {
4625 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
4626 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
4628 DWORD received
= 0xdeadbeef;
4630 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
4631 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
4633 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
4634 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
4635 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
4637 if(uri
) IUri_Release(uri
);
4639 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
4640 uri_properties test
= uri_tests
[i
];
4644 uriW
= a2w(test
.uri
);
4645 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
4646 if(test
.create_todo
) {
4648 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
4649 hr
, test
.create_expected
, i
);
4652 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
4653 hr
, test
.create_expected
, i
);
4659 /* Checks all the DWORD properties of the uri. */
4660 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
4662 uri_dword_property prop
= test
.dword_props
[j
];
4664 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
4667 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
4668 hr
, prop
.expected
, i
, j
);
4671 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
4672 prop
.value
, received
, i
, j
);
4675 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
4676 hr
, prop
.expected
, i
, j
);
4677 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
4678 prop
.value
, received
, i
, j
);
4683 if(uri
) IUri_Release(uri
);
4689 /* Tests all the 'Get*' property functions which deal with strings. */
4690 static void test_IUri_GetStrProperties(void) {
4695 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
4696 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
4697 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
4699 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
4700 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4702 hr
= IUri_GetAuthority(uri
, NULL
);
4703 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4705 hr
= IUri_GetDisplayUri(uri
, NULL
);
4706 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4708 hr
= IUri_GetDomain(uri
, NULL
);
4709 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4711 hr
= IUri_GetExtension(uri
, NULL
);
4712 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4714 hr
= IUri_GetFragment(uri
, NULL
);
4715 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4717 hr
= IUri_GetHost(uri
, NULL
);
4718 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4720 hr
= IUri_GetPassword(uri
, NULL
);
4721 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4723 hr
= IUri_GetPath(uri
, NULL
);
4724 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4726 hr
= IUri_GetPathAndQuery(uri
, NULL
);
4727 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4729 hr
= IUri_GetQuery(uri
, NULL
);
4730 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4732 hr
= IUri_GetRawUri(uri
, NULL
);
4733 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4735 hr
= IUri_GetSchemeName(uri
, NULL
);
4736 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4738 hr
= IUri_GetUserInfo(uri
, NULL
);
4739 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4741 hr
= IUri_GetUserName(uri
, NULL
);
4742 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
4744 if(uri
) IUri_Release(uri
);
4746 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
4747 uri_properties test
= uri_tests
[i
];
4751 uriW
= a2w(test
.uri
);
4752 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
4753 if(test
.create_todo
) {
4755 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4756 hr
, test
.create_expected
, i
);
4759 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4760 hr
, test
.create_expected
, i
);
4764 uri_str_property prop
;
4765 BSTR received
= NULL
;
4767 /* GetAbsoluteUri() tests. */
4768 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
4769 hr
= IUri_GetAbsoluteUri(uri
, &received
);
4772 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4773 hr
, prop
.expected
, i
);
4776 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4777 prop
.value
, wine_dbgstr_w(received
), i
);
4780 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4781 hr
, prop
.expected
, i
);
4782 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4783 prop
.value
, wine_dbgstr_w(received
), i
);
4785 SysFreeString(received
);
4788 /* GetAuthority() tests. */
4789 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
4790 hr
= IUri_GetAuthority(uri
, &received
);
4793 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4794 hr
, prop
.expected
, i
);
4797 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4798 prop
.value
, wine_dbgstr_w(received
), i
);
4801 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4802 hr
, prop
.expected
, i
);
4803 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4804 prop
.value
, wine_dbgstr_w(received
), i
);
4806 SysFreeString(received
);
4809 /* GetDisplayUri() tests. */
4810 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
4811 hr
= IUri_GetDisplayUri(uri
, &received
);
4814 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4815 hr
, prop
.expected
, i
);
4818 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
4819 "Error: Expected %s but got %s on uri_test[%d].\n",
4820 prop
.value
, wine_dbgstr_w(received
), i
);
4823 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4824 hr
, prop
.expected
, i
);
4825 ok(!strcmp_aw(prop
.value
, received
) || broken(prop
.broken_value
&& !strcmp_aw(prop
.broken_value
, received
)),
4826 "Error: Expected %s but got %s on uri_tests[%d].\n",
4827 prop
.value
, wine_dbgstr_w(received
), i
);
4829 SysFreeString(received
);
4832 /* GetDomain() tests. */
4833 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
4834 hr
= IUri_GetDomain(uri
, &received
);
4837 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4838 hr
, prop
.expected
, i
);
4841 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4842 prop
.value
, wine_dbgstr_w(received
), i
);
4845 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4846 hr
, prop
.expected
, i
);
4847 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4848 prop
.value
, wine_dbgstr_w(received
), i
);
4850 SysFreeString(received
);
4853 /* GetExtension() tests. */
4854 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
4855 hr
= IUri_GetExtension(uri
, &received
);
4858 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4859 hr
, prop
.expected
, i
);
4862 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4863 prop
.value
, wine_dbgstr_w(received
), i
);
4866 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4867 hr
, prop
.expected
, i
);
4868 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4869 prop
.value
, wine_dbgstr_w(received
), i
);
4871 SysFreeString(received
);
4874 /* GetFragment() tests. */
4875 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
4876 hr
= IUri_GetFragment(uri
, &received
);
4879 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4880 hr
, prop
.expected
, i
);
4883 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4884 prop
.value
, wine_dbgstr_w(received
), i
);
4887 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4888 hr
, prop
.expected
, i
);
4889 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4890 prop
.value
, wine_dbgstr_w(received
), i
);
4892 SysFreeString(received
);
4895 /* GetHost() tests. */
4896 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
4897 hr
= IUri_GetHost(uri
, &received
);
4900 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4901 hr
, prop
.expected
, i
);
4904 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4905 prop
.value
, wine_dbgstr_w(received
), i
);
4908 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4909 hr
, prop
.expected
, i
);
4910 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4911 prop
.value
, wine_dbgstr_w(received
), i
);
4913 SysFreeString(received
);
4916 /* GetPassword() tests. */
4917 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
4918 hr
= IUri_GetPassword(uri
, &received
);
4921 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4922 hr
, prop
.expected
, i
);
4925 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4926 prop
.value
, wine_dbgstr_w(received
), i
);
4929 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4930 hr
, prop
.expected
, i
);
4931 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4932 prop
.value
, wine_dbgstr_w(received
), i
);
4934 SysFreeString(received
);
4937 /* GetPath() tests. */
4938 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
4939 hr
= IUri_GetPath(uri
, &received
);
4942 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4943 hr
, prop
.expected
, i
);
4946 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4947 prop
.value
, wine_dbgstr_w(received
), i
);
4950 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4951 hr
, prop
.expected
, i
);
4952 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4953 prop
.value
, wine_dbgstr_w(received
), i
);
4955 SysFreeString(received
);
4958 /* GetPathAndQuery() tests. */
4959 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
4960 hr
= IUri_GetPathAndQuery(uri
, &received
);
4963 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4964 hr
, prop
.expected
, i
);
4967 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4968 prop
.value
, wine_dbgstr_w(received
), i
);
4971 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4972 hr
, prop
.expected
, i
);
4973 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4974 prop
.value
, wine_dbgstr_w(received
), i
);
4976 SysFreeString(received
);
4979 /* GetQuery() tests. */
4980 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
4981 hr
= IUri_GetQuery(uri
, &received
);
4984 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4985 hr
, prop
.expected
, i
);
4988 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4989 prop
.value
, wine_dbgstr_w(received
), i
);
4992 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
4993 hr
, prop
.expected
, i
);
4994 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
4995 prop
.value
, wine_dbgstr_w(received
), i
);
4997 SysFreeString(received
);
5000 /* GetRawUri() tests. */
5001 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
5002 hr
= IUri_GetRawUri(uri
, &received
);
5005 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5006 hr
, prop
.expected
, i
);
5009 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5010 prop
.value
, wine_dbgstr_w(received
), i
);
5013 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5014 hr
, prop
.expected
, i
);
5015 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5016 prop
.value
, wine_dbgstr_w(received
), i
);
5018 SysFreeString(received
);
5021 /* GetSchemeName() tests. */
5022 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
5023 hr
= IUri_GetSchemeName(uri
, &received
);
5026 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5027 hr
, prop
.expected
, i
);
5030 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5031 prop
.value
, wine_dbgstr_w(received
), i
);
5034 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5035 hr
, prop
.expected
, i
);
5036 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5037 prop
.value
, wine_dbgstr_w(received
), i
);
5039 SysFreeString(received
);
5042 /* GetUserInfo() tests. */
5043 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
5044 hr
= IUri_GetUserInfo(uri
, &received
);
5047 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5048 hr
, prop
.expected
, i
);
5051 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5052 prop
.value
, wine_dbgstr_w(received
), i
);
5055 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5056 hr
, prop
.expected
, i
);
5057 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5058 prop
.value
, wine_dbgstr_w(received
), i
);
5060 SysFreeString(received
);
5063 /* GetUserName() tests. */
5064 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
5065 hr
= IUri_GetUserName(uri
, &received
);
5068 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5069 hr
, prop
.expected
, i
);
5072 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5073 prop
.value
, wine_dbgstr_w(received
), i
);
5076 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5077 hr
, prop
.expected
, i
);
5078 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
5079 prop
.value
, wine_dbgstr_w(received
), i
);
5081 SysFreeString(received
);
5084 if(uri
) IUri_Release(uri
);
5090 static void test_IUri_GetDwordProperties(void) {
5095 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
5096 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
5097 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5099 hr
= IUri_GetHostType(uri
, NULL
);
5100 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5102 hr
= IUri_GetPort(uri
, NULL
);
5103 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5105 hr
= IUri_GetScheme(uri
, NULL
);
5106 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5108 hr
= IUri_GetZone(uri
, NULL
);
5109 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5111 if(uri
) IUri_Release(uri
);
5113 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
5114 uri_properties test
= uri_tests
[i
];
5118 uriW
= a2w(test
.uri
);
5119 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
5120 if(test
.create_todo
) {
5122 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5123 hr
, test
.create_expected
, i
);
5126 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5127 hr
, test
.create_expected
, i
);
5131 uri_dword_property prop
;
5134 /* Assign an insane value so tests don't accidentally pass when
5137 received
= -9999999;
5139 /* GetHostType() tests. */
5140 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
5141 hr
= IUri_GetHostType(uri
, &received
);
5144 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5145 hr
, prop
.expected
, i
);
5148 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5151 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5152 hr
, prop
.expected
, i
);
5153 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5155 received
= -9999999;
5157 /* GetPort() tests. */
5158 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
5159 hr
= IUri_GetPort(uri
, &received
);
5162 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5163 hr
, prop
.expected
, i
);
5166 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5169 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5170 hr
, prop
.expected
, i
);
5171 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5173 received
= -9999999;
5175 /* GetScheme() tests. */
5176 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
5177 hr
= IUri_GetScheme(uri
, &received
);
5180 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5181 hr
, prop
.expected
, i
);
5184 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5187 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5188 hr
, prop
.expected
, i
);
5189 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5191 received
= -9999999;
5193 /* GetZone() tests. */
5194 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
5195 hr
= IUri_GetZone(uri
, &received
);
5198 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5199 hr
, prop
.expected
, i
);
5202 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5205 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5206 hr
, prop
.expected
, i
);
5207 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
5211 if(uri
) IUri_Release(uri
);
5217 static void test_IUri_GetPropertyLength(void) {
5222 /* Make sure it handles invalid args correctly. */
5223 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
5224 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5226 DWORD received
= 0xdeadbeef;
5228 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
5229 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5231 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
5232 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5233 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
5235 if(uri
) IUri_Release(uri
);
5237 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
5238 uri_properties test
= uri_tests
[i
];
5242 uriW
= a2w(test
.uri
);
5243 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
5244 if(test
.create_todo
) {
5246 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
5247 hr
, test
.create_expected
, i
);
5250 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
5251 hr
, test
.create_expected
, i
);
5257 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
5258 DWORD expectedLen
, brokenLen
, receivedLen
;
5259 uri_str_property prop
= test
.str_props
[j
];
5261 expectedLen
= lstrlen(prop
.value
);
5262 brokenLen
= lstrlen(prop
.broken_value
);
5264 /* This won't be necessary once GetPropertyLength is implemented. */
5267 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
5270 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
5271 hr
, prop
.expected
, i
, j
);
5274 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
5275 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
5276 expectedLen
, receivedLen
, i
, j
);
5279 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
5280 hr
, prop
.expected
, i
, j
);
5281 ok(receivedLen
== expectedLen
|| broken(receivedLen
== brokenLen
),
5282 "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
5283 expectedLen
, receivedLen
, i
, j
);
5288 if(uri
) IUri_Release(uri
);
5294 static void test_IUri_GetProperties(void) {
5299 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
5300 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5302 hr
= IUri_GetProperties(uri
, NULL
);
5303 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5305 if(uri
) IUri_Release(uri
);
5307 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
5308 uri_properties test
= uri_tests
[i
];
5312 uriW
= a2w(test
.uri
);
5313 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
5314 if(test
.create_todo
) {
5316 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
5319 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
5326 hr
= IUri_GetProperties(uri
, &received
);
5327 if(test
.props_todo
) {
5329 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5332 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5335 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
5336 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
5337 if(test
.props
& (1 << j
)) {
5338 if(test
.props_todo
) {
5340 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
5343 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
5346 /* NOTE: Since received is initialized to 0, this test will always pass while
5347 * GetProperties is unimplemented.
5349 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
5354 if(uri
) IUri_Release(uri
);
5360 static void test_IUri_HasProperty(void) {
5365 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
5366 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5368 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
5369 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5371 if(uri
) IUri_Release(uri
);
5373 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
5374 uri_properties test
= uri_tests
[i
];
5378 uriW
= a2w(test
.uri
);
5380 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
5381 if(test
.create_todo
) {
5383 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
5386 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
5392 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
5393 /* Assign -1, then explicitly test for TRUE or FALSE later. */
5396 hr
= IUri_HasProperty(uri
, j
, &received
);
5397 if(test
.props_todo
) {
5399 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
5403 /* Check if the property should be true. */
5404 if(test
.props
& (1 << j
)) {
5406 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
5410 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
5414 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
5417 if(test
.props
& (1 << j
)) {
5418 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
5420 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
5426 if(uri
) IUri_Release(uri
);
5432 static void test_IUri_IsEqual(void) {
5439 /* Make sure IsEqual handles invalid args correctly. */
5440 hrA
= pCreateUri(http_urlW
, 0, 0, &uriA
);
5441 hrB
= pCreateUri(http_urlW
, 0, 0, &uriB
);
5442 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
5443 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrB
, S_OK
);
5444 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
5446 hrA
= IUri_IsEqual(uriA
, NULL
, &equal
);
5447 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
5448 ok(equal
== FALSE
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
5450 hrA
= IUri_IsEqual(uriA
, uriB
, NULL
);
5451 ok(hrA
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, E_POINTER
);
5453 if(uriA
) IUri_Release(uriA
);
5454 if(uriB
) IUri_Release(uriB
);
5456 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
5457 uri_equality test
= equality_tests
[i
];
5458 LPWSTR uriA_W
, uriB_W
;
5462 uriA_W
= a2w(test
.a
);
5463 uriB_W
= a2w(test
.b
);
5465 hrA
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
5466 if(test
.create_todo_a
) {
5468 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
5472 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
5476 hrB
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
5477 if(test
.create_todo_b
) {
5479 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
5483 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
5487 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
5490 hrA
= IUri_IsEqual(uriA
, uriB
, &equal
);
5493 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n",
5497 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
5500 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hrA
, S_OK
, i
);
5501 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
5504 if(uriA
) IUri_Release(uriA
);
5505 if(uriB
) IUri_Release(uriB
);
5512 static void test_CreateUriWithFragment_InvalidArgs(void) {
5514 IUri
*uri
= (void*) 0xdeadbeef;
5515 const WCHAR fragmentW
[] = {'#','f','r','a','g','m','e','n','t',0};
5517 hr
= pCreateUriWithFragment(NULL
, fragmentW
, 0, 0, &uri
);
5518 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5519 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5521 hr
= pCreateUriWithFragment(http_urlW
, fragmentW
, 0, 0, NULL
);
5522 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5524 /* Original URI can't already contain a fragment component. */
5525 uri
= (void*) 0xdeadbeef;
5526 hr
= pCreateUriWithFragment(http_url_fragW
, fragmentW
, 0, 0, &uri
);
5527 ok(hr
== E_INVALIDARG
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
5528 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5531 /* CreateUriWithFragment has the same invalid flag combinations as CreateUri. */
5532 static void test_CreateUriWithFragment_InvalidFlags(void) {
5535 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
5537 IUri
*uri
= (void*) 0xdeadbeef;
5539 hr
= pCreateUriWithFragment(http_urlW
, NULL
, invalid_flag_tests
[i
].flags
, 0, &uri
);
5540 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x. flags=0x%08x.\n",
5541 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
5542 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5546 static void test_CreateUriWithFragment(void) {
5549 for(i
= 0; i
< sizeof(uri_fragment_tests
)/sizeof(uri_fragment_tests
[0]); ++i
) {
5553 uri_with_fragment test
= uri_fragment_tests
[i
];
5555 uriW
= a2w(test
.uri
);
5556 fragW
= a2w(test
.fragment
);
5558 hr
= pCreateUriWithFragment(uriW
, fragW
, test
.create_flags
, 0, &uri
);
5559 if(test
.expected_todo
) {
5561 ok(hr
== test
.create_expected
,
5562 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
5563 hr
, test
.create_expected
, i
);
5566 ok(hr
== test
.create_expected
,
5567 "Error: CreateUriWithFragment returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
5568 hr
, test
.create_expected
, i
);
5571 BSTR received
= NULL
;
5573 hr
= IUri_GetAbsoluteUri(uri
, &received
);
5574 if(test
.expected_todo
) {
5577 "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
5581 ok(!strcmp_aw(test
.expected_uri
, received
),
5582 "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
5583 test
.expected_uri
, wine_dbgstr_w(received
), i
);
5586 ok(hr
== S_OK
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_fragment_tests[%d].\n",
5588 ok(!strcmp_aw(test
.expected_uri
, received
), "Error: Expected %s but got %s on uri_fragment_tests[%d].\n",
5589 test
.expected_uri
, wine_dbgstr_w(received
), i
);
5592 SysFreeString(received
);
5595 if(uri
) IUri_Release(uri
);
5600 static void test_CreateIUriBuilder(void) {
5602 IUriBuilder
*builder
= NULL
;
5605 hr
= pCreateIUriBuilder(NULL
, 0, 0, NULL
);
5606 ok(hr
== E_POINTER
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x\n",
5609 /* CreateIUriBuilder increases the ref count of the IUri it receives. */
5610 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
5611 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5613 ULONG cur_count
, orig_count
;
5615 orig_count
= get_refcnt(uri
);
5616 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
5617 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5618 ok(builder
!= NULL
, "Error: Expecting builder not to be NULL\n");
5620 cur_count
= get_refcnt(uri
);
5621 ok(cur_count
== orig_count
+1, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
+1, cur_count
);
5623 if(builder
) IUriBuilder_Release(builder
);
5624 cur_count
= get_refcnt(uri
);
5625 ok(cur_count
== orig_count
, "Error: Expected the ref count to be %u, but was %u instead.\n", orig_count
, cur_count
);
5627 if(uri
) IUri_Release(uri
);
5630 static void test_IUriBuilder_CreateUri(IUriBuilder
*builder
, const uri_builder_test
*test
,
5635 hr
= IUriBuilder_CreateUri(builder
, test
->uri_flags
, 0, 0, &uri
);
5636 if(test
->uri_todo
) {
5638 ok(hr
== test
->uri_hres
,
5639 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5640 hr
, test
->uri_hres
, test_index
);
5643 ok(hr
== test
->uri_hres
,
5644 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5645 hr
, test
->uri_hres
, test_index
);
5649 BSTR received
= NULL
;
5651 hr
= IUri_GetAbsoluteUri(uri
, &received
);
5652 ok(hr
== S_OK
, "Error: IUri_GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5653 hr
, S_OK
, test_index
);
5654 ok(!strcmp_aw(test
->uri_expected
, received
),
5655 "Error: Expected the URI to be %s but was %s instead on uri_builder_tests[%d].\n",
5656 test
->uri_expected
, wine_dbgstr_w(received
), test_index
);
5657 SysFreeString(received
);
5659 if(uri
) IUri_Release(uri
);
5662 static void test_IUriBuilder_CreateUriSimple(IUriBuilder
*builder
, const uri_builder_test
*test
,
5667 hr
= IUriBuilder_CreateUriSimple(builder
, test
->uri_simple_encode_flags
, 0, &uri
);
5668 if(test
->uri_todo
) {
5670 ok(hr
== test
->uri_simple_hres
,
5671 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5672 hr
, test
->uri_simple_hres
, test_index
);
5675 ok(hr
== test
->uri_simple_hres
,
5676 "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5677 hr
, test
->uri_simple_hres
, test_index
);
5681 BSTR received
= NULL
;
5683 hr
= IUri_GetAbsoluteUri(uri
, &received
);
5684 ok(hr
== S_OK
, "Error: IUri_GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5685 hr
, S_OK
, test_index
);
5686 ok(!strcmp_aw(test
->uri_simple_expected
, received
),
5687 "Error: Expected the URI to be %s but was %s instead on uri_builder_tests[%d].\n",
5688 test
->uri_simple_expected
, wine_dbgstr_w(received
), test_index
);
5689 SysFreeString(received
);
5691 if(uri
) IUri_Release(uri
);
5694 static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder
*builder
, const uri_builder_test
*test
,
5699 hr
= IUriBuilder_CreateUriWithFlags(builder
, test
->uri_with_flags
, test
->uri_with_builder_flags
,
5700 test
->uri_with_encode_flags
, 0, &uri
);
5701 if(test
->uri_todo
) {
5703 ok(hr
== test
->uri_with_hres
,
5704 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5705 hr
, test
->uri_with_hres
, test_index
);
5708 ok(hr
== test
->uri_with_hres
,
5709 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5710 hr
, test
->uri_with_hres
, test_index
);
5714 BSTR received
= NULL
;
5716 hr
= IUri_GetAbsoluteUri(uri
, &received
);
5717 ok(hr
== S_OK
, "Error: IUri_GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5718 hr
, S_OK
, test_index
);
5719 ok(!strcmp_aw(test
->uri_with_expected
, received
),
5720 "Error: Expected the URI to be %s but was %s instead on uri_builder_tests[%d].\n",
5721 test
->uri_with_expected
, wine_dbgstr_w(received
), test_index
);
5722 SysFreeString(received
);
5724 if(uri
) IUri_Release(uri
);
5727 static void test_IUriBuilder_CreateInvalidArgs(void) {
5728 IUriBuilder
*builder
;
5731 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
5732 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5734 IUri
*test
= NULL
, *uri
= (void*) 0xdeadbeef;
5736 /* Test what happens if the IUriBuilder doesn't have a IUri set. */
5737 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, &uri
);
5738 ok(hr
== INET_E_INVALID_URL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, INET_E_INVALID_URL
);
5739 ok(uri
== NULL
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5741 hr
= IUriBuilder_CreateUri(builder
, 0, 0, 0, NULL
);
5742 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
5744 uri
= (void*) 0xdeadbeef;
5745 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
5746 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_NOTIMPL
);
5747 ok(uri
== NULL
, "Error: expected uri to be NULL, but was %p instead.\n", uri
);
5749 uri
= (void*) 0xdeadbeef;
5750 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, &uri
);
5751 ok(hr
== INET_E_INVALID_URL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
5752 hr
, INET_E_INVALID_URL
);
5753 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5755 hr
= IUriBuilder_CreateUriSimple(builder
, 0, 0, NULL
);
5756 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
5759 uri
= (void*) 0xdeadbeef;
5760 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
5761 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
5763 ok(!uri
, "Error: Expected uri to NULL, but was %p instead.\n", uri
);
5765 uri
= (void*) 0xdeadbeef;
5766 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
5767 ok(hr
== INET_E_INVALID_URL
,
5768 "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
5769 hr
, INET_E_INVALID_URL
);
5770 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5772 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, NULL
);
5773 ok(hr
== E_POINTER
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
5776 uri
= (void*) 0xdeadbeef;
5777 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
5778 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
5780 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5782 hr
= pCreateUri(http_urlW
, 0, 0, &test
);
5783 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5785 hr
= IUriBuilder_SetIUri(builder
, test
);
5786 todo_wine
{ ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
); }
5788 /* No longer returns E_NOTIMPL, since a IUri has been set and hasn't been modified. */
5790 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
5792 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5794 todo_wine
{ ok(uri
!= NULL
, "Error: The uri was NULL.\n"); }
5795 if(uri
) IUri_Release(uri
);
5798 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
5800 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
5803 todo_wine
{ ok(uri
!= NULL
, "Error: uri was NULL.\n"); }
5804 if(uri
) IUri_Release(uri
);
5807 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, 0, 0, &uri
);
5809 ok(hr
== S_OK
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
5812 todo_wine
{ ok(uri
!= NULL
, "Error: uri was NULL.\n"); }
5813 if(uri
) IUri_Release(uri
);
5815 hr
= IUriBuilder_SetFragment(builder
, NULL
);
5816 todo_wine
{ ok(hr
== S_OK
, "Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
); }
5818 /* The IUriBuilder is changed, so it returns E_NOTIMPL again. */
5819 uri
= (void*) 0xdeadbeef;
5820 hr
= IUriBuilder_CreateUri(builder
, 0, Uri_HAS_USER_NAME
, 0, &uri
);
5821 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5822 ok(!uri
, "Error: Expected uri to be NULL but was %p instead.\n", uri
);
5824 uri
= (void*) 0xdeadbeef;
5825 hr
= IUriBuilder_CreateUriSimple(builder
, Uri_HAS_USER_NAME
, 0, &uri
);
5826 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n",
5828 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5830 uri
= (void*) 0xdeadbeef;
5831 hr
= IUriBuilder_CreateUriWithFlags(builder
, 0, 0, Uri_HAS_USER_NAME
, 0, &uri
);
5832 ok(hr
== E_NOTIMPL
, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n",
5834 ok(!uri
, "Error: Expected uri to be NULL, but was %p instead.\n", uri
);
5836 if(test
) IUri_Release(test
);
5838 if(builder
) IUriBuilder_Release(builder
);
5841 /* Tests invalid args to the "Get*" functions. */
5842 static void test_IUriBuilder_GetInvalidArgs(void) {
5843 IUriBuilder
*builder
= NULL
;
5846 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
5847 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
5849 LPCWSTR received
= (void*) 0xdeadbeef;
5850 DWORD len
= -1, port
= -1;
5853 hr
= IUriBuilder_GetFragment(builder
, NULL
, NULL
);
5854 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
5856 hr
= IUriBuilder_GetFragment(builder
, NULL
, &received
);
5857 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
5859 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5860 hr
= IUriBuilder_GetFragment(builder
, &len
, NULL
);
5861 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.\n",
5863 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5865 hr
= IUriBuilder_GetHost(builder
, NULL
, NULL
);
5866 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
5868 received
= (void*) 0xdeadbeef;
5869 hr
= IUriBuilder_GetHost(builder
, NULL
, &received
);
5870 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
5872 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5874 hr
= IUriBuilder_GetHost(builder
, &len
, NULL
);
5875 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.\n",
5877 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5879 hr
= IUriBuilder_GetPassword(builder
, NULL
, NULL
);
5880 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
5882 received
= (void*) 0xdeadbeef;
5883 hr
= IUriBuilder_GetPassword(builder
, NULL
, &received
);
5884 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
5886 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5888 hr
= IUriBuilder_GetPassword(builder
, &len
, NULL
);
5889 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x.\n",
5891 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5893 hr
= IUriBuilder_GetPath(builder
, NULL
, NULL
);
5894 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
5896 received
= (void*) 0xdeadbeef;
5897 hr
= IUriBuilder_GetPath(builder
, NULL
, &received
);
5898 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
5900 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5902 hr
= IUriBuilder_GetPath(builder
, &len
, NULL
);
5903 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.\n",
5905 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5907 hr
= IUriBuilder_GetPort(builder
, NULL
, NULL
);
5908 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
5910 hr
= IUriBuilder_GetPort(builder
, NULL
, &port
);
5911 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
5913 ok(!port
, "Error: Expected port to be 0, but was %d instead.\n", port
);
5914 hr
= IUriBuilder_GetPort(builder
, &set
, NULL
);
5915 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n",
5917 ok(!set
, "Error: Expected set to be FALSE, but was %d instead.\n", set
);
5919 hr
= IUriBuilder_GetQuery(builder
, NULL
, NULL
);
5920 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
5922 received
= (void*) 0xdeadbeef;
5923 hr
= IUriBuilder_GetQuery(builder
, NULL
, &received
);
5924 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
5926 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5928 hr
= IUriBuilder_GetQuery(builder
, &len
, NULL
);
5929 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x.\n",
5931 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5933 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, NULL
);
5934 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
5936 received
= (void*) 0xdeadbeef;
5937 hr
= IUriBuilder_GetSchemeName(builder
, NULL
, &received
);
5938 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
5940 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5942 hr
= IUriBuilder_GetSchemeName(builder
, &len
, NULL
);
5943 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x.\n",
5945 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5947 hr
= IUriBuilder_GetUserName(builder
, NULL
, NULL
);
5948 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
5950 received
= (void*) 0xdeadbeef;
5951 hr
= IUriBuilder_GetUserName(builder
, NULL
, &received
);
5952 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
5954 ok(!received
, "Error: Expected received to be NULL, but was %p instead.\n", received
);
5956 hr
= IUriBuilder_GetUserName(builder
, &len
, NULL
);
5957 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x.\n",
5959 ok(!len
, "Error: Expected len to be 0, but was %d instead.\n", len
);
5961 if(builder
) IUriBuilder_Release(builder
);
5964 static void test_IUriBuilder_GetFragment(IUriBuilder
*builder
, const uri_builder_test
*test
,
5968 LPCWSTR received
= NULL
;
5970 const uri_builder_property
*prop
= NULL
;
5972 /* Check if the property was set earlier. */
5973 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
5974 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_FRAGMENT
)
5975 prop
= &(test
->properties
[i
]);
5979 /* Use expected_value unless it's NULL, then use value. */
5980 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
5981 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
5984 ok(hr
== (expected
? S_OK
: S_FALSE
),
5985 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
5986 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
5990 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
5991 expected
, wine_dbgstr_w(received
), test_index
);
5994 ok(lstrlen(expected
) == len
,
5995 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
5996 lstrlen(expected
), len
, test_index
);
6000 ok(hr
== (expected
? S_OK
: S_FALSE
),
6001 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6002 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6003 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6004 expected
, wine_dbgstr_w(received
), test_index
);
6005 ok(lstrlen(expected
) == len
,
6006 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6007 lstrlen(expected
), len
, test_index
);
6010 /* The property wasn't set earlier, so it should return whatever
6011 * the base IUri contains (if anything).
6014 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6017 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6018 hr
, S_OK
, test_index
);
6021 BOOL has_prop
= FALSE
;
6022 BSTR expected
= NULL
;
6024 hr
= IUri_GetFragment(uri
, &expected
);
6026 "Error: Expected IUri_GetFragment to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6028 has_prop
= hr
== S_OK
;
6030 hr
= IUriBuilder_GetFragment(builder
, &len
, &received
);
6034 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6035 hr
, S_OK
, test_index
);
6039 ok(!lstrcmpW(expected
, received
),
6040 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6041 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6044 ok(lstrlenW(expected
) == len
,
6045 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6046 lstrlenW(expected
), len
, test_index
);
6052 "Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6053 hr
, S_FALSE
, test_index
);
6057 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6060 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6065 SysFreeString(expected
);
6067 if(uri
) IUri_Release(uri
);
6071 static void test_IUriBuilder_GetHost(IUriBuilder
*builder
, const uri_builder_test
*test
,
6075 LPCWSTR received
= NULL
;
6077 const uri_builder_property
*prop
= NULL
;
6079 /* Check if the property was set earlier. */
6080 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6081 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_HOST
)
6082 prop
= &(test
->properties
[i
]);
6086 /* Use expected_value unless it's NULL, then use value. */
6087 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6088 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
6091 ok(hr
== (expected
? S_OK
: S_FALSE
),
6092 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6093 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6097 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6098 expected
, wine_dbgstr_w(received
), test_index
);
6101 ok(lstrlen(expected
) == len
,
6102 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6103 lstrlen(expected
), len
, test_index
);
6107 ok(hr
== (expected
? S_OK
: S_FALSE
),
6108 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6109 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6110 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6111 expected
, wine_dbgstr_w(received
), test_index
);
6112 ok(lstrlen(expected
) == len
,
6113 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6114 lstrlen(expected
), len
, test_index
);
6117 /* The property wasn't set earlier, so it should return whatever
6118 * the base IUri contains (if anything).
6121 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6124 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6125 hr
, S_OK
, test_index
);
6128 BOOL has_prop
= FALSE
;
6129 BSTR expected
= NULL
;
6131 hr
= IUri_GetHost(uri
, &expected
);
6133 "Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6135 has_prop
= hr
== S_OK
;
6137 hr
= IUriBuilder_GetHost(builder
, &len
, &received
);
6141 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6142 hr
, S_OK
, test_index
);
6146 ok(!lstrcmpW(expected
, received
),
6147 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6148 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6151 ok(lstrlenW(expected
) == len
,
6152 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6153 lstrlenW(expected
), len
, test_index
);
6159 "Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6160 hr
, S_FALSE
, test_index
);
6164 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6167 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6172 SysFreeString(expected
);
6174 if(uri
) IUri_Release(uri
);
6178 static void test_IUriBuilder_GetPassword(IUriBuilder
*builder
, const uri_builder_test
*test
,
6182 LPCWSTR received
= NULL
;
6184 const uri_builder_property
*prop
= NULL
;
6186 /* Check if the property was set earlier. */
6187 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6188 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PASSWORD
)
6189 prop
= &(test
->properties
[i
]);
6193 /* Use expected_value unless it's NULL, then use value. */
6194 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6195 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
6198 ok(hr
== (expected
? S_OK
: S_FALSE
),
6199 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6200 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6204 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6205 expected
, wine_dbgstr_w(received
), test_index
);
6208 ok(lstrlen(expected
) == len
,
6209 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6210 lstrlen(expected
), len
, test_index
);
6214 ok(hr
== (expected
? S_OK
: S_FALSE
),
6215 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6216 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6217 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6218 expected
, wine_dbgstr_w(received
), test_index
);
6219 ok(lstrlen(expected
) == len
,
6220 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6221 lstrlen(expected
), len
, test_index
);
6224 /* The property wasn't set earlier, so it should return whatever
6225 * the base IUri contains (if anything).
6228 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6231 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6232 hr
, S_OK
, test_index
);
6235 BOOL has_prop
= FALSE
;
6236 BSTR expected
= NULL
;
6238 hr
= IUri_GetPassword(uri
, &expected
);
6240 "Error: Expected IUri_GetPassword to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6242 has_prop
= hr
== S_OK
;
6244 hr
= IUriBuilder_GetPassword(builder
, &len
, &received
);
6248 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6249 hr
, S_OK
, test_index
);
6253 ok(!lstrcmpW(expected
, received
),
6254 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6255 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6258 ok(lstrlenW(expected
) == len
,
6259 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6260 lstrlenW(expected
), len
, test_index
);
6266 "Error: IUriBuilder_GetPassword returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6267 hr
, S_FALSE
, test_index
);
6271 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6274 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6279 SysFreeString(expected
);
6281 if(uri
) IUri_Release(uri
);
6285 static void test_IUriBuilder_GetPath(IUriBuilder
*builder
, const uri_builder_test
*test
,
6289 LPCWSTR received
= NULL
;
6291 const uri_builder_property
*prop
= NULL
;
6293 /* Check if the property was set earlier. */
6294 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6295 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_PATH
)
6296 prop
= &(test
->properties
[i
]);
6300 /* Use expected_value unless it's NULL, then use value. */
6301 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6302 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
6305 ok(hr
== (expected
? S_OK
: S_FALSE
),
6306 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6307 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6311 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6312 expected
, wine_dbgstr_w(received
), test_index
);
6315 ok(lstrlen(expected
) == len
,
6316 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6317 lstrlen(expected
), len
, test_index
);
6321 ok(hr
== (expected
? S_OK
: S_FALSE
),
6322 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6323 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6324 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6325 expected
, wine_dbgstr_w(received
), test_index
);
6326 ok(lstrlen(expected
) == len
,
6327 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6328 lstrlen(expected
), len
, test_index
);
6331 /* The property wasn't set earlier, so it should return whatever
6332 * the base IUri contains (if anything).
6335 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6338 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6339 hr
, S_OK
, test_index
);
6342 BOOL has_prop
= FALSE
;
6343 BSTR expected
= NULL
;
6345 hr
= IUri_GetPath(uri
, &expected
);
6347 "Error: Expected IUri_GetPath to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6349 has_prop
= hr
== S_OK
;
6351 hr
= IUriBuilder_GetPath(builder
, &len
, &received
);
6355 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6356 hr
, S_OK
, test_index
);
6360 ok(!lstrcmpW(expected
, received
),
6361 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6362 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6365 ok(lstrlenW(expected
) == len
,
6366 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6367 lstrlenW(expected
), len
, test_index
);
6373 "Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6374 hr
, S_FALSE
, test_index
);
6378 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6381 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6386 SysFreeString(expected
);
6388 if(uri
) IUri_Release(uri
);
6392 static void test_IUriBuilder_GetPort(IUriBuilder
*builder
, const uri_builder_test
*test
,
6395 BOOL has_port
= FALSE
;
6396 DWORD received
= -1;
6398 if(test
->port_prop
.change
) {
6399 DWORD expected
= test
->port_prop
.value
;
6401 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
6402 if(test
->port_prop
.todo
) {
6405 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6406 hr
, S_OK
, test_index
);
6410 ok(has_port
== test
->port_prop
.set
,
6411 "Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].\n",
6412 test
->port_prop
.set
, has_port
, test_index
);
6415 ok(received
== expected
,
6416 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
6417 expected
, received
, test_index
);
6422 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6423 hr
, S_OK
, test_index
);
6424 ok(has_port
== test
->port_prop
.set
,
6425 "Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].\n",
6426 test
->port_prop
.set
, has_port
, test_index
);
6427 ok(received
== test
->port_prop
.value
,
6428 "Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].\n",
6429 test
->port_prop
.value
, received
, test_index
);
6434 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6437 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6438 hr
, S_OK
, test_index
);
6442 BOOL got_port
= FALSE
;
6444 hr
= IUri_GetPort(uri
, &expected
);
6446 "Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6448 got_port
= hr
== S_OK
;
6450 hr
= IUriBuilder_GetPort(builder
, &has_port
, &received
);
6453 "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6454 hr
, S_OK
, test_index
);
6459 "Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].\n",
6463 ok(received
== expected
,
6464 "Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].\n",
6465 expected
, received
, test_index
);
6469 if(uri
) IUri_Release(uri
);
6473 static void test_IUriBuilder_GetQuery(IUriBuilder
*builder
, const uri_builder_test
*test
,
6477 LPCWSTR received
= NULL
;
6479 const uri_builder_property
*prop
= NULL
;
6481 /* Check if the property was set earlier. */
6482 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6483 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_QUERY
)
6484 prop
= &(test
->properties
[i
]);
6488 /* Use expected_value unless it's NULL, then use value. */
6489 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6490 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
6493 ok(hr
== (expected
? S_OK
: S_FALSE
),
6494 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6495 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6499 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6500 expected
, wine_dbgstr_w(received
), test_index
);
6503 ok(lstrlen(expected
) == len
,
6504 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6505 lstrlen(expected
), len
, test_index
);
6509 ok(hr
== (expected
? S_OK
: S_FALSE
),
6510 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6511 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6512 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6513 expected
, wine_dbgstr_w(received
), test_index
);
6514 ok(lstrlen(expected
) == len
,
6515 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6516 lstrlen(expected
), len
, test_index
);
6519 /* The property wasn't set earlier, so it should return whatever
6520 * the base IUri contains (if anything).
6523 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6526 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6527 hr
, S_OK
, test_index
);
6530 BOOL has_prop
= FALSE
;
6531 BSTR expected
= NULL
;
6533 hr
= IUri_GetQuery(uri
, &expected
);
6535 "Error: Expected IUri_GetQuery to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6537 has_prop
= hr
== S_OK
;
6539 hr
= IUriBuilder_GetQuery(builder
, &len
, &received
);
6543 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6544 hr
, S_OK
, test_index
);
6548 ok(!lstrcmpW(expected
, received
),
6549 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6550 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6553 ok(lstrlenW(expected
) == len
,
6554 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6555 lstrlenW(expected
), len
, test_index
);
6561 "Error: IUriBuilder_GetQuery returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6562 hr
, S_FALSE
, test_index
);
6566 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6569 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6574 SysFreeString(expected
);
6576 if(uri
) IUri_Release(uri
);
6580 static void test_IUriBuilder_GetSchemeName(IUriBuilder
*builder
, const uri_builder_test
*test
,
6584 LPCWSTR received
= NULL
;
6586 const uri_builder_property
*prop
= NULL
;
6588 /* Check if the property was set earlier. */
6589 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6590 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_SCHEME_NAME
)
6591 prop
= &(test
->properties
[i
]);
6595 /* Use expected_value unless it's NULL, then use value. */
6596 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6597 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
6600 ok(hr
== (expected
? S_OK
: S_FALSE
),
6601 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6602 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6606 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6607 expected
, wine_dbgstr_w(received
), test_index
);
6610 ok(lstrlen(expected
) == len
,
6611 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6612 lstrlen(expected
), len
, test_index
);
6616 ok(hr
== (expected
? S_OK
: S_FALSE
),
6617 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6618 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6619 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6620 expected
, wine_dbgstr_w(received
), test_index
);
6621 ok(lstrlen(expected
) == len
,
6622 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6623 lstrlen(expected
), len
, test_index
);
6626 /* The property wasn't set earlier, so it should return whatever
6627 * the base IUri contains (if anything).
6630 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6633 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6634 hr
, S_OK
, test_index
);
6637 BOOL has_prop
= FALSE
;
6638 BSTR expected
= NULL
;
6640 hr
= IUri_GetSchemeName(uri
, &expected
);
6642 "Error: Expected IUri_GetSchemeName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6644 has_prop
= hr
== S_OK
;
6646 hr
= IUriBuilder_GetSchemeName(builder
, &len
, &received
);
6650 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6651 hr
, S_OK
, test_index
);
6655 ok(!lstrcmpW(expected
, received
),
6656 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6657 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6660 ok(lstrlenW(expected
) == len
,
6661 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6662 lstrlenW(expected
), len
, test_index
);
6668 "Error: IUriBuilder_GetSchemeName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6669 hr
, S_FALSE
, test_index
);
6673 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6676 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6681 SysFreeString(expected
);
6683 if(uri
) IUri_Release(uri
);
6687 static void test_IUriBuilder_GetUserName(IUriBuilder
*builder
, const uri_builder_test
*test
,
6691 LPCWSTR received
= NULL
;
6693 const uri_builder_property
*prop
= NULL
;
6695 /* Check if the property was set earlier. */
6696 for(i
= 0; i
< sizeof(test
->properties
)/sizeof(test
->properties
[0]); ++i
) {
6697 if(test
->properties
[i
].change
&& test
->properties
[i
].property
== Uri_PROPERTY_USER_NAME
)
6698 prop
= &(test
->properties
[i
]);
6702 /* Use expected_value unless it's NULL, then use value. */
6703 LPCSTR expected
= prop
->expected_value
? prop
->expected_value
: prop
->value
;
6704 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
6707 ok(hr
== (expected
? S_OK
: S_FALSE
),
6708 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6709 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6713 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6714 expected
, wine_dbgstr_w(received
), test_index
);
6717 ok(lstrlen(expected
) == len
,
6718 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6719 lstrlen(expected
), len
, test_index
);
6723 ok(hr
== (expected
? S_OK
: S_FALSE
),
6724 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6725 hr
, (expected
? S_OK
: S_FALSE
), test_index
);
6726 ok(!strcmp_aw(expected
, received
), "Error: Expected %s but got %s on uri_builder_tests[%d].\n",
6727 expected
, wine_dbgstr_w(received
), test_index
);
6728 ok(lstrlen(expected
) == len
,
6729 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6730 lstrlen(expected
), len
, test_index
);
6733 /* The property wasn't set earlier, so it should return whatever
6734 * the base IUri contains (if anything).
6737 hr
= IUriBuilder_GetIUri(builder
, &uri
);
6740 "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6741 hr
, S_OK
, test_index
);
6744 BOOL has_prop
= FALSE
;
6745 BSTR expected
= NULL
;
6747 hr
= IUri_GetUserName(uri
, &expected
);
6749 "Error: Expected IUri_GetUserName to succeed, but got 0x%08x instead on uri_builder_tests[%d].\n",
6751 has_prop
= hr
== S_OK
;
6753 hr
= IUriBuilder_GetUserName(builder
, &len
, &received
);
6757 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6758 hr
, S_OK
, test_index
);
6762 ok(!lstrcmpW(expected
, received
),
6763 "Error: Expected %s but got %s instead on uri_builder_tests[%d].\n",
6764 wine_dbgstr_w(expected
), wine_dbgstr_w(received
), test_index
);
6767 ok(lstrlenW(expected
) == len
,
6768 "Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].\n",
6769 lstrlenW(expected
), len
, test_index
);
6775 "Error: IUriBuilder_GetUserName returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6776 hr
, S_FALSE
, test_index
);
6780 ok(!received
, "Error: Expected received to be NULL on uri_builder_tests[%d].\n", test_index
);
6783 ok(!len
, "Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].\n",
6788 SysFreeString(expected
);
6790 if(uri
) IUri_Release(uri
);
6794 /* Tests IUriBuilder functions. */
6795 static void test_IUriBuilder(void) {
6797 IUriBuilder
*builder
;
6800 for(i
= 0; i
< sizeof(uri_builder_tests
)/sizeof(uri_builder_tests
[0]); ++i
) {
6802 uri_builder_test test
= uri_builder_tests
[i
];
6805 uriW
= a2w(test
.uri
);
6806 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
6807 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6810 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
6811 if(test
.create_builder_todo
) {
6813 ok(hr
== test
.create_builder_expected
,
6814 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6815 hr
, test
.create_builder_expected
, i
);
6818 ok(hr
== test
.create_builder_expected
,
6819 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6820 hr
, test
.create_builder_expected
, i
);
6824 BOOL modified
= FALSE
, received
= FALSE
;
6826 /* Perform all the string property changes. */
6827 for(j
= 0; j
< URI_BUILDER_STR_PROPERTY_COUNT
; ++j
) {
6828 uri_builder_property prop
= test
.properties
[j
];
6831 change_property(builder
, &prop
, i
);
6835 if(test
.port_prop
.change
) {
6836 hr
= IUriBuilder_SetPort(builder
, test
.port_prop
.set
, test
.port_prop
.value
);
6838 if(test
.port_prop
.todo
) {
6840 ok(hr
== test
.port_prop
.expected
,
6841 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6842 hr
, test
.port_prop
.expected
, i
);
6845 ok(hr
== test
.port_prop
.expected
,
6846 "Error: IUriBuilder_SetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6847 hr
, test
.port_prop
.expected
, i
);
6851 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
6854 "Error IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].\n",
6859 ok(received
== modified
,
6860 "Error: Expected received to be %d but was %d instead on uri_builder_tests[%d].\n",
6861 modified
, received
, i
);
6865 /* Test the "Get*" functions. */
6866 test_IUriBuilder_GetFragment(builder
, &test
, i
);
6867 test_IUriBuilder_GetHost(builder
, &test
, i
);
6868 test_IUriBuilder_GetPassword(builder
, &test
, i
);
6869 test_IUriBuilder_GetPath(builder
, &test
, i
);
6870 test_IUriBuilder_GetPort(builder
, &test
, i
);
6871 test_IUriBuilder_GetQuery(builder
, &test
, i
);
6872 test_IUriBuilder_GetSchemeName(builder
, &test
, i
);
6873 test_IUriBuilder_GetUserName(builder
, &test
, i
);
6875 test_IUriBuilder_CreateUri(builder
, &test
, i
);
6876 test_IUriBuilder_CreateUriSimple(builder
, &test
, i
);
6877 test_IUriBuilder_CreateUriWithFlags(builder
, &test
, i
);
6879 if(builder
) IUriBuilder_Release(builder
);
6881 if(uri
) IUri_Release(uri
);
6885 static void test_IUriBuilder_HasBeenModified(void) {
6887 IUriBuilder
*builder
= NULL
;
6889 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
6890 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6892 static const WCHAR hostW
[] = {'w','i','n','e','h','q','.','c','o','m',0};
6896 hr
= IUriBuilder_HasBeenModified(builder
, NULL
);
6897 ok(hr
== E_POINTER
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
6900 hr
= IUriBuilder_SetHost(builder
, hostW
);
6902 ok(hr
== S_OK
, "Error: IUriBuilder_SetHost returned 0x%08x, expected 0x%08x.\n",
6906 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
6908 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
6912 todo_wine
{ ok(received
== TRUE
, "Error: Expected received to be TRUE.\n"); }
6914 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
6915 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6917 hr
= IUriBuilder_SetIUri(builder
, uri
);
6919 ok(hr
== S_OK
, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n",
6923 hr
= IUriBuilder_HasBeenModified(builder
, &received
);
6925 ok(hr
== S_OK
, "Error: IUriBuilder_HasBeenModified returned 0x%08x, expected 0x%08x.\n",
6929 todo_wine
{ ok(received
== FALSE
, "Error: Expected received to be FALSE.\n"); }
6931 if(uri
) IUri_Release(uri
);
6933 if(builder
) IUriBuilder_Release(builder
);
6936 /* Test IUriBuilder {Get,Set}IUri functions. */
6937 static void test_IUriBuilder_IUriProperty(void) {
6938 IUriBuilder
*builder
= NULL
;
6941 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
6942 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6946 hr
= IUriBuilder_GetIUri(builder
, NULL
);
6947 ok(hr
== E_POINTER
, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
6950 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
6952 ULONG cur_count
, orig_count
;
6954 /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
6955 orig_count
= get_refcnt(uri
);
6956 hr
= IUriBuilder_SetIUri(builder
, uri
);
6957 cur_count
= get_refcnt(uri
);
6960 ok(cur_count
== orig_count
+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
6961 orig_count
+1, cur_count
);
6965 hr
= IUriBuilder_SetIUri(builder
, NULL
);
6966 cur_count
= get_refcnt(uri
);
6969 ok(cur_count
== orig_count
, "Error: Expected uri ref count to be %d, but was %d instead.\n",
6970 orig_count
, cur_count
);
6974 if(uri
) IUri_Release(uri
);
6976 if(builder
) IUriBuilder_Release(builder
);
6979 static void test_IUriBuilder_RemoveProperties(void) {
6980 IUriBuilder
*builder
= NULL
;
6984 hr
= pCreateIUriBuilder(NULL
, 0, 0, &builder
);
6985 ok(hr
== S_OK
, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
6987 /* Properties that can't be removed. */
6988 const DWORD invalid
= Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|
6989 Uri_HAS_SCHEME
|Uri_HAS_ZONE
;
6991 for(i
= Uri_PROPERTY_STRING_START
; i
<= Uri_PROPERTY_DWORD_LAST
; ++i
) {
6992 hr
= IUriBuilder_RemoveProperties(builder
, i
<< 1);
6993 if((i
<< 1) & invalid
) {
6995 ok(hr
== E_INVALIDARG
,
6996 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
6997 hr
, E_INVALIDARG
, i
);
7002 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x with prop=%d.\n",
7008 if(builder
) IUriBuilder_Release(builder
);
7010 for(i
= 0; i
< sizeof(uri_builder_remove_tests
)/sizeof(uri_builder_remove_tests
[0]); ++i
) {
7011 uri_builder_remove_test test
= uri_builder_remove_tests
[i
];
7015 uriW
= a2w(test
.uri
);
7016 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
7020 hr
= pCreateIUriBuilder(uri
, 0, 0, &builder
);
7021 if(test
.create_builder_todo
) {
7023 ok(hr
== test
.create_builder_expected
,
7024 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
7025 hr
, test
.create_builder_expected
, i
);
7028 ok(hr
== test
.create_builder_expected
,
7029 "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
7030 hr
, test
.create_builder_expected
, i
);
7033 hr
= IUriBuilder_RemoveProperties(builder
, test
.remove_properties
);
7034 if(test
.remove_todo
) {
7036 ok(hr
== test
.remove_expected
,
7037 "Error: IUriBuilder_RemoveProperties returned 0x%08x, expected 0x%08x on test %d.\n",
7038 hr
, test
.remove_expected
, i
);
7041 ok(hr
== test
.remove_expected
,
7042 "Error: IUriBuilder returned 0x%08x, expected 0x%08x on test %d.\n",
7043 hr
, test
.remove_expected
, i
);
7046 IUri
*result
= NULL
;
7048 hr
= IUriBuilder_CreateUri(builder
, test
.expected_flags
, 0, 0, &result
);
7049 if(test
.expected_todo
) {
7051 ok(hr
== test
.expected_hres
,
7052 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
7053 hr
, test
.expected_hres
, i
);
7056 ok(hr
== test
.expected_hres
,
7057 "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x on test %d.\n",
7058 hr
, test
.expected_hres
, i
);
7061 BSTR received
= NULL
;
7063 hr
= IUri_GetAbsoluteUri(result
, &received
);
7064 ok(!strcmp_aw(test
.expected_uri
, received
),
7065 "Error: Expected %s but got %s instead on test %d.\n",
7066 test
.expected_uri
, wine_dbgstr_w(received
), i
);
7067 SysFreeString(received
);
7069 if(result
) IUri_Release(result
);
7072 if(builder
) IUriBuilder_Release(builder
);
7074 if(uri
) IUri_Release(uri
);
7082 hurlmon
= GetModuleHandle("urlmon.dll");
7083 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
7084 pCreateUriWithFragment
= (void*) GetProcAddress(hurlmon
, "CreateUriWithFragment");
7085 pCreateIUriBuilder
= (void*) GetProcAddress(hurlmon
, "CreateIUriBuilder");
7088 win_skip("CreateUri is not present, skipping tests.\n");
7092 trace("test CreateUri invalid flags...\n");
7093 test_CreateUri_InvalidFlags();
7095 trace("test CreateUri invalid args...\n");
7096 test_CreateUri_InvalidArgs();
7098 trace("test CreateUri invalid URIs...\n");
7099 test_CreateUri_InvalidUri();
7101 trace("test IUri_GetPropertyBSTR...\n");
7102 test_IUri_GetPropertyBSTR();
7104 trace("test IUri_GetPropertyDWORD...\n");
7105 test_IUri_GetPropertyDWORD();
7107 trace("test IUri_GetStrProperties...\n");
7108 test_IUri_GetStrProperties();
7110 trace("test IUri_GetDwordProperties...\n");
7111 test_IUri_GetDwordProperties();
7113 trace("test IUri_GetPropertyLength...\n");
7114 test_IUri_GetPropertyLength();
7116 trace("test IUri_GetProperties...\n");
7117 test_IUri_GetProperties();
7119 trace("test IUri_HasProperty...\n");
7120 test_IUri_HasProperty();
7122 trace("test IUri_IsEqual...\n");
7123 test_IUri_IsEqual();
7125 trace("test CreateUriWithFragment invalid args...\n");
7126 test_CreateUriWithFragment_InvalidArgs();
7128 trace("test CreateUriWithFragment invalid flags...\n");
7129 test_CreateUriWithFragment_InvalidFlags();
7131 trace("test CreateUriWithFragment...\n");
7132 test_CreateUriWithFragment();
7134 trace("test CreateIUriBuilder...\n");
7135 test_CreateIUriBuilder();
7137 trace("test IUriBuilder_CreateInvalidArgs...\n");
7138 test_IUriBuilder_CreateInvalidArgs();
7140 trace("test IUriBuilder...\n");
7143 trace("test IUriBuilder_GetInvalidArgs...\n");
7144 test_IUriBuilder_GetInvalidArgs();
7146 trace("test IUriBuilder_HasBeenModified...\n");
7147 test_IUriBuilder_HasBeenModified();
7149 trace("test IUriBuilder_IUriProperty...\n");
7150 test_IUriBuilder_IUriProperty();
7152 trace("test IUriBuilder_RemoveProperties...\n");
7153 test_IUriBuilder_RemoveProperties();