Commit c169263b authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

shlwapi/tests: Test NULL UrlCanonicalizeA/W() parameters.

parent 3cbd9cda
......@@ -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));
......
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