Implement and test URLIS_URL flag in UrlIs().
This commit is contained in:
parent
18511a38e7
commit
8310bd5328
|
@ -235,7 +235,8 @@ struct {
|
|||
{"http://foo/bar", TRUE},
|
||||
{"c:\\foo\\bar", FALSE},
|
||||
{"foo://foo/bar", TRUE},
|
||||
{"foo\\bar", FALSE}
|
||||
{"foo\\bar", FALSE},
|
||||
{"foo.bar", FALSE}
|
||||
};
|
||||
|
||||
static LPWSTR GetWideString(const char* szString)
|
||||
|
@ -472,6 +473,19 @@ static void test_UrlCreateFromPath(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void test_UrlIs(void)
|
||||
{
|
||||
BOOL ret;
|
||||
INT i;
|
||||
|
||||
for(i = 0; i < sizeof(TEST_PATH_IS_URL) / sizeof(TEST_PATH_IS_URL[0]); i++) {
|
||||
ret = UrlIsA( TEST_PATH_IS_URL[i].path, URLIS_URL );
|
||||
ok( ret == TEST_PATH_IS_URL[i].expect,
|
||||
"returned %d from path %s, expected %d\n", ret, TEST_PATH_IS_URL[i].path,
|
||||
TEST_PATH_IS_URL[i].expect );
|
||||
}
|
||||
}
|
||||
|
||||
static void test_UrlUnescape(void)
|
||||
{
|
||||
CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH];
|
||||
|
@ -600,6 +614,7 @@ START_TEST(path)
|
|||
test_UrlEscape();
|
||||
test_UrlCombine();
|
||||
test_UrlCreateFromPath();
|
||||
test_UrlIs();
|
||||
test_UrlUnescape();
|
||||
|
||||
test_PathSearchAndQualify();
|
||||
|
|
|
@ -1632,6 +1632,8 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
|
|||
DWORD res1;
|
||||
LPCSTR last;
|
||||
|
||||
TRACE("(%s %d)\n", debugstr_a(pszUrl), Urlis);
|
||||
|
||||
switch (Urlis) {
|
||||
|
||||
case URLIS_OPAQUE:
|
||||
|
@ -1651,6 +1653,8 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
|
|||
return (last >= pszUrl && (*last == '/' || *last == '\\' ));
|
||||
|
||||
case URLIS_URL:
|
||||
return PathIsURLA(pszUrl);
|
||||
|
||||
case URLIS_NOHISTORY:
|
||||
case URLIS_APPLIABLE:
|
||||
case URLIS_HASQUERY:
|
||||
|
@ -1672,6 +1676,8 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
|
|||
DWORD res1;
|
||||
LPCWSTR last;
|
||||
|
||||
TRACE("(%s %d)\n", debugstr_w(pszUrl), Urlis);
|
||||
|
||||
switch (Urlis) {
|
||||
|
||||
case URLIS_OPAQUE:
|
||||
|
@ -1691,6 +1697,8 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
|
|||
return (last >= pszUrl && (*last == '/' || *last == '\\'));
|
||||
|
||||
case URLIS_URL:
|
||||
return PathIsURLW(pszUrl);
|
||||
|
||||
case URLIS_NOHISTORY:
|
||||
case URLIS_APPLIABLE:
|
||||
case URLIS_HASQUERY:
|
||||
|
|
Loading…
Reference in New Issue