From ce7eb256bc77aea469c56e2c04b92e91aa3162de Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Sun, 31 Jan 2010 01:22:46 +0100 Subject: [PATCH] shlwapi/tests: UrlIs* is not present on Win95B (winetestbot). --- dlls/shlwapi/tests/url.c | 43 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 8230756ca40..c5d11a1f710 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -31,6 +31,8 @@ /* ################ */ static HMODULE hShlwapi; +static BOOL (WINAPI *pUrlIsA)(LPCSTR,URLIS); +static BOOL (WINAPI *pUrlIsW)(LPCWSTR,URLIS); static HRESULT (WINAPI *pUrlHashA)(LPCSTR,LPBYTE,DWORD); static HRESULT (WINAPI *pUrlHashW)(LPCWSTR,LPBYTE,DWORD); static HRESULT (WINAPI *pUrlGetPartA)(LPCSTR,LPSTR,LPDWORD,DWORD,DWORD); @@ -995,39 +997,48 @@ static void test_UrlIs(void) size_t i; WCHAR wurl[80]; + if (!pUrlIsA) { + win_skip("UrlIsA not found\n"); + return; + } + for(i = 0; i < sizeof(TEST_PATH_IS_URL) / sizeof(TEST_PATH_IS_URL[0]); i++) { MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl, 80); - ret = UrlIsA( TEST_PATH_IS_URL[i].path, URLIS_URL ); + ret = pUrlIsA( 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 ); - ret = UrlIsW( wurl, URLIS_URL ); - ok( ret == TEST_PATH_IS_URL[i].expect, - "returned %d from path (UrlIsW) %s, expected %d\n", ret, TEST_PATH_IS_URL[i].path, - TEST_PATH_IS_URL[i].expect ); + if (pUrlIsW) { + ret = pUrlIsW( wurl, URLIS_URL ); + ok( ret == TEST_PATH_IS_URL[i].expect, + "returned %d from path (UrlIsW) %s, expected %d\n", ret, + TEST_PATH_IS_URL[i].path, TEST_PATH_IS_URL[i].expect ); + } } for(i = 0; i < sizeof(TEST_URLIS_ATTRIBS) / sizeof(TEST_URLIS_ATTRIBS[0]); i++) { MultiByteToWideChar(CP_ACP, 0, TEST_URLIS_ATTRIBS[i].url, -1, wurl, 80); - ret = UrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_OPAQUE); + ret = pUrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_OPAQUE); ok( ret == TEST_URLIS_ATTRIBS[i].expectOpaque, "returned %d for URLIS_OPAQUE, url \"%s\", expected %d\n", ret, TEST_URLIS_ATTRIBS[i].url, TEST_URLIS_ATTRIBS[i].expectOpaque ); - ret = UrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_FILEURL); + ret = pUrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_FILEURL); ok( ret == TEST_URLIS_ATTRIBS[i].expectFile, "returned %d for URLIS_FILEURL, url \"%s\", expected %d\n", ret, TEST_URLIS_ATTRIBS[i].url, TEST_URLIS_ATTRIBS[i].expectFile ); - ret = UrlIsW( wurl, URLIS_OPAQUE); - ok( ret == TEST_URLIS_ATTRIBS[i].expectOpaque, - "returned %d for URLIS_OPAQUE (UrlIsW), url \"%s\", expected %d\n", ret, TEST_URLIS_ATTRIBS[i].url, - TEST_URLIS_ATTRIBS[i].expectOpaque ); - ret = UrlIsW( wurl, URLIS_FILEURL); - ok( ret == TEST_URLIS_ATTRIBS[i].expectFile, - "returned %d for URLIS_FILEURL (UrlIsW), url \"%s\", expected %d\n", ret, TEST_URLIS_ATTRIBS[i].url, - TEST_URLIS_ATTRIBS[i].expectFile ); + if (pUrlIsW) { + ret = pUrlIsW( wurl, URLIS_OPAQUE); + ok( ret == TEST_URLIS_ATTRIBS[i].expectOpaque, + "returned %d for URLIS_OPAQUE (UrlIsW), url \"%s\", expected %d\n", + ret, TEST_URLIS_ATTRIBS[i].url, TEST_URLIS_ATTRIBS[i].expectOpaque ); + ret = pUrlIsW( wurl, URLIS_FILEURL); + ok( ret == TEST_URLIS_ATTRIBS[i].expectFile, + "returned %d for URLIS_FILEURL (UrlIsW), url \"%s\", expected %d\n", + ret, TEST_URLIS_ATTRIBS[i].url, TEST_URLIS_ATTRIBS[i].expectFile ); + } } } @@ -1255,6 +1266,8 @@ START_TEST(url) { hShlwapi = GetModuleHandleA("shlwapi.dll"); + pUrlIsA = (void *) GetProcAddress(hShlwapi, "UrlIsA"); + pUrlIsW = (void *) GetProcAddress(hShlwapi, "UrlIsW"); pUrlHashA = (void *) GetProcAddress(hShlwapi, "UrlHashA"); pUrlHashW = (void *) GetProcAddress(hShlwapi, "UrlHashW"); pUrlGetPartA = (void *) GetProcAddress(hShlwapi, "UrlGetPartA");