Commit 3b383e21 authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon/tests: Added tests for IUriBuilder's IUri property.

parent 47e93adc
......@@ -6409,6 +6409,49 @@ static void test_IUriBuilder_HasBeenModified(void) {
if(builder) IUriBuilder_Release(builder);
}
/* Test IUriBuilder {Get,Set}IUri functions. */
static void test_IUriBuilder_IUriProperty(void) {
IUriBuilder *builder = NULL;
HRESULT hr;
hr = pCreateIUriBuilder(NULL, 0, 0, &builder);
ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK);
if(SUCCEEDED(hr)) {
IUri *uri = NULL;
hr = IUriBuilder_GetIUri(builder, NULL);
ok(hr == E_POINTER, "Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_POINTER);
hr = pCreateUri(http_urlW, 0, 0, &uri);
if(SUCCEEDED(hr)) {
ULONG cur_count, orig_count;
/* IUriBuilder doesn't clone the IUri, it use the same IUri. */
orig_count = get_refcnt(uri);
hr = IUriBuilder_SetIUri(builder, uri);
cur_count = get_refcnt(uri);
if(SUCCEEDED(hr)) {
todo_wine {
ok(cur_count == orig_count+1, "Error: Expected uri ref count to be %d, but was %d instead.\n",
orig_count+1, cur_count);
}
}
hr = IUriBuilder_SetIUri(builder, NULL);
cur_count = get_refcnt(uri);
if(SUCCEEDED(hr)) {
todo_wine {
ok(cur_count == orig_count, "Error: Expected uri ref count to be %d, but was %d instead.\n",
orig_count, cur_count);
}
}
}
if(uri) IUri_Release(uri);
}
if(builder) IUriBuilder_Release(builder);
}
START_TEST(uri) {
HMODULE hurlmon;
......@@ -6478,4 +6521,7 @@ START_TEST(uri) {
trace("test IUriBuilder_HasBeenModified...\n");
test_IUriBuilder_HasBeenModified();
trace("test IUriBuilder_IUriProperty...\n");
test_IUriBuilder_IUriProperty();
}
......@@ -4181,6 +4181,11 @@ static HRESULT WINAPI UriBuilder_CreateUriWithFlags(IUriBuilder *iface,
static HRESULT WINAPI UriBuilder_GetIUri(IUriBuilder *iface, IUri **ppIUri)
{
UriBuilder *This = URIBUILDER_THIS(iface);
TRACE("(%p)->(%p)\n", This, ppIUri);
if(!ppIUri)
return E_POINTER;
FIXME("(%p)->(%p)\n", This, ppIUri);
return E_NOTIMPL;
}
......
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