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
22 * IUri testing framework goals:
25 * - invalid args (IUri, uri string)
26 * - Test parsing for components when no canonicalization occurs
27 * - Test parsing for components when canonicalization occurs.
31 #include <wine/test.h>
42 #define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
43 #define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
45 static HRESULT (WINAPI
*pCreateUri
)(LPCWSTR
, DWORD
, DWORD_PTR
, IUri
**);
47 static const WCHAR http_urlW
[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
48 '.','o','r','g','/',0};
50 typedef struct _uri_create_flag_test
{
53 } uri_create_flag_test
;
55 static const uri_create_flag_test invalid_flag_tests
[] = {
56 /* Set of invalid flag combinations to test for. */
57 {Uri_CREATE_DECODE_EXTRA_INFO
| Uri_CREATE_NO_DECODE_EXTRA_INFO
, E_INVALIDARG
},
58 {Uri_CREATE_CANONICALIZE
| Uri_CREATE_NO_CANONICALIZE
, E_INVALIDARG
},
59 {Uri_CREATE_CRACK_UNKNOWN_SCHEMES
| Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, E_INVALIDARG
},
60 {Uri_CREATE_PRE_PROCESS_HTML_URI
| Uri_CREATE_NO_PRE_PROCESS_HTML_URI
, E_INVALIDARG
},
61 {Uri_CREATE_IE_SETTINGS
| Uri_CREATE_NO_IE_SETTINGS
, E_INVALIDARG
}
64 typedef struct _uri_str_property
{
70 typedef struct _uri_dword_property
{
76 typedef struct _uri_properties
{
79 HRESULT create_expected
;
84 uri_str_property str_props
[URI_STR_PROPERTY_COUNT
];
85 uri_dword_property dword_props
[URI_DWORD_PROPERTY_COUNT
];
88 static const uri_properties uri_tests
[] = {
89 { "http://www.winehq.org/tests/../tests/../..", 0, S_OK
, FALSE
,
90 /* A flag bitmap containing all the Uri_HAS_* flags that correspond to this uri. */
91 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
92 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
93 Uri_HAS_PORT
|Uri_HAS_SCHEME
,
96 {"http://www.winehq.org/",S_OK
,TRUE
}, /* ABSOLUTE_URI */
97 {"www.winehq.org",S_OK
,TRUE
}, /* AUTHORITY */
98 {"http://www.winehq.org/",S_OK
,TRUE
}, /* DISPLAY_URI */
99 {"winehq.org",S_OK
,TRUE
}, /* DOMAIN */
100 {"",S_FALSE
,TRUE
}, /* EXTENSION */
101 {"",S_FALSE
,TRUE
}, /* FRAGMENT */
102 {"www.winehq.org",S_OK
,TRUE
}, /* HOST */
103 {"",S_FALSE
,TRUE
}, /* PASSWORD */
104 {"/",S_OK
,TRUE
}, /* PATH */
105 {"/",S_OK
,TRUE
}, /* PATH_AND_QUERY */
106 {"",S_FALSE
,TRUE
}, /* QUERY */
107 {"http://www.winehq.org/tests/../tests/../..",S_OK
,FALSE
}, /* RAW_URI */
108 {"http",S_OK
,FALSE
}, /* SCHEME_NAME */
109 {"",S_FALSE
,TRUE
}, /* USER_INFO */
110 {"",S_FALSE
,TRUE
} /* USER_NAME */
113 {Uri_HOST_DNS
,S_OK
,TRUE
}, /* HOST_TYPE */
114 {80,S_OK
,TRUE
}, /* PORT */
115 {URL_SCHEME_HTTP
,S_OK
,FALSE
}, /* SCHEME */
116 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
} /* ZONE */
119 { "http://winehq.org/tests/.././tests", 0, S_OK
, FALSE
,
120 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
121 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
122 Uri_HAS_PORT
|Uri_HAS_SCHEME
,
125 {"http://winehq.org/tests",S_OK
,TRUE
},
126 {"winehq.org",S_OK
,TRUE
},
127 {"http://winehq.org/tests",S_OK
,TRUE
},
128 {"winehq.org",S_OK
,TRUE
},
131 {"winehq.org",S_OK
,TRUE
},
133 {"/tests",S_OK
,TRUE
},
134 {"/tests",S_OK
,TRUE
},
136 {"http://winehq.org/tests/.././tests",S_OK
,FALSE
},
142 {Uri_HOST_DNS
,S_OK
,TRUE
},
144 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
145 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
148 { "HtTp://www.winehq.org/tests/..?query=x&return=y", 0, S_OK
, FALSE
,
149 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
150 Uri_HAS_DOMAIN
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|
151 Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
154 {"http://www.winehq.org/?query=x&return=y",S_OK
,TRUE
},
155 {"www.winehq.org",S_OK
,TRUE
},
156 {"http://www.winehq.org/?query=x&return=y",S_OK
,TRUE
},
157 {"winehq.org",S_OK
,TRUE
},
160 {"www.winehq.org",S_OK
,TRUE
},
163 {"/?query=x&return=y",S_OK
,TRUE
},
164 {"?query=x&return=y",S_OK
,TRUE
},
165 {"HtTp://www.winehq.org/tests/..?query=x&return=y",S_OK
,FALSE
},
171 {Uri_HOST_DNS
,S_OK
,TRUE
},
173 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
174 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
177 { "hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters", 0, S_OK
, FALSE
,
178 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|Uri_HAS_PATH
|
179 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|
180 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
183 {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,TRUE
},
184 {"usEr%3Ainfo@example.com",S_OK
,TRUE
},
185 {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,TRUE
},
186 {"example.com",S_OK
,TRUE
},
189 {"example.com",S_OK
,TRUE
},
191 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,TRUE
},
192 {"/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK
,TRUE
},
194 {"hTTp://us%45r%3Ainfo@examp%4CE.com:80/path/a/b/./c/../%2E%2E/Forbidden'<|> Characters",S_OK
,FALSE
},
196 {"usEr%3Ainfo",S_OK
,TRUE
},
197 {"usEr%3Ainfo",S_OK
,TRUE
}
200 {Uri_HOST_DNS
,S_OK
,TRUE
},
202 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
203 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
},
206 { "ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt", 0, S_OK
, FALSE
,
207 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_EXTENSION
|
208 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
209 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
213 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,TRUE
},
214 {"winepass:wine@ftp.winehq.org:9999",S_OK
,TRUE
},
215 {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK
,TRUE
},
216 {"winehq.org",S_OK
,TRUE
},
219 {"ftp.winehq.org",S_OK
,TRUE
},
221 {"/dir/foo%20bar.txt",S_OK
,TRUE
},
222 {"/dir/foo%20bar.txt",S_OK
,TRUE
},
224 {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo bar.txt",S_OK
,FALSE
},
226 {"winepass:wine",S_OK
,TRUE
},
227 {"winepass",S_OK
,TRUE
}
230 {Uri_HOST_DNS
,S_OK
,TRUE
},
232 {URL_SCHEME_FTP
,S_OK
,FALSE
},
233 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
236 { "file://c:\\tests\\../tests/foo%20bar.mp3", 0, S_OK
, FALSE
,
237 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
238 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
241 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,TRUE
},
243 {"file:///c:/tests/foo%2520bar.mp3",S_OK
,TRUE
},
249 {"/c:/tests/foo%2520bar.mp3",S_OK
,TRUE
},
250 {"/c:/tests/foo%2520bar.mp3",S_OK
,TRUE
},
252 {"file://c:\\tests\\../tests/foo%20bar.mp3",S_OK
,FALSE
},
258 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
260 {URL_SCHEME_FILE
,S_OK
,FALSE
},
261 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
264 { "FILE://localhost/test dir\\../tests/test%20file.README.txt", 0, S_OK
, FALSE
,
265 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
266 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
269 {"file:///tests/test%20file.README.txt",S_OK
,TRUE
},
271 {"file:///tests/test%20file.README.txt",S_OK
,TRUE
},
277 {"/tests/test%20file.README.txt",S_OK
,TRUE
},
278 {"/tests/test%20file.README.txt",S_OK
,TRUE
},
280 {"FILE://localhost/test dir\\../tests/test%20file.README.txt",S_OK
,FALSE
},
286 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
288 {URL_SCHEME_FILE
,S_OK
,FALSE
},
289 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
292 { "urn:nothing:should:happen here", 0, S_OK
, FALSE
,
293 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|
294 Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
297 {"urn:nothing:should:happen here",S_OK
,TRUE
},
299 {"urn:nothing:should:happen here",S_OK
,TRUE
},
305 {"nothing:should:happen here",S_OK
,TRUE
},
306 {"nothing:should:happen here",S_OK
,TRUE
},
308 {"urn:nothing:should:happen here",S_OK
,FALSE
},
314 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
316 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
317 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
320 { "http://127.0.0.1/tests/../test dir/./test.txt", 0, S_OK
, FALSE
,
321 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
322 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
323 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
326 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,TRUE
},
327 {"127.0.0.1",S_OK
,TRUE
},
328 {"http://127.0.0.1/test%20dir/test.txt",S_OK
,TRUE
},
332 {"127.0.0.1",S_OK
,TRUE
},
334 {"/test%20dir/test.txt",S_OK
,TRUE
},
335 {"/test%20dir/test.txt",S_OK
,TRUE
},
337 {"http://127.0.0.1/tests/../test dir/./test.txt",S_OK
,FALSE
},
343 {Uri_HOST_IPV4
,S_OK
,TRUE
},
345 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
346 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
349 { "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", 0, S_OK
, FALSE
,
350 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
351 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
352 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
355 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,TRUE
},
356 {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK
,TRUE
},
357 {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK
,TRUE
},
361 {"fedc:ba98:7654:3210:fedc:ba98:7654:3210",S_OK
,TRUE
},
366 {"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]",S_OK
,FALSE
},
372 {Uri_HOST_IPV6
,S_OK
,TRUE
},
374 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
375 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
378 { "ftp://[::13.1.68.3]", 0, S_OK
, FALSE
,
379 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
380 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
381 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
384 {"ftp://[::13.1.68.3]/",S_OK
,TRUE
},
385 {"[::13.1.68.3]",S_OK
,TRUE
},
386 {"ftp://[::13.1.68.3]/",S_OK
,TRUE
},
390 {"::13.1.68.3",S_OK
,TRUE
},
395 {"ftp://[::13.1.68.3]",S_OK
,FALSE
},
401 {Uri_HOST_IPV6
,S_OK
,TRUE
},
403 {URL_SCHEME_FTP
,S_OK
,FALSE
},
404 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
407 { "http://[FEDC:BA98:0:0:0:0:0:3210]", 0, S_OK
, FALSE
,
408 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
409 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
410 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
413 {"http://[fedc:ba98::3210]/",S_OK
,TRUE
},
414 {"[fedc:ba98::3210]",S_OK
,TRUE
},
415 {"http://[fedc:ba98::3210]/",S_OK
,TRUE
},
419 {"fedc:ba98::3210",S_OK
,TRUE
},
424 {"http://[FEDC:BA98:0:0:0:0:0:3210]",S_OK
,FALSE
},
430 {Uri_HOST_IPV6
,S_OK
,TRUE
},
432 {URL_SCHEME_HTTP
,S_OK
,FALSE
},
433 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
436 { "1234://www.winehq.org", 0, S_OK
, FALSE
,
437 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
438 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
439 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
442 {"1234://www.winehq.org/",S_OK
,TRUE
},
443 {"www.winehq.org",S_OK
,TRUE
},
444 {"1234://www.winehq.org/",S_OK
,TRUE
},
445 {"winehq.org",S_OK
,TRUE
},
448 {"www.winehq.org",S_OK
,TRUE
},
453 {"1234://www.winehq.org",S_OK
,FALSE
},
459 {Uri_HOST_DNS
,S_OK
,TRUE
},
461 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
462 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
465 { "://www.winehq.org", 0, E_INVALIDARG
, FALSE
,
485 {Uri_HOST_UNKNOWN
,S_FALSE
,TRUE
},
487 {URL_SCHEME_UNKNOWN
,S_FALSE
,FALSE
},
488 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
491 /* Window's doesn't like URI's which are implicitly file paths without the ALLOW_IMPLICIT_FILE_SCHEME flag set. */
492 { "C:/test/test.mp3", 0, E_INVALIDARG
, FALSE
,
512 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
514 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
515 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
518 /* Window's doesn't like URI's which are implicitly file paths without the ALLOW_IMPLICIT_FILE_SCHEME flag set. */
519 { "\\\\Server/test/test.mp3", 0, E_INVALIDARG
, FALSE
,
539 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
541 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
542 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
545 /* Window's doesn't like URI's which are implicitly file paths without the ALLOW_IMPLICIT_FILE_SCHEME flag set. */
546 { "\\\\Server/test/test.mp3", Uri_CREATE_ALLOW_RELATIVE
, E_INVALIDARG
, FALSE
,
566 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
568 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
569 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
572 /* Window's doesn't like URI's which are implicitly file paths without the ALLOW_IMPLICIT_FILE_SCHEME flag set. */
573 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, E_INVALIDARG
, FALSE
,
593 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
595 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
596 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
599 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
600 { "C:/test/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
601 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
602 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
605 {"file:///C:/test/test.mp3",S_OK
,TRUE
},
607 {"file:///C:/test/test.mp3",S_OK
,TRUE
},
613 {"/C:/test/test.mp3",S_OK
,TRUE
},
614 {"/C:/test/test.mp3",S_OK
,TRUE
},
616 {"C:/test/test.mp3",S_OK
,FALSE
},
622 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
624 {URL_SCHEME_FILE
,S_OK
,FALSE
},
625 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
628 /* Test's to make sure the parser/canonicalizer handles implicit file schemes correctly. */
629 { "\\\\Server/test.mp3", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
, S_OK
, FALSE
,
630 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|
631 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_HOST
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
632 Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
635 {"file://server/test.mp3",S_OK
,TRUE
},
636 {"server",S_OK
,TRUE
},
637 {"file://server/test.mp3",S_OK
,TRUE
},
641 {"server",S_OK
,TRUE
},
643 {"/test.mp3",S_OK
,TRUE
},
644 {"/test.mp3",S_OK
,TRUE
},
646 {"\\\\Server/test.mp3",S_OK
,FALSE
},
652 {Uri_HOST_DNS
,S_OK
,TRUE
},
654 {URL_SCHEME_FILE
,S_OK
,FALSE
},
655 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
658 { "www.winehq.org/test", Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
659 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
660 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
664 {"*:www.winehq.org/test",S_OK
,TRUE
},
665 {"www.winehq.org",S_OK
,TRUE
},
666 {"*:www.winehq.org/test",S_OK
,TRUE
},
667 {"winehq.org",S_OK
,TRUE
},
670 {"www.winehq.org",S_OK
,TRUE
},
675 {"www.winehq.org/test",S_OK
,FALSE
},
681 {Uri_HOST_DNS
,S_OK
,TRUE
},
683 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
684 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
687 /* Valid since the '*' is the only character in the scheme name. */
688 { "*:www.winehq.org/test", 0, S_OK
, FALSE
,
689 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
690 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|
694 {"*:www.winehq.org/test",S_OK
,TRUE
},
695 {"www.winehq.org",S_OK
,TRUE
},
696 {"*:www.winehq.org/test",S_OK
,TRUE
},
697 {"winehq.org",S_OK
,TRUE
},
700 {"www.winehq.org",S_OK
,TRUE
},
705 {"*:www.winehq.org/test",S_OK
,FALSE
},
711 {Uri_HOST_DNS
,S_OK
,TRUE
},
713 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
714 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
717 /* Not valid since a '*' is only allowed to appear if its the only character in scheme. */
718 { "*abcd://not.valid.com", 0, E_INVALIDARG
, FALSE
,
738 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
740 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
741 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
744 /* Not valid since a '*' is only allowed to appear if its the only character in scheme. */
745 { "*a*b*c*d://not.valid.com", 0, E_INVALIDARG
, FALSE
,
765 {Uri_HOST_UNKNOWN
,S_FALSE
,FALSE
},
767 {URL_SCHEME_INVALID
,S_FALSE
,FALSE
},
768 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
771 { "/../some dir/test.ext", Uri_CREATE_ALLOW_RELATIVE
, S_OK
, FALSE
,
772 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
773 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
776 {"/../some dir/test.ext",S_OK
,TRUE
},
778 {"/../some dir/test.ext",S_OK
,TRUE
},
784 {"/../some dir/test.ext",S_OK
,TRUE
},
785 {"/../some dir/test.ext",S_OK
,TRUE
},
787 {"/../some dir/test.ext",S_OK
,FALSE
},
793 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
795 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
796 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
799 { "//implicit/wildcard/uri scheme", Uri_CREATE_ALLOW_RELATIVE
|Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME
, S_OK
, FALSE
,
800 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|Uri_HAS_PATH
|
801 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
804 {"*://implicit/wildcard/uri%20scheme",S_OK
,TRUE
},
806 {"*://implicit/wildcard/uri%20scheme",S_OK
,TRUE
},
812 {"//implicit/wildcard/uri%20scheme",S_OK
,TRUE
},
813 {"//implicit/wildcard/uri%20scheme",S_OK
,TRUE
},
815 {"//implicit/wildcard/uri scheme",S_OK
,FALSE
},
821 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
823 {URL_SCHEME_WILDCARD
,S_OK
,FALSE
},
824 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
827 /* URI is considered opaque since CREATE_NO_CRACK_UNKNOWN_SCHEMES is set and its an unknown scheme. */
828 { "zip://google.com", Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
, S_OK
, FALSE
,
829 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_DISPLAY_URI
|Uri_HAS_EXTENSION
|Uri_HAS_PATH
|
830 Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME_NAME
|
834 {"zip:/.//google.com",S_OK
,TRUE
},
836 {"zip:/.//google.com",S_OK
,TRUE
},
842 {"/.//google.com",S_OK
,TRUE
},
843 {"/.//google.com",S_OK
,TRUE
},
845 {"zip://google.com",S_OK
,FALSE
},
851 {Uri_HOST_UNKNOWN
,S_OK
,TRUE
},
853 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
854 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
857 /* Windows uses the first occurence of ':' to delimit the userinfo. */
858 { "ftp://user:pass:word@winehq.org/", 0, S_OK
, FALSE
,
859 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
860 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
861 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
865 {"ftp://user:pass:word@winehq.org/",S_OK
,TRUE
},
866 {"user:pass:word@winehq.org",S_OK
,TRUE
},
867 {"ftp://winehq.org/",S_OK
,TRUE
},
868 {"winehq.org",S_OK
,TRUE
},
871 {"winehq.org",S_OK
,TRUE
},
872 {"pass:word",S_OK
,TRUE
},
876 {"ftp://user:pass:word@winehq.org/",S_OK
,FALSE
},
878 {"user:pass:word",S_OK
,TRUE
},
882 {Uri_HOST_DNS
,S_OK
,TRUE
},
884 {URL_SCHEME_FTP
,S_OK
,FALSE
},
885 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
888 /* Make sure % encoded unreserved characters are decoded. */
889 { "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK
, FALSE
,
890 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
891 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
892 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
896 {"ftp://wINe:PASS@ftp.google.com/",S_OK
,TRUE
},
897 {"wINe:PASS@ftp.google.com",S_OK
,TRUE
},
898 {"ftp://ftp.google.com/",S_OK
,TRUE
},
899 {"google.com",S_OK
,TRUE
},
902 {"ftp.google.com",S_OK
,TRUE
},
907 {"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK
,FALSE
},
909 {"wINe:PASS",S_OK
,TRUE
},
913 {Uri_HOST_DNS
,S_OK
,TRUE
},
915 {URL_SCHEME_FTP
,S_OK
,FALSE
},
916 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
919 /* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
920 { "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK
, FALSE
,
921 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
922 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
923 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
927 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,TRUE
},
928 {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK
,TRUE
},
929 {"ftp://ftp.google.com/",S_OK
,TRUE
},
930 {"google.com",S_OK
,TRUE
},
933 {"ftp.google.com",S_OK
,TRUE
},
934 {"PA%7B%7D",S_OK
,TRUE
},
938 {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK
,FALSE
},
940 {"w%5D%5Be:PA%7B%7D",S_OK
,TRUE
},
941 {"w%5D%5Be",S_OK
,TRUE
}
944 {Uri_HOST_DNS
,S_OK
,TRUE
},
946 {URL_SCHEME_FTP
,S_OK
,FALSE
},
947 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
950 /* You're allowed to have an empty password portion in the userinfo section. */
951 { "ftp://empty:@ftp.google.com/", 0, S_OK
, FALSE
,
952 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
953 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
954 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
958 {"ftp://empty:@ftp.google.com/",S_OK
,TRUE
},
959 {"empty:@ftp.google.com",S_OK
,TRUE
},
960 {"ftp://ftp.google.com/",S_OK
,TRUE
},
961 {"google.com",S_OK
,TRUE
},
964 {"ftp.google.com",S_OK
,TRUE
},
969 {"ftp://empty:@ftp.google.com/",S_OK
,FALSE
},
971 {"empty:",S_OK
,TRUE
},
975 {Uri_HOST_DNS
,S_OK
,TRUE
},
977 {URL_SCHEME_FTP
,S_OK
,FALSE
},
978 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
981 /* Make sure forbidden characters in "userinfo" get encoded. */
982 { "ftp://\" \"weird@ftp.google.com/", 0, S_OK
, FALSE
,
983 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
984 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
985 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
989 {"ftp://%22%20%22weird@ftp.google.com/",S_OK
,TRUE
},
990 {"%22%20%22weird@ftp.google.com",S_OK
,TRUE
},
991 {"ftp://ftp.google.com/",S_OK
,TRUE
},
992 {"google.com",S_OK
,TRUE
},
995 {"ftp.google.com",S_OK
,TRUE
},
1000 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
1002 {"%22%20%22weird",S_OK
,TRUE
},
1003 {"%22%20%22weird",S_OK
,TRUE
}
1006 {Uri_HOST_DNS
,S_OK
,TRUE
},
1008 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1009 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1012 /* Make sure the forbidden characters don't get percent encoded. */
1013 { "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS
, S_OK
, FALSE
,
1014 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1015 Uri_HAS_HOST
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1016 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
1020 {"ftp://\" \"weird@ftp.google.com/",S_OK
,TRUE
},
1021 {"\" \"weird@ftp.google.com",S_OK
,TRUE
},
1022 {"ftp://ftp.google.com/",S_OK
,TRUE
},
1023 {"google.com",S_OK
,TRUE
},
1026 {"ftp.google.com",S_OK
,TRUE
},
1031 {"ftp://\" \"weird@ftp.google.com/",S_OK
,FALSE
},
1033 {"\" \"weird",S_OK
,TRUE
},
1034 {"\" \"weird",S_OK
,TRUE
}
1037 {Uri_HOST_DNS
,S_OK
,TRUE
},
1039 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1040 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1043 /* Allowed to have invalid % encoded because its an unknown scheme type. */
1044 { "zip://%xy:word@winehq.org/", 0, S_OK
, FALSE
,
1045 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1046 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1047 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1050 {"zip://%xy:word@winehq.org/",S_OK
,TRUE
},
1051 {"%xy:word@winehq.org",S_OK
,TRUE
},
1052 {"zip://%xy:word@winehq.org/",S_OK
,TRUE
},
1053 {"winehq.org",S_OK
,TRUE
},
1056 {"winehq.org",S_OK
,TRUE
},
1061 {"zip://%xy:word@winehq.org/",S_OK
,FALSE
},
1063 {"%xy:word",S_OK
,TRUE
},
1067 {Uri_HOST_DNS
,S_OK
,TRUE
},
1069 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1070 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1073 /* Unreserved, percent encoded characters aren't decoded in the userinfo becuase the scheme
1076 { "zip://%2E:%52%53ord@winehq.org/", 0, S_OK
, FALSE
,
1077 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1078 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1079 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1082 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,TRUE
},
1083 {"%2E:%52%53ord@winehq.org",S_OK
,TRUE
},
1084 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,TRUE
},
1085 {"winehq.org",S_OK
,TRUE
},
1088 {"winehq.org",S_OK
,TRUE
},
1089 {"%52%53ord",S_OK
,TRUE
},
1093 {"zip://%2E:%52%53ord@winehq.org/",S_OK
,FALSE
},
1095 {"%2E:%52%53ord",S_OK
,TRUE
},
1099 {Uri_HOST_DNS
,S_OK
,TRUE
},
1101 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1102 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1105 { "ftp://[](),'test':word@winehq.org/", 0, S_OK
, FALSE
,
1106 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|
1107 Uri_HAS_HOST
|Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|
1108 Uri_HAS_SCHEME_NAME
|Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|
1112 {"ftp://[](),'test':word@winehq.org/",S_OK
,TRUE
},
1113 {"[](),'test':word@winehq.org",S_OK
,TRUE
},
1114 {"ftp://winehq.org/",S_OK
,TRUE
},
1115 {"winehq.org",S_OK
,TRUE
},
1118 {"winehq.org",S_OK
,TRUE
},
1123 {"ftp://[](),'test':word@winehq.org/",S_OK
,FALSE
},
1125 {"[](),'test':word",S_OK
,TRUE
},
1126 {"[](),'test'",S_OK
,TRUE
}
1129 {Uri_HOST_DNS
,S_OK
,TRUE
},
1131 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1132 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1135 { "ftp://test?:word@winehq.org/", 0, S_OK
, FALSE
,
1136 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_HOST
|
1137 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1138 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1141 {"ftp://test/?:word@winehq.org/",S_OK
,TRUE
},
1143 {"ftp://test/?:word@winehq.org/",S_OK
,TRUE
},
1150 {"/?:word@winehq.org/",S_OK
,TRUE
},
1151 {"?:word@winehq.org/",S_OK
,TRUE
},
1152 {"ftp://test?:word@winehq.org/",S_OK
,FALSE
},
1158 {Uri_HOST_DNS
,S_OK
,TRUE
},
1160 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1161 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1164 { "ftp://test#:word@winehq.org/", 0, S_OK
, FALSE
,
1165 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_FRAGMENT
|Uri_HAS_HOST
|
1166 Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1167 Uri_HAS_HOST_TYPE
|Uri_HAS_PORT
|Uri_HAS_SCHEME
,
1170 {"ftp://test/#:word@winehq.org/",S_OK
,TRUE
},
1172 {"ftp://test/#:word@winehq.org/",S_OK
,TRUE
},
1175 {"#:word@winehq.org/",S_OK
,TRUE
},
1181 {"ftp://test#:word@winehq.org/",S_OK
,FALSE
},
1187 {Uri_HOST_DNS
,S_OK
,TRUE
},
1189 {URL_SCHEME_FTP
,S_OK
,FALSE
},
1190 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1193 /* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
1194 { "zip://test\\:word@winehq.org/", 0, S_OK
, FALSE
,
1195 Uri_HAS_ABSOLUTE_URI
|Uri_HAS_AUTHORITY
|Uri_HAS_DISPLAY_URI
|Uri_HAS_DOMAIN
|Uri_HAS_HOST
|
1196 Uri_HAS_PASSWORD
|Uri_HAS_PATH
|Uri_HAS_PATH_AND_QUERY
|Uri_HAS_RAW_URI
|Uri_HAS_SCHEME_NAME
|
1197 Uri_HAS_USER_INFO
|Uri_HAS_USER_NAME
|Uri_HAS_HOST_TYPE
|Uri_HAS_SCHEME
,
1200 {"zip://test\\:word@winehq.org/",S_OK
,TRUE
},
1201 {"test\\:word@winehq.org",S_OK
,TRUE
},
1202 {"zip://test\\:word@winehq.org/",S_OK
,TRUE
},
1203 {"winehq.org",S_OK
,TRUE
},
1206 {"winehq.org",S_OK
,TRUE
},
1211 {"zip://test\\:word@winehq.org/",S_OK
,FALSE
},
1213 {"test\\:word",S_OK
,TRUE
},
1214 {"test\\",S_OK
,TRUE
}
1217 {Uri_HOST_DNS
,S_OK
,TRUE
},
1219 {URL_SCHEME_UNKNOWN
,S_OK
,FALSE
},
1220 {URLZONE_INVALID
,E_NOTIMPL
,FALSE
}
1225 typedef struct _uri_equality
{
1227 DWORD create_flags_a
;
1230 DWORD create_flags_b
;
1236 static const uri_equality equality_tests
[] = {
1238 "HTTP://www.winehq.org/test dir/./",0,FALSE
,
1239 "http://www.winehq.org/test dir/../test dir/",0,FALSE
,
1243 /* http://www.winehq.org/test%20dir */
1244 "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
,
1245 "http://www.winehq.org/test dir",0,FALSE
,
1249 "c:\\test.mp3",Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,FALSE
,
1250 "file:///c:/test.mp3",0,FALSE
,
1254 "ftp://ftp.winehq.org/",0,FALSE
,
1255 "ftp://ftp.winehq.org",0,FALSE
,
1259 "ftp://ftp.winehq.org/test/test2/../../testB/",0,FALSE
,
1260 "ftp://ftp.winehq.org/t%45stB/",0,FALSE
,
1265 static inline LPWSTR
a2w(LPCSTR str
) {
1269 DWORD len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
1270 ret
= HeapAlloc(GetProcessHeap(), 0, len
*sizeof(WCHAR
));
1271 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
1277 static inline BOOL
heap_free(void* mem
) {
1278 return HeapFree(GetProcessHeap(), 0, mem
);
1281 static inline DWORD
strcmp_aw(LPCSTR strA
, LPCWSTR strB
) {
1282 LPWSTR strAW
= a2w(strA
);
1283 DWORD ret
= lstrcmpW(strAW
, strB
);
1289 * Simple tests to make sure the CreateUri function handles invalid flag combinations
1292 static void test_CreateUri_InvalidFlags(void) {
1295 for(i
= 0; i
< sizeof(invalid_flag_tests
)/sizeof(invalid_flag_tests
[0]); ++i
) {
1297 IUri
*uri
= (void*) 0xdeadbeef;
1299 hr
= pCreateUri(http_urlW
, invalid_flag_tests
[i
].flags
, 0, &uri
);
1301 ok(hr
== invalid_flag_tests
[i
].expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
1302 hr
, invalid_flag_tests
[i
].expected
, invalid_flag_tests
[i
].flags
);
1304 todo_wine
{ ok(uri
== NULL
, "Error: expected the IUri to be NULL, but it was %p instead\n", uri
); }
1308 static void test_CreateUri_InvalidArgs(void) {
1310 IUri
*uri
= (void*) 0xdeadbeef;
1312 const WCHAR invalidW
[] = {'i','n','v','a','l','i','d',0};
1314 hr
= pCreateUri(http_urlW
, 0, 0, NULL
);
1315 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
1317 hr
= pCreateUri(NULL
, 0, 0, &uri
);
1318 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr
, E_INVALIDARG
);
1319 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
1321 uri
= (void*) 0xdeadbeef;
1322 hr
= pCreateUri(invalidW
, 0, 0, &uri
);
1323 ok(hr
== E_INVALIDARG
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1324 ok(uri
== NULL
, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri
);
1327 static void test_IUri_GetPropertyBSTR(void) {
1332 /* Make sure GetPropertyBSTR handles invalid args correctly. */
1333 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
1334 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
1336 BSTR received
= NULL
;
1338 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_RAW_URI
, NULL
, 0);
1339 ok(hr
== E_POINTER
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1341 /* Make sure it handles a invalid Uri_PROPERTY's correctly. */
1342 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_PORT
, &received
, 0);
1343 ok(hr
== S_OK
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
1344 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
1345 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
1346 SysFreeString(received
);
1348 /* Make sure it handles the ZONE property correctly. */
1350 hr
= IUri_GetPropertyBSTR(uri
, Uri_PROPERTY_ZONE
, &received
, 0);
1351 ok(hr
== S_FALSE
, "Error: GetPropertyBSTR returned 0x%08x, expected 0x%08x.\n", hr
, S_FALSE
);
1352 ok(received
!= NULL
, "Error: Expected the string not to be NULL.\n");
1353 ok(!SysStringLen(received
), "Error: Expected the string to be of len=0 but it was %d instead.\n", SysStringLen(received
));
1354 SysFreeString(received
);
1356 if(uri
) IUri_Release(uri
);
1358 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
1359 uri_properties test
= uri_tests
[i
];
1363 uriW
= a2w(test
.uri
);
1364 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
1365 if(test
.create_todo
) {
1367 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
1368 hr
, test
.create_expected
, i
);
1371 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
1372 hr
, test
.create_expected
, i
);
1378 /* Checks all the string properties of the uri. */
1379 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
1380 BSTR received
= NULL
;
1381 uri_str_property prop
= test
.str_props
[j
];
1383 hr
= IUri_GetPropertyBSTR(uri
, j
, &received
, 0);
1386 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
1387 hr
, prop
.expected
, i
, j
);
1390 ok(!strcmp_aw(prop
.value
, received
), "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
1391 prop
.value
, wine_dbgstr_w(received
), i
, j
);
1394 ok(hr
== prop
.expected
, "GetPropertyBSTR returned 0x%08x, expected 0x%08x. On uri_tests[%d].str_props[%d].\n",
1395 hr
, prop
.expected
, i
, j
);
1396 ok(!strcmp_aw(prop
.value
, received
), "Expected %s but got %s on uri_tests[%d].str_props[%d].\n",
1397 prop
.value
, wine_dbgstr_w(received
), i
, j
);
1400 SysFreeString(received
);
1404 if(uri
) IUri_Release(uri
);
1410 static void test_IUri_GetPropertyDWORD(void) {
1415 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
1416 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
1418 DWORD received
= 0xdeadbeef;
1420 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_DWORD_START
, NULL
, 0);
1421 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1423 hr
= IUri_GetPropertyDWORD(uri
, Uri_PROPERTY_ABSOLUTE_URI
, &received
, 0);
1424 ok(hr
== E_INVALIDARG
, "Error: GetPropertyDWORD returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1425 ok(received
== 0, "Error: Expected received=%d but instead received=%d.\n", 0, received
);
1427 if(uri
) IUri_Release(uri
);
1429 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
1430 uri_properties test
= uri_tests
[i
];
1434 uriW
= a2w(test
.uri
);
1435 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
1436 if(test
.create_todo
) {
1438 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
1439 hr
, test
.create_expected
, i
);
1442 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x. Failed on uri_tests[%d].\n",
1443 hr
, test
.create_expected
, i
);
1449 /* Checks all the DWORD properties of the uri. */
1450 for(j
= 0; j
< sizeof(test
.dword_props
)/sizeof(test
.dword_props
[0]); ++j
) {
1452 uri_dword_property prop
= test
.dword_props
[j
];
1454 hr
= IUri_GetPropertyDWORD(uri
, j
+Uri_PROPERTY_DWORD_START
, &received
, 0);
1457 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
1458 hr
, prop
.expected
, i
, j
);
1461 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
1462 prop
.value
, received
, i
, j
);
1465 ok(hr
== prop
.expected
, "GetPropertyDWORD returned 0x%08x, expected 0x%08x. On uri_tests[%d].dword_props[%d].\n",
1466 hr
, prop
.expected
, i
, j
);
1467 ok(prop
.value
== received
, "Expected %d but got %d on uri_tests[%d].dword_props[%d].\n",
1468 prop
.value
, received
, i
, j
);
1473 if(uri
) IUri_Release(uri
);
1479 /* Tests all the 'Get*' property functions which deal with strings. */
1480 static void test_IUri_GetStrProperties(void) {
1485 /* Make sure all the 'Get*' string property functions handle invalid args correctly. */
1486 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
1487 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
1489 hr
= IUri_GetAbsoluteUri(uri
, NULL
);
1490 ok(hr
== E_POINTER
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1492 hr
= IUri_GetAuthority(uri
, NULL
);
1493 ok(hr
== E_POINTER
, "Error: GetAuthority returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1495 hr
= IUri_GetDisplayUri(uri
, NULL
);
1496 ok(hr
== E_POINTER
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1498 hr
= IUri_GetDomain(uri
, NULL
);
1499 ok(hr
== E_POINTER
, "Error: GetDomain returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1501 hr
= IUri_GetExtension(uri
, NULL
);
1502 ok(hr
== E_POINTER
, "Error: GetExtension returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1504 hr
= IUri_GetFragment(uri
, NULL
);
1505 ok(hr
== E_POINTER
, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1507 hr
= IUri_GetHost(uri
, NULL
);
1508 ok(hr
== E_POINTER
, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1510 hr
= IUri_GetPassword(uri
, NULL
);
1511 ok(hr
== E_POINTER
, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1513 hr
= IUri_GetPath(uri
, NULL
);
1514 ok(hr
== E_POINTER
, "Error: GetPath returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1516 hr
= IUri_GetPathAndQuery(uri
, NULL
);
1517 ok(hr
== E_POINTER
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1519 hr
= IUri_GetQuery(uri
, NULL
);
1520 ok(hr
== E_POINTER
, "Error: GetQuery returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1522 hr
= IUri_GetRawUri(uri
, NULL
);
1523 ok(hr
== E_POINTER
, "Error: GetRawUri returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1525 hr
= IUri_GetSchemeName(uri
, NULL
);
1526 ok(hr
== E_POINTER
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1528 hr
= IUri_GetUserInfo(uri
, NULL
);
1529 ok(hr
== E_POINTER
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1531 hr
= IUri_GetUserName(uri
, NULL
);
1532 ok(hr
== E_POINTER
, "Error: GetUserName returned 0x%08x, expected 0x%08x.\n", hr
, E_POINTER
);
1534 if(uri
) IUri_Release(uri
);
1536 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
1537 uri_properties test
= uri_tests
[i
];
1541 uriW
= a2w(test
.uri
);
1542 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
1543 if(test
.create_todo
) {
1545 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1546 hr
, test
.create_expected
, i
);
1549 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1550 hr
, test
.create_expected
, i
);
1554 uri_str_property prop
;
1555 BSTR received
= NULL
;
1557 /* GetAbsoluteUri() tests. */
1558 prop
= test
.str_props
[Uri_PROPERTY_ABSOLUTE_URI
];
1559 hr
= IUri_GetAbsoluteUri(uri
, &received
);
1562 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1563 hr
, prop
.expected
, i
);
1566 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1567 prop
.value
, wine_dbgstr_w(received
), i
);
1570 ok(hr
== prop
.expected
, "Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1571 hr
, prop
.expected
, i
);
1572 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1573 prop
.value
, wine_dbgstr_w(received
), i
);
1575 SysFreeString(received
);
1578 /* GetAuthority() tests. */
1579 prop
= test
.str_props
[Uri_PROPERTY_AUTHORITY
];
1580 hr
= IUri_GetAuthority(uri
, &received
);
1583 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1584 hr
, prop
.expected
, i
);
1587 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1588 prop
.value
, wine_dbgstr_w(received
), i
);
1591 ok(hr
== prop
.expected
, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1592 hr
, prop
.expected
, i
);
1593 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1594 prop
.value
, wine_dbgstr_w(received
), i
);
1596 SysFreeString(received
);
1599 /* GetDisplayUri() tests. */
1600 prop
= test
.str_props
[Uri_PROPERTY_DISPLAY_URI
];
1601 hr
= IUri_GetDisplayUri(uri
, &received
);
1604 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1605 hr
, prop
.expected
, i
);
1608 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_test[%d].\n",
1609 prop
.value
, wine_dbgstr_w(received
), i
);
1612 ok(hr
== prop
.expected
, "Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1613 hr
, prop
.expected
, i
);
1614 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1615 prop
.value
, wine_dbgstr_w(received
), i
);
1617 SysFreeString(received
);
1620 /* GetDomain() tests. */
1621 prop
= test
.str_props
[Uri_PROPERTY_DOMAIN
];
1622 hr
= IUri_GetDomain(uri
, &received
);
1625 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1626 hr
, prop
.expected
, i
);
1629 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1630 prop
.value
, wine_dbgstr_w(received
), i
);
1633 ok(hr
== prop
.expected
, "Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1634 hr
, prop
.expected
, i
);
1635 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1636 prop
.value
, wine_dbgstr_w(received
), i
);
1638 SysFreeString(received
);
1641 /* GetExtension() tests. */
1642 prop
= test
.str_props
[Uri_PROPERTY_EXTENSION
];
1643 hr
= IUri_GetExtension(uri
, &received
);
1646 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1647 hr
, prop
.expected
, i
);
1650 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1651 prop
.value
, wine_dbgstr_w(received
), i
);
1654 ok(hr
== prop
.expected
, "Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1655 hr
, prop
.expected
, i
);
1656 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1657 prop
.value
, wine_dbgstr_w(received
), i
);
1659 SysFreeString(received
);
1662 /* GetFragment() tests. */
1663 prop
= test
.str_props
[Uri_PROPERTY_FRAGMENT
];
1664 hr
= IUri_GetFragment(uri
, &received
);
1667 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1668 hr
, prop
.expected
, i
);
1671 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1672 prop
.value
, wine_dbgstr_w(received
), i
);
1675 ok(hr
== prop
.expected
, "Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1676 hr
, prop
.expected
, i
);
1677 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1678 prop
.value
, wine_dbgstr_w(received
), i
);
1680 SysFreeString(received
);
1683 /* GetHost() tests. */
1684 prop
= test
.str_props
[Uri_PROPERTY_HOST
];
1685 hr
= IUri_GetHost(uri
, &received
);
1688 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1689 hr
, prop
.expected
, i
);
1692 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1693 prop
.value
, wine_dbgstr_w(received
), i
);
1696 ok(hr
== prop
.expected
, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1697 hr
, prop
.expected
, i
);
1698 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1699 prop
.value
, wine_dbgstr_w(received
), i
);
1701 SysFreeString(received
);
1704 /* GetPassword() tests. */
1705 prop
= test
.str_props
[Uri_PROPERTY_PASSWORD
];
1706 hr
= IUri_GetPassword(uri
, &received
);
1709 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1710 hr
, prop
.expected
, i
);
1713 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1714 prop
.value
, wine_dbgstr_w(received
), i
);
1717 ok(hr
== prop
.expected
, "Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1718 hr
, prop
.expected
, i
);
1719 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1720 prop
.value
, wine_dbgstr_w(received
), i
);
1722 SysFreeString(received
);
1725 /* GetPath() tests. */
1726 prop
= test
.str_props
[Uri_PROPERTY_PATH
];
1727 hr
= IUri_GetPath(uri
, &received
);
1730 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1731 hr
, prop
.expected
, i
);
1734 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1735 prop
.value
, wine_dbgstr_w(received
), i
);
1738 ok(hr
== prop
.expected
, "Error: GetPath returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1739 hr
, prop
.expected
, i
);
1740 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1741 prop
.value
, wine_dbgstr_w(received
), i
);
1743 SysFreeString(received
);
1746 /* GetPathAndQuery() tests. */
1747 prop
= test
.str_props
[Uri_PROPERTY_PATH_AND_QUERY
];
1748 hr
= IUri_GetPathAndQuery(uri
, &received
);
1751 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1752 hr
, prop
.expected
, i
);
1755 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1756 prop
.value
, wine_dbgstr_w(received
), i
);
1759 ok(hr
== prop
.expected
, "Error: GetPathAndQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1760 hr
, prop
.expected
, i
);
1761 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1762 prop
.value
, wine_dbgstr_w(received
), i
);
1764 SysFreeString(received
);
1767 /* GetQuery() tests. */
1768 prop
= test
.str_props
[Uri_PROPERTY_QUERY
];
1769 hr
= IUri_GetQuery(uri
, &received
);
1772 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1773 hr
, prop
.expected
, i
);
1776 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1777 prop
.value
, wine_dbgstr_w(received
), i
);
1780 ok(hr
== prop
.expected
, "Error: GetQuery returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1781 hr
, prop
.expected
, i
);
1782 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1783 prop
.value
, wine_dbgstr_w(received
), i
);
1785 SysFreeString(received
);
1788 /* GetRawUri() tests. */
1789 prop
= test
.str_props
[Uri_PROPERTY_RAW_URI
];
1790 hr
= IUri_GetRawUri(uri
, &received
);
1793 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1794 hr
, prop
.expected
, i
);
1797 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1798 prop
.value
, wine_dbgstr_w(received
), i
);
1801 ok(hr
== prop
.expected
, "Error: GetRawUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1802 hr
, prop
.expected
, i
);
1803 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1804 prop
.value
, wine_dbgstr_w(received
), i
);
1806 SysFreeString(received
);
1809 /* GetSchemeName() tests. */
1810 prop
= test
.str_props
[Uri_PROPERTY_SCHEME_NAME
];
1811 hr
= IUri_GetSchemeName(uri
, &received
);
1814 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1815 hr
, prop
.expected
, i
);
1818 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1819 prop
.value
, wine_dbgstr_w(received
), i
);
1822 ok(hr
== prop
.expected
, "Error: GetSchemeName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1823 hr
, prop
.expected
, i
);
1824 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1825 prop
.value
, wine_dbgstr_w(received
), i
);
1827 SysFreeString(received
);
1830 /* GetUserInfo() tests. */
1831 prop
= test
.str_props
[Uri_PROPERTY_USER_INFO
];
1832 hr
= IUri_GetUserInfo(uri
, &received
);
1835 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1836 hr
, prop
.expected
, i
);
1839 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1840 prop
.value
, wine_dbgstr_w(received
), i
);
1843 ok(hr
== prop
.expected
, "Error: GetUserInfo returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1844 hr
, prop
.expected
, i
);
1845 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1846 prop
.value
, wine_dbgstr_w(received
), i
);
1848 SysFreeString(received
);
1851 /* GetUserName() tests. */
1852 prop
= test
.str_props
[Uri_PROPERTY_USER_NAME
];
1853 hr
= IUri_GetUserName(uri
, &received
);
1856 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1857 hr
, prop
.expected
, i
);
1860 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1861 prop
.value
, wine_dbgstr_w(received
), i
);
1864 ok(hr
== prop
.expected
, "Error: GetUserName returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1865 hr
, prop
.expected
, i
);
1866 ok(!strcmp_aw(prop
.value
, received
), "Error: Expected %s but got %s on uri_tests[%d].\n",
1867 prop
.value
, wine_dbgstr_w(received
), i
);
1869 SysFreeString(received
);
1872 if(uri
) IUri_Release(uri
);
1878 static void test_IUri_GetDwordProperties(void) {
1883 /* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
1884 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
1885 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
1887 hr
= IUri_GetHostType(uri
, NULL
);
1888 ok(hr
== E_INVALIDARG
, "Error: GetHostType returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1890 hr
= IUri_GetPort(uri
, NULL
);
1891 ok(hr
== E_INVALIDARG
, "Error: GetPort returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1893 hr
= IUri_GetScheme(uri
, NULL
);
1894 ok(hr
== E_INVALIDARG
, "Error: GetScheme returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1896 hr
= IUri_GetZone(uri
, NULL
);
1897 ok(hr
== E_INVALIDARG
, "Error: GetZone returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
1899 if(uri
) IUri_Release(uri
);
1901 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
1902 uri_properties test
= uri_tests
[i
];
1906 uriW
= a2w(test
.uri
);
1907 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
1908 if(test
.create_todo
) {
1910 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1911 hr
, test
.create_expected
, i
);
1914 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1915 hr
, test
.create_expected
, i
);
1919 uri_dword_property prop
;
1922 /* Assign an insane value so tests don't accidentally pass when
1925 received
= -9999999;
1927 /* GetHostType() tests. */
1928 prop
= test
.dword_props
[Uri_PROPERTY_HOST_TYPE
-Uri_PROPERTY_DWORD_START
];
1929 hr
= IUri_GetHostType(uri
, &received
);
1932 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1933 hr
, prop
.expected
, i
);
1936 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1939 ok(hr
== prop
.expected
, "Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1940 hr
, prop
.expected
, i
);
1941 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1943 received
= -9999999;
1945 /* GetPort() tests. */
1946 prop
= test
.dword_props
[Uri_PROPERTY_PORT
-Uri_PROPERTY_DWORD_START
];
1947 hr
= IUri_GetPort(uri
, &received
);
1950 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1951 hr
, prop
.expected
, i
);
1954 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1957 ok(hr
== prop
.expected
, "Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1958 hr
, prop
.expected
, i
);
1959 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1961 received
= -9999999;
1963 /* GetScheme() tests. */
1964 prop
= test
.dword_props
[Uri_PROPERTY_SCHEME
-Uri_PROPERTY_DWORD_START
];
1965 hr
= IUri_GetScheme(uri
, &received
);
1968 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1969 hr
, prop
.expected
, i
);
1972 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1975 ok(hr
== prop
.expected
, "Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1976 hr
, prop
.expected
, i
);
1977 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1979 received
= -9999999;
1981 /* GetZone() tests. */
1982 prop
= test
.dword_props
[Uri_PROPERTY_ZONE
-Uri_PROPERTY_DWORD_START
];
1983 hr
= IUri_GetZone(uri
, &received
);
1986 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1987 hr
, prop
.expected
, i
);
1990 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1993 ok(hr
== prop
.expected
, "Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
1994 hr
, prop
.expected
, i
);
1995 ok(received
== prop
.value
, "Error: Expected %d but got %d on uri_tests[%d].\n", prop
.value
, received
, i
);
1999 if(uri
) IUri_Release(uri
);
2005 static void test_IUri_GetPropertyLength(void) {
2010 /* Make sure it handles invalid args correctly. */
2011 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
2012 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
2014 DWORD received
= 0xdeadbeef;
2016 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_STRING_START
, NULL
, 0);
2017 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
2019 hr
= IUri_GetPropertyLength(uri
, Uri_PROPERTY_DWORD_START
, &received
, 0);
2020 ok(hr
== E_INVALIDARG
, "Error: GetPropertyLength return 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
2021 ok(received
== 0xdeadbeef, "Error: Expected 0xdeadbeef but got 0x%08x.\n", received
);
2023 if(uri
) IUri_Release(uri
);
2025 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
2026 uri_properties test
= uri_tests
[i
];
2030 uriW
= a2w(test
.uri
);
2031 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
2032 if(test
.create_todo
) {
2034 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
2035 hr
, test
.create_expected
, i
);
2038 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x on uri_test[%d].\n",
2039 hr
, test
.create_expected
, i
);
2045 for(j
= Uri_PROPERTY_STRING_START
; j
<= Uri_PROPERTY_STRING_LAST
; ++j
) {
2046 DWORD expectedLen
, receivedLen
;
2047 uri_str_property prop
= test
.str_props
[j
];
2049 expectedLen
= lstrlen(prop
.value
);
2051 /* This won't be necessary once GetPropertyLength is implemented. */
2054 hr
= IUri_GetPropertyLength(uri
, j
, &receivedLen
, 0);
2057 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
2058 hr
, prop
.expected
, i
, j
);
2061 ok(receivedLen
== expectedLen
, "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
2062 expectedLen
, receivedLen
, i
, j
);
2065 ok(hr
== prop
.expected
, "Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].\n",
2066 hr
, prop
.expected
, i
, j
);
2067 ok(receivedLen
== expectedLen
, "Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].\n",
2068 expectedLen
, receivedLen
, i
, j
);
2073 if(uri
) IUri_Release(uri
);
2079 static void test_IUri_GetProperties(void) {
2084 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
2085 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
2087 hr
= IUri_GetProperties(uri
, NULL
);
2088 ok(hr
== E_INVALIDARG
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
2090 if(uri
) IUri_Release(uri
);
2092 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
2093 uri_properties test
= uri_tests
[i
];
2097 uriW
= a2w(test
.uri
);
2098 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
2099 if(test
.create_todo
) {
2101 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
2104 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
2111 hr
= IUri_GetProperties(uri
, &received
);
2112 if(test
.props_todo
) {
2114 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
2117 ok(hr
== S_OK
, "Error: GetProperties returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
2120 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
2121 /* (1 << j) converts a Uri_PROPERTY to its corresponding Uri_HAS_* flag mask. */
2122 if(test
.props
& (1 << j
)) {
2123 if(test
.props_todo
) {
2125 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
2128 ok(received
& (1 << j
), "Error: Expected flag for property %d on uri_tests[%d].\n", j
, i
);
2131 /* NOTE: Since received is initialized to 0, this test will always pass while
2132 * GetProperties is unimplemented.
2134 ok(!(received
& (1 << j
)), "Error: Received flag for property %d when not expected on uri_tests[%d].\n", j
, i
);
2139 if(uri
) IUri_Release(uri
);
2145 static void test_IUri_HasProperty(void) {
2150 hr
= pCreateUri(http_urlW
, 0, 0, &uri
);
2151 ok(hr
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, S_OK
);
2153 hr
= IUri_HasProperty(uri
, Uri_PROPERTY_RAW_URI
, NULL
);
2154 ok(hr
== E_INVALIDARG
, "Error: HasProperty returned 0x%08x, expected 0x%08x.\n", hr
, E_INVALIDARG
);
2156 if(uri
) IUri_Release(uri
);
2158 for(i
= 0; i
< sizeof(uri_tests
)/sizeof(uri_tests
[0]); ++i
) {
2159 uri_properties test
= uri_tests
[i
];
2163 uriW
= a2w(test
.uri
);
2165 hr
= pCreateUri(uriW
, test
.create_flags
, 0, &uri
);
2166 if(test
.create_todo
) {
2168 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
2171 ok(hr
== test
.create_expected
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hr
, test
.create_expected
);
2177 for(j
= 0; j
<= Uri_PROPERTY_DWORD_LAST
; ++j
) {
2178 /* Assign -1, then explicitly test for TRUE or FALSE later. */
2181 hr
= IUri_HasProperty(uri
, j
, &received
);
2182 if(test
.props_todo
) {
2184 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
2188 /* Check if the property should be true. */
2189 if(test
.props
& (1 << j
)) {
2191 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
2195 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
2199 ok(hr
== S_OK
, "Error: HasProperty returned 0x%08x, expected 0x%08x for property %d on uri_tests[%d].\n",
2202 if(test
.props
& (1 << j
)) {
2203 ok(received
== TRUE
, "Error: Expected to have property %d on uri_tests[%d].\n", j
, i
);
2205 ok(received
== FALSE
, "Error: Wasn't expecting to have property %d on uri_tests[%d].\n", j
, i
);
2211 if(uri
) IUri_Release(uri
);
2217 static void test_IUri_IsEqual(void) {
2224 /* Make sure IsEqual handles invalid args correctly. */
2225 hrA
= pCreateUri(http_urlW
, 0, 0, &uriA
);
2226 hrB
= pCreateUri(http_urlW
, 0, 0, &uriB
);
2227 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
2228 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x.\n", hrB
, S_OK
);
2229 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
2231 hrA
= IUri_IsEqual(uriA
, NULL
, &equal
);
2232 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, S_OK
);
2233 ok(equal
== FALSE
, "Error: Expected equal to be FALSE, but was %d instead.\n", equal
);
2235 hrA
= IUri_IsEqual(uriA
, uriB
, NULL
);
2236 ok(hrA
== E_POINTER
, "Error: IsEqual returned 0x%08x, expected 0x%08x.\n", hrA
, E_POINTER
);
2238 if(uriA
) IUri_Release(uriA
);
2239 if(uriB
) IUri_Release(uriB
);
2241 for(i
= 0; i
< sizeof(equality_tests
)/sizeof(equality_tests
[0]); ++i
) {
2242 uri_equality test
= equality_tests
[i
];
2243 LPWSTR uriA_W
, uriB_W
;
2247 uriA_W
= a2w(test
.a
);
2248 uriB_W
= a2w(test
.b
);
2250 hrA
= pCreateUri(uriA_W
, test
.create_flags_a
, 0, &uriA
);
2251 if(test
.create_todo_a
) {
2253 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
2257 ok(hrA
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].a\n",
2261 hrB
= pCreateUri(uriB_W
, test
.create_flags_b
, 0, &uriB
);
2262 if(test
.create_todo_b
) {
2264 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
2268 ok(hrB
== S_OK
, "Error: CreateUri returned 0x%08x, expected 0x%08x on equality_tests[%d].b\n",
2272 if(SUCCEEDED(hrA
) && SUCCEEDED(hrB
)) {
2275 hrA
= IUri_IsEqual(uriA
, uriB
, &equal
);
2278 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n",
2282 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
2285 ok(hrA
== S_OK
, "Error: IsEqual returned 0x%08x, expected 0x%08x on equality_tests[%d].\n", hrA
, S_OK
, i
);
2286 ok(equal
== test
.equal
, "Error: Expected the comparison to be %d on equality_tests[%d].\n", test
.equal
, i
);
2289 if(uriA
) IUri_Release(uriA
);
2290 if(uriB
) IUri_Release(uriB
);
2300 hurlmon
= GetModuleHandle("urlmon.dll");
2301 pCreateUri
= (void*) GetProcAddress(hurlmon
, "CreateUri");
2304 win_skip("CreateUri is not present, skipping tests.\n");
2308 trace("test CreateUri invalid flags...\n");
2309 test_CreateUri_InvalidFlags();
2311 trace("test CreateUri invalid args...\n");
2312 test_CreateUri_InvalidArgs();
2314 trace("test IUri_GetPropertyBSTR...\n");
2315 test_IUri_GetPropertyBSTR();
2317 trace("test IUri_GetPropertyDWORD...\n");
2318 test_IUri_GetPropertyDWORD();
2320 trace("test IUri_GetStrProperties...\n");
2321 test_IUri_GetStrProperties();
2323 trace("test IUri_GetDwordProperties...\n");
2324 test_IUri_GetDwordProperties();
2326 trace("test IUri_GetPropertyLength...\n");
2327 test_IUri_GetPropertyLength();
2329 trace("test IUri_GetProperties...\n");
2330 test_IUri_GetProperties();
2332 trace("test IUri_HasProperty...\n");
2333 test_IUri_HasProperty();
2335 trace("test IUri_IsEqual...\n");
2336 test_IUri_IsEqual();