From f0bc60324aae58bad51007f2725286545790f9da Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Sun, 5 Sep 2010 22:13:47 +0200 Subject: [PATCH] shlwapi: Improved UrlEscapeW implementation. --- dlls/shlwapi/tests/url.c | 11 +++++++++++ dlls/shlwapi/url.c | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 532b947eb8f..d1da88b27e9 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -762,10 +762,13 @@ static void test_url_canonicalize(int index, const char *szUrl, DWORD dwFlags, H static void test_UrlEscape(void) { + static const WCHAR out[] = { 'f','o','o','%','2','0','b','a','r',0 }; + DWORD size = 0; HRESULT ret; unsigned int i; char empty_string[] = ""; + WCHAR overwrite[] = { 'f','o','o',' ','b','a','r',0,0,0 }; if (!pUrlEscapeA) { win_skip("UrlEscapeA noz found\n"); @@ -796,6 +799,14 @@ static void test_UrlEscape(void) ok(ret == E_POINTER, "got %x, expected %x\n", ret, E_POINTER); ok(size == 34, "got %d, expected %d\n", size, 34); + if(pUrlEscapeW) { + size = sizeof(overwrite)/sizeof(WCHAR); + ret = pUrlEscapeW(overwrite, overwrite, &size, URL_ESCAPE_SPACES_ONLY); + ok(ret == S_OK, "got %x, expected S_OK\n", ret); + ok(size == 9, "got %d, expected 9\n", size); + ok(!lstrcmpW(overwrite, out), "got %s, expected %s\n", wine_dbgstr_w(overwrite), wine_dbgstr_w(out)); + } + for(i=0; i