Thomas Mullaly : urlmon/tests: Added tests for IUri_GetHost.

Alexandre Julliard julliard at winehq.org
Mon Jun 7 10:02:29 CDT 2010


Module: wine
Branch: master
Commit: d5e0a2edca9f86b6e10e830cb79b11725efebc0d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d5e0a2edca9f86b6e10e830cb79b11725efebc0d

Author: Thomas Mullaly <thomas.mullaly at gmail.com>
Date:   Tue Jun  1 20:32:09 2010 -0400

urlmon/tests: Added tests for IUri_GetHost.

---

 dlls/urlmon/tests/uri.c |   24 ++++++++++++++++++++++++
 dlls/urlmon/uri.c       |    4 ++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c
index 2351174..6a3f306 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 b0adb35..df5ca8b 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;
 }
 




More information about the wine-cvs mailing list