Commit 238a462d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Added test of cookies with long URL.

parent 8264e2de
......@@ -614,6 +614,7 @@ static void test_cookie_attrs(void)
static void test_cookie_url(void)
{
char long_url[5000] = "http://long.url.test.com/", *p;
WCHAR bufw[512];
char buf[512];
DWORD len;
......@@ -640,6 +641,23 @@ static void test_cookie_url(void)
res = pInternetGetCookieExW(about_blankW, NULL, bufw, &len, 0, NULL);
ok(!res && GetLastError() == ERROR_INVALID_PARAMETER,
"InternetGetCookeExW failed: %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
p = long_url + strlen(long_url);
memset(p, 'x', long_url+sizeof(long_url)-p);
p += (long_url+sizeof(long_url)-p) - 3;
p[0] = '/';
p[2] = 0;
res = InternetSetCookieA(long_url, NULL, "A=B");
ok(res, "InternetSetCookieA failed: %u\n", GetLastError());
len = sizeof(buf);
res = InternetGetCookieA(long_url, NULL, buf, &len);
ok(res, "InternetGetCookieA failed: %u\n", GetLastError());
ok(!strcmp(buf, "A=B"), "buf = %s\n", buf);
len = sizeof(buf);
res = InternetGetCookieA("http://long.url.test.com/", NULL, buf, &len);
ok(!res && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieA failed: %u\n", GetLastError());
}
static void test_null(void)
......
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