Commit 4f4a47a1 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

shlwapi/tests: UrlHash* is not present on Win95B (winetestbot).

parent fb81d89a
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
/* ################ */ /* ################ */
static HMODULE hShlwapi; static HMODULE hShlwapi;
static HRESULT (WINAPI *pUrlHashA)(LPCSTR,LPBYTE,DWORD);
static HRESULT (WINAPI *pUrlHashW)(LPCWSTR,LPBYTE,DWORD);
static HRESULT (WINAPI *pUrlGetPartA)(LPCSTR,LPSTR,LPDWORD,DWORD,DWORD); static HRESULT (WINAPI *pUrlGetPartA)(LPCSTR,LPSTR,LPDWORD,DWORD,DWORD);
static HRESULT (WINAPI *pUrlGetPartW)(LPCWSTR,LPWSTR,LPDWORD,DWORD,DWORD); static HRESULT (WINAPI *pUrlGetPartW)(LPCWSTR,LPWSTR,LPDWORD,DWORD,DWORD);
static HRESULT (WINAPI *pUrlEscapeA)(LPCSTR,LPSTR,LPDWORD,DWORD); static HRESULT (WINAPI *pUrlEscapeA)(LPCSTR,LPSTR,LPDWORD,DWORD);
...@@ -492,19 +494,29 @@ static void hash_url(const char* szUrl) ...@@ -492,19 +494,29 @@ static void hash_url(const char* szUrl)
{ {
LPCSTR szTestUrl = szUrl; LPCSTR szTestUrl = szUrl;
LPWSTR wszTestUrl = GetWideString(szTestUrl); LPWSTR wszTestUrl = GetWideString(szTestUrl);
HRESULT res;
DWORD cbSize = sizeof(DWORD); DWORD cbSize = sizeof(DWORD);
DWORD dwHash1, dwHash2; DWORD dwHash1, dwHash2;
ok(UrlHashA(szTestUrl, (LPBYTE)&dwHash1, cbSize) == S_OK, "UrlHashA didn't return S_OK\n"); res = pUrlHashA(szTestUrl, (LPBYTE)&dwHash1, cbSize);
ok(UrlHashW(wszTestUrl, (LPBYTE)&dwHash2, cbSize) == S_OK, "UrlHashW didn't return S_OK\n"); ok(res == S_OK, "UrlHashA returned 0x%x (expected S_OK) for %s\n", res, szUrl);
if (pUrlHashW) {
res = pUrlHashW(wszTestUrl, (LPBYTE)&dwHash2, cbSize);
ok(res == S_OK, "UrlHashW returned 0x%x (expected S_OK) for %s\n", res, szUrl);
ok(dwHash1 == dwHash2,
"Hashes didn't match (A: 0x%x, W: 0x%x) for %s\n", dwHash1, dwHash2, szUrl);
}
FreeWideString(wszTestUrl); FreeWideString(wszTestUrl);
ok(dwHash1 == dwHash2, "Hashes didn't compare\n");
} }
static void test_UrlHash(void) static void test_UrlHash(void)
{ {
if (!pUrlHashA) {
win_skip("UrlHashA not found\n");
return;
}
hash_url(TEST_URL_1); hash_url(TEST_URL_1);
hash_url(TEST_URL_2); hash_url(TEST_URL_2);
hash_url(TEST_URL_3); hash_url(TEST_URL_3);
...@@ -1243,6 +1255,8 @@ START_TEST(url) ...@@ -1243,6 +1255,8 @@ START_TEST(url)
{ {
hShlwapi = GetModuleHandleA("shlwapi.dll"); hShlwapi = GetModuleHandleA("shlwapi.dll");
pUrlHashA = (void *) GetProcAddress(hShlwapi, "UrlHashA");
pUrlHashW = (void *) GetProcAddress(hShlwapi, "UrlHashW");
pUrlGetPartA = (void *) GetProcAddress(hShlwapi, "UrlGetPartA"); pUrlGetPartA = (void *) GetProcAddress(hShlwapi, "UrlGetPartA");
pUrlGetPartW = (void *) GetProcAddress(hShlwapi, "UrlGetPartW"); pUrlGetPartW = (void *) GetProcAddress(hShlwapi, "UrlGetPartW");
pUrlEscapeA = (void *) GetProcAddress(hShlwapi, "UrlEscapeA"); pUrlEscapeA = (void *) GetProcAddress(hShlwapi, "UrlEscapeA");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment