shlwapi/tests: Test NULL UrlCanonicalizeA/W() parameters.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3cbd9cda19
commit
c169263b0b
|
@ -1052,6 +1052,22 @@ static void test_UrlCanonicalizeA(void)
|
|||
|
||||
urllen = lstrlenA(winehqA);
|
||||
|
||||
/* Parameter checks */
|
||||
dwSize = ARRAY_SIZE(szReturnUrl);
|
||||
hr = pUrlCanonicalizeA(NULL, szReturnUrl, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
dwSize = ARRAY_SIZE(szReturnUrl);
|
||||
hr = pUrlCanonicalizeA(winehqA, NULL, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = pUrlCanonicalizeA(winehqA, szReturnUrl, NULL, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
dwSize = 0;
|
||||
hr = pUrlCanonicalizeA(winehqA, szReturnUrl, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* buffer has no space for the result */
|
||||
dwSize=urllen-1;
|
||||
memset(szReturnUrl, '#', urllen+4);
|
||||
|
@ -1137,6 +1153,22 @@ static void test_UrlCanonicalizeW(void)
|
|||
}
|
||||
urllen = lstrlenW(winehqW);
|
||||
|
||||
/* Parameter checks */
|
||||
dwSize = ARRAY_SIZE(szReturnUrl);
|
||||
hr = pUrlCanonicalizeW(NULL, szReturnUrl, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
dwSize = ARRAY_SIZE(szReturnUrl);
|
||||
hr = pUrlCanonicalizeW(winehqW, NULL, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = pUrlCanonicalizeW(winehqW, szReturnUrl, NULL, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
dwSize = 0;
|
||||
hr = pUrlCanonicalizeW(winehqW, szReturnUrl, &dwSize, URL_UNESCAPE);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
/* buffer has no space for the result */
|
||||
dwSize = (urllen-1);
|
||||
memset(szReturnUrl, '#', (urllen+4) * sizeof(WCHAR));
|
||||
|
|
Loading…
Reference in New Issue