Commit 3395c562 authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon/tests: IUriBuilder_CreateUri functions will return the base IUri if no…

urlmon/tests: IUriBuilder_CreateUri functions will return the base IUri if no changes have been made.
parent 0da2e4c3
...@@ -7897,6 +7897,7 @@ static void test_IUriBuilder_IUriProperty(void) { ...@@ -7897,6 +7897,7 @@ static void test_IUriBuilder_IUriProperty(void) {
hr = pCreateUri(http_urlW, 0, 0, &uri); hr = pCreateUri(http_urlW, 0, 0, &uri);
if(SUCCEEDED(hr)) { if(SUCCEEDED(hr)) {
IUri *test = NULL;
ULONG cur_count, orig_count; ULONG cur_count, orig_count;
/* IUriBuilder doesn't clone the IUri, it use the same IUri. */ /* IUriBuilder doesn't clone the IUri, it use the same IUri. */
...@@ -7912,6 +7913,51 @@ static void test_IUriBuilder_IUriProperty(void) { ...@@ -7912,6 +7913,51 @@ static void test_IUriBuilder_IUriProperty(void) {
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
ok(cur_count == orig_count, "Error: Expected uri ref count to be %d, but was %d instead.\n", ok(cur_count == orig_count, "Error: Expected uri ref count to be %d, but was %d instead.\n",
orig_count, cur_count); orig_count, cur_count);
/* CreateUri* functions will return back the same IUri if nothing has changed. */
hr = IUriBuilder_SetIUri(builder, uri);
ok(hr == S_OK, "Error: IUriBuilder_SetIUri returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
orig_count = get_refcnt(uri);
hr = IUriBuilder_CreateUri(builder, 0, 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 {
ok(hr == S_OK, "Error: IUriBuilder_CreateUriSimple 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_CreateUriWithFlags(builder, 0, 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); if(uri) IUri_Release(uri);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment