From 024725515ecd3d55fd546649b55eed09e5371d87 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Thu, 2 Jul 2009 10:13:51 +0200 Subject: [PATCH] urlmon/tests: Don't check for out of memory (Coverity). --- dlls/urlmon/tests/misc.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c index 6436cd725ce..674092a3c8a 100644 --- a/dlls/urlmon/tests/misc.c +++ b/dlls/urlmon/tests/misc.c @@ -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); + 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 = 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);