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