Commit 02472551 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

urlmon/tests: Don't check for out of memory (Coverity).

parent eddc78e4
......@@ -1191,26 +1191,19 @@ static void test_user_agent(void)
ok(size > 0, "size=%d, expected non-zero\n", size);
str2 = HeapAlloc(GetProcessHeap(), 0, (size+20)*sizeof(CHAR));
if (!str2)
{
skip("skipping rest of ObtainUserAgent tests, out of memory\n");
}
else
{
saved = size;
hres = ObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == saved, "size=%d, expected %d\n", size, saved);
ok(strlen(expected) <= strlen(str2) &&
!memcmp(expected, str2, strlen(expected)*sizeof(CHAR)),
"user agent was \"%s\", expected to start with \"%s\"\n",
str2, expected);
size = saved+10;
hres = ObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == saved, "size=%d, expected %d\n", size, saved);
}
saved = size;
hres = ObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == saved, "size=%d, expected %d\n", size, saved);
ok(strlen(expected) <= strlen(str2) &&
!memcmp(expected, str2, strlen(expected)*sizeof(CHAR)),
"user agent was \"%s\", expected to start with \"%s\"\n",
str2, expected);
size = saved+10;
hres = ObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == saved, "size=%d, expected %d\n", size, saved);
size = 0;
hres = UrlMkGetSessionOption(URLMON_OPTION_USERAGENT, NULL, 0, &size, 0);
......
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