[PATCH 10/11] urlmon/tests: ObtainUserAgentString not pesent on W95B
Detlef Riekenberg
wine.dev at web.de
Thu Apr 15 22:27:35 CDT 2010
---
dlls/urlmon/tests/misc.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index 1313317..5415d56 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -71,6 +71,7 @@ static HRESULT (WINAPI *pCoInternetQueryInfo)(LPCWSTR, QUERYOPTION, DWORD, LPVOI
static HRESULT (WINAPI *pCopyStgMedium)(const STGMEDIUM *, STGMEDIUM *);
static HRESULT (WINAPI *pFindMimeFromData)(LPBC, LPCWSTR, LPVOID, DWORD, LPCWSTR,
DWORD, LPWSTR*, DWORD);
+static HRESULT (WINAPI *pObtainUserAgentString)(DWORD, LPSTR, DWORD*);
static void test_CreateFormatEnum(void)
{
@@ -1276,34 +1277,39 @@ static void test_user_agent(void)
HRESULT hres;
DWORD size, saved;
- hres = ObtainUserAgentString(0, NULL, NULL);
+ if (!pObtainUserAgentString) {
+ win_skip("ObtainUserAgentString not found\n");
+ return;
+ }
+
+ hres = pObtainUserAgentString(0, NULL, NULL);
ok(hres == E_INVALIDARG, "ObtainUserAgentString failed: %08x\n", hres);
size = 100;
- hres = ObtainUserAgentString(0, NULL, &size);
+ hres = pObtainUserAgentString(0, NULL, &size);
ok(hres == E_INVALIDARG, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == 100, "size=%d, expected %d\n", size, 100);
size = 0;
- hres = ObtainUserAgentString(0, str, &size);
+ hres = pObtainUserAgentString(0, str, &size);
ok(hres == E_OUTOFMEMORY, "ObtainUserAgentString failed: %08x\n", hres);
ok(size > 0, "size=%d, expected non-zero\n", size);
size = 2;
str[0] = 'a';
- hres = ObtainUserAgentString(0, str, &size);
+ hres = pObtainUserAgentString(0, str, &size);
ok(hres == E_OUTOFMEMORY, "ObtainUserAgentString failed: %08x\n", hres);
ok(size > 0, "size=%d, expected non-zero\n", size);
ok(str[0] == 'a', "str[0]=%c, expected 'a'\n", str[0]);
size = 0;
- hres = ObtainUserAgentString(1, str, &size);
+ hres = pObtainUserAgentString(1, str, &size);
ok(hres == E_OUTOFMEMORY, "ObtainUserAgentString failed: %08x\n", hres);
ok(size > 0, "size=%d, expected non-zero\n", size);
str2 = HeapAlloc(GetProcessHeap(), 0, (size+20)*sizeof(CHAR));
saved = size;
- hres = ObtainUserAgentString(0, str2, &size);
+ hres = pObtainUserAgentString(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) &&
@@ -1312,7 +1318,7 @@ static void test_user_agent(void)
str2, expected);
size = saved+10;
- hres = ObtainUserAgentString(0, str2, &size);
+ hres = pObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08x\n", hres);
ok(size == saved, "size=%d, expected %d\n", size, saved);
@@ -1466,6 +1472,7 @@ START_TEST(misc)
pCoInternetQueryInfo = (void*) GetProcAddress(hurlmon, "CoInternetQueryInfo");
pCopyStgMedium = (void*) GetProcAddress(hurlmon, "CopyStgMedium");
pFindMimeFromData = (void*) GetProcAddress(hurlmon, "FindMimeFromData");
+ pObtainUserAgentString = (void*) GetProcAddress(hurlmon, "ObtainUserAgentString");
register_protocols();
--
1.7.0.4
More information about the wine-patches
mailing list