urlmon/tests: Added more test URI's.
This commit is contained in:
parent
eff59a5107
commit
520902cb16
|
@ -884,6 +884,341 @@ static const uri_properties uri_tests[] = {
|
|||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Make sure % encoded unreserved characters are decoded. */
|
||||
{ "ftp://w%49%4Ee:PA%53%53@ftp.google.com/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://wINe:PASS@ftp.google.com/",S_OK,TRUE},
|
||||
{"wINe:PASS@ftp.google.com",S_OK,TRUE},
|
||||
{"ftp://ftp.google.com/",S_OK,TRUE},
|
||||
{"google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp.google.com",S_OK,TRUE},
|
||||
{"PASS",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://w%49%4Ee:PA%53%53@ftp.google.com/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"wINe:PASS",S_OK,TRUE},
|
||||
{"wINe",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Make sure % encoded characters which are NOT unreserved are NOT decoded. */
|
||||
{ "ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,TRUE},
|
||||
{"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,TRUE},
|
||||
{"ftp://ftp.google.com/",S_OK,TRUE},
|
||||
{"google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp.google.com",S_OK,TRUE},
|
||||
{"PA%7B%7D",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"w%5D%5Be:PA%7B%7D",S_OK,TRUE},
|
||||
{"w%5D%5Be",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* You're allowed to have an empty password portion in the userinfo section. */
|
||||
{ "ftp://empty:@ftp.google.com/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://empty:@ftp.google.com/",S_OK,TRUE},
|
||||
{"empty:@ftp.google.com",S_OK,TRUE},
|
||||
{"ftp://ftp.google.com/",S_OK,TRUE},
|
||||
{"google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp.google.com",S_OK,TRUE},
|
||||
{"",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://empty:@ftp.google.com/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"empty:",S_OK,TRUE},
|
||||
{"empty",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Make sure forbidden characters in "userinfo" get encoded. */
|
||||
{ "ftp://\" \"weird@ftp.google.com/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://%22%20%22weird@ftp.google.com/",S_OK,TRUE},
|
||||
{"%22%20%22weird@ftp.google.com",S_OK,TRUE},
|
||||
{"ftp://ftp.google.com/",S_OK,TRUE},
|
||||
{"google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp.google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"%22%20%22weird",S_OK,TRUE},
|
||||
{"%22%20%22weird",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Make sure the forbidden characters don't get percent encoded. */
|
||||
{ "ftp://\" \"weird@ftp.google.com/", Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://\" \"weird@ftp.google.com/",S_OK,TRUE},
|
||||
{"\" \"weird@ftp.google.com",S_OK,TRUE},
|
||||
{"ftp://ftp.google.com/",S_OK,TRUE},
|
||||
{"google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp.google.com",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://\" \"weird@ftp.google.com/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"\" \"weird",S_OK,TRUE},
|
||||
{"\" \"weird",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Allowed to have invalid % encoded because its an unknown scheme type. */
|
||||
{ "zip://%xy:word@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"zip://%xy:word@winehq.org/",S_OK,TRUE},
|
||||
{"%xy:word@winehq.org",S_OK,TRUE},
|
||||
{"zip://%xy:word@winehq.org/",S_OK,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"word",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"zip://%xy:word@winehq.org/",S_OK,FALSE},
|
||||
{"zip",S_OK,FALSE},
|
||||
{"%xy:word",S_OK,TRUE},
|
||||
{"%xy",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{0,S_FALSE,TRUE},
|
||||
{URL_SCHEME_UNKNOWN,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Unreserved, percent encoded characters aren't decoded in the userinfo becuase the scheme
|
||||
* isn't known.
|
||||
*/
|
||||
{ "zip://%2E:%52%53ord@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE},
|
||||
{"%2E:%52%53ord@winehq.org",S_OK,TRUE},
|
||||
{"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"%52%53ord",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"zip://%2E:%52%53ord@winehq.org/",S_OK,FALSE},
|
||||
{"zip",S_OK,FALSE},
|
||||
{"%2E:%52%53ord",S_OK,TRUE},
|
||||
{"%2E",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{0,S_FALSE,TRUE},
|
||||
{URL_SCHEME_UNKNOWN,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
{ "ftp://[](),'test':word@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|
|
||||
Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|
|
||||
Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|
|
||||
Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://[](),'test':word@winehq.org/",S_OK,TRUE},
|
||||
{"[](),'test':word@winehq.org",S_OK,TRUE},
|
||||
{"ftp://winehq.org/",S_OK,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"word",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://[](),'test':word@winehq.org/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"[](),'test':word",S_OK,TRUE},
|
||||
{"[](),'test'",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
{ "ftp://test?:word@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_HOST|
|
||||
Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
|
||||
Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://test/?:word@winehq.org/",S_OK,TRUE},
|
||||
{"test",S_OK,TRUE},
|
||||
{"ftp://test/?:word@winehq.org/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"test",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/?:word@winehq.org/",S_OK,TRUE},
|
||||
{"?:word@winehq.org/",S_OK,TRUE},
|
||||
{"ftp://test?:word@winehq.org/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
{ "ftp://test#:word@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_FRAGMENT|Uri_HAS_HOST|
|
||||
Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
|
||||
Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"ftp://test/#:word@winehq.org/",S_OK,TRUE},
|
||||
{"test",S_OK,TRUE},
|
||||
{"ftp://test/#:word@winehq.org/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"#:word@winehq.org/",S_OK,TRUE},
|
||||
{"test",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"ftp://test#:word@winehq.org/",S_OK,FALSE},
|
||||
{"ftp",S_OK,FALSE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{21,S_OK,TRUE},
|
||||
{URL_SCHEME_FTP,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
},
|
||||
/* Allowed to have a backslash in the userinfo since it's an unknown scheme. */
|
||||
{ "zip://test\\:word@winehq.org/", 0, S_OK, FALSE,
|
||||
Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN|Uri_HAS_HOST|
|
||||
Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|
|
||||
Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME,
|
||||
TRUE,
|
||||
{
|
||||
{"zip://test\\:word@winehq.org/",S_OK,TRUE},
|
||||
{"test\\:word@winehq.org",S_OK,TRUE},
|
||||
{"zip://test\\:word@winehq.org/",S_OK,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"winehq.org",S_OK,TRUE},
|
||||
{"word",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"/",S_OK,TRUE},
|
||||
{"",S_FALSE,TRUE},
|
||||
{"zip://test\\:word@winehq.org/",S_OK,FALSE},
|
||||
{"zip",S_OK,FALSE},
|
||||
{"test\\:word",S_OK,TRUE},
|
||||
{"test\\",S_OK,TRUE}
|
||||
},
|
||||
{
|
||||
{Uri_HOST_DNS,S_OK,TRUE},
|
||||
{0,S_FALSE,TRUE},
|
||||
{URL_SCHEME_UNKNOWN,S_OK,FALSE},
|
||||
{URLZONE_INVALID,E_NOTIMPL,FALSE}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue