Thomas Mullaly : urlmon/tests: Added more tests for IUriBuilder' s CreateUri functions.

Alexandre Julliard julliard at winehq.org
Mon Sep 20 12:12:19 CDT 2010


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

Author: Thomas Mullaly <thomas.mullaly at gmail.com>
Date:   Fri Sep 17 17:17:11 2010 -0400

urlmon/tests: Added more tests for IUriBuilder's CreateUri functions.

---

 dlls/urlmon/tests/uri.c |   62 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c
index e39c410..442c38c 100644
--- a/dlls/urlmon/tests/uri.c
+++ b/dlls/urlmon/tests/uri.c
@@ -7932,6 +7932,37 @@ static void test_IUriBuilder_IUriProperty(void) {
             }
             if(test) IUri_Release(test);
 
+            /* Doesn't return the same IUri, if the flag combination is different then the one that created
+             * the base IUri.
+             */
+            test = NULL;
+            hr = IUriBuilder_CreateUri(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, &test);
+            todo_wine {
+                ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
+            }
+            if(SUCCEEDED(hr)) {
+                todo_wine {
+                    ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
+                }
+            }
+            if(test) IUri_Release(test);
+
+            /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
+             * explicitly set (because it's a default flags).
+             */
+            test = NULL;
+            hr = IUriBuilder_CreateUri(builder, Uri_CREATE_CANONICALIZE, 0, 0, &test);
+            todo_wine {
+                ok(hr == S_OK, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
+            }
+            if(SUCCEEDED(hr)) {
+                cur_count = get_refcnt(uri);
+                ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
+                    orig_count+1, cur_count);
+                ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
+            }
+            if(test) IUri_Release(test);
+
             test = NULL;
             hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test);
             todo_wine {
@@ -7958,6 +7989,37 @@ static void test_IUriBuilder_IUriProperty(void) {
                 ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
             }
             if(test) IUri_Release(test);
+
+            /* Doesn't return the same IUri, if the flag combination is different then the one that created
+             * the base IUri.
+             */
+            test = NULL;
+            hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_ALLOW_RELATIVE, 0, 0, 0, &test);
+            todo_wine {
+                ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
+            }
+            if(SUCCEEDED(hr)) {
+                todo_wine {
+                    ok(test != uri, "Error: Wasn't expecting 'test' to be 'uri'\n");
+                }
+            }
+            if(test) IUri_Release(test);
+
+            /* Still returns the same IUri, even though the base one wasn't created with CREATE_CANONICALIZE
+             * explicitly set (because it's a default flags).
+             */
+            test = NULL;
+            hr = IUriBuilder_CreateUriWithFlags(builder, Uri_CREATE_CANONICALIZE, 0, 0, 0, &test);
+            todo_wine {
+                ok(hr == S_OK, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
+            }
+            if(SUCCEEDED(hr)) {
+                cur_count = get_refcnt(uri);
+                ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
+                    orig_count+1, cur_count);
+                ok(test == uri, "Error: Expected 'test' to be %p, but was %p instead.\n", uri, test);
+            }
+            if(test) IUri_Release(test);
         }
         if(uri) IUri_Release(uri);
     }




More information about the wine-cvs mailing list