From d5e0a2edca9f86b6e10e830cb79b11725efebc0d Mon Sep 17 00:00:00 2001 From: Thomas Mullaly Date: Tue, 1 Jun 2010 20:32:09 -0400 Subject: [PATCH] urlmon/tests: Added tests for IUri_GetHost. --- dlls/urlmon/tests/uri.c | 24 ++++++++++++++++++++++++ dlls/urlmon/uri.c | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 2351174dd8..6a3f30630f 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -710,6 +710,9 @@ static void test_IUri_GetStrProperties(void) { hr = IUri_GetFragment(uri, NULL); ok(hr == E_POINTER, "Error: GetFragment returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER); + hr = IUri_GetHost(uri, NULL); + ok(hr == E_POINTER, "Error: GetHost returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER); + hr = IUri_GetPassword(uri, NULL); ok(hr == E_POINTER, "Error: GetPassword returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER); @@ -883,6 +886,27 @@ static void test_IUri_GetStrProperties(void) { SysFreeString(received); received = NULL; + /* GetHost() tests. */ + prop = test.str_props[Uri_PROPERTY_HOST]; + hr = IUri_GetHost(uri, &received); + if(prop.todo) { + todo_wine { + ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n", + hr, prop.expected, i); + } + todo_wine { + ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n", + prop.value, wine_dbgstr_w(received), i); + } + } else { + ok(hr == prop.expected, "Error: GetHost returned 0x%08x, expected 0x%08x on uri_tests[%d].\n", + hr, prop.expected, i); + ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n", + prop.value, wine_dbgstr_w(received), i); + } + SysFreeString(received); + received = NULL; + /* GetPassword() tests. */ prop = test.str_props[Uri_PROPERTY_PASSWORD]; hr = IUri_GetPassword(uri, &received); diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index b0adb35d52..df5ca8b197 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -224,6 +224,10 @@ static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost) { Uri *This = URI_THIS(iface); FIXME("(%p)->(%p)\n", This, pstrHost); + + if(!pstrHost) + return E_POINTER; + return E_NOTIMPL; } -- 2.32.0.93.g670b81a890