Module: wine Branch: master Commit: d56e62a1cf56c3df7afc17a8ca3d6a454d78c482 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d56e62a1cf56c3df7afc17a8ca...
Author: Thomas Mullaly thomas.mullaly@gmail.com Date: Wed Sep 8 17:24:19 2010 -0400
urlmon/tests: IUriBuilder's can create IUri's even if they don't have a base IUri.
---
dlls/urlmon/tests/uri.c | 51 +++++++++++++++++++++++++++++++--------------- dlls/urlmon/uri.c | 23 ++------------------ 2 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 6723a47..2c18c87 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4888,6 +4888,40 @@ static const uri_builder_test uri_builder_tests[] = { {URL_SCHEME_HTTP,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + /* IUriBuilder doesn't need a base IUri to build a IUri. */ + { NULL,0,S_OK,FALSE, + { + {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}, + {TRUE,"google.com",NULL,Uri_PROPERTY_HOST,S_OK,FALSE} + }, + {FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"http://google.com/%22,S_OK%7D, + {"google.com",S_OK}, + {"http://google.com/%22,S_OK%7D, + {"google.com",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"google.com",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"http://google.com/%22,S_OK%7D, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + {80,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } };
@@ -6500,10 +6534,6 @@ static void test_IUriBuilder_CreateInvalidArgs(void) { IUri *test = NULL, *uri = (void*) 0xdeadbeef;
/* Test what happens if the IUriBuilder doesn't have a IUri set. */ - hr = IUriBuilder_CreateUri(builder, 0, 0, 0, &uri); - ok(hr == INET_E_INVALID_URL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, INET_E_INVALID_URL); - ok(uri == NULL, "Error: Expected uri to be NULL, but was %p instead.\n", uri); - hr = IUriBuilder_CreateUri(builder, 0, 0, 0, NULL); ok(hr == E_POINTER, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER);
@@ -6512,12 +6542,6 @@ static void test_IUriBuilder_CreateInvalidArgs(void) { ok(hr == E_NOTIMPL, "Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.\n", hr, E_NOTIMPL); ok(uri == NULL, "Error: expected uri to be NULL, but was %p instead.\n", uri);
- uri = (void*) 0xdeadbeef; - hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &uri); - ok(hr == INET_E_INVALID_URL, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", - hr, INET_E_INVALID_URL); - ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri); - hr = IUriBuilder_CreateUriSimple(builder, 0, 0, NULL); ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER); @@ -6528,13 +6552,6 @@ static void test_IUriBuilder_CreateInvalidArgs(void) { hr, E_NOTIMPL); ok(!uri, "Error: Expected uri to NULL, but was %p instead.\n", uri);
- uri = (void*) 0xdeadbeef; - hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, &uri); - ok(hr == INET_E_INVALID_URL, - "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", - hr, INET_E_INVALID_URL); - ok(!uri, "Error: Expected uri to be NULL, but was %p instead.\n", uri); - hr = IUriBuilder_CreateUriWithFlags(builder, 0, 0, 0, 0, NULL); ok(hr == E_POINTER, "Error: IUriBuilder_CreateUriWithFlags returned 0x%08x, expected 0x%08x.\n", hr, E_POINTER); diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 50944bd..2d8a22f 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -4404,16 +4404,11 @@ static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface, return E_POINTER;
/* Acts the same way as CreateUri. */ - if(dwAllowEncodingPropertyMask && !This->uri) { + if(dwAllowEncodingPropertyMask && (!This->uri || This->modified_props)) { *ppIUri = NULL; return E_NOTIMPL; }
- if(!This->uri) { - *ppIUri = NULL; - return INET_E_INVALID_URL; - } - FIXME("(%p)->(%d %d %p)\n", This, dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri); return E_NOTIMPL; } @@ -4433,19 +4428,12 @@ static HRESULT WINAPI UriBuilder_CreateUri(IUriBuilder *iface, /* The only time it doesn't return E_NOTIMPL when the dwAllow parameter * has flags set, is when the IUriBuilder has a IUri set and it hasn't * been modified (a call to a "Set*" hasn't been performed). - * - * TODO: Check if the IUriBuilder's properties have been modified. */ - if(dwAllowEncodingPropertyMask && !This->uri) { + if(dwAllowEncodingPropertyMask && (!This->uri || This->modified_props)) { *ppIUri = NULL; return E_NOTIMPL; }
- if(!This->uri) { - *ppIUri = NULL; - return INET_E_INVALID_URL; - } - FIXME("(%p)->(0x%08x %d %d %p)\n", This, dwCreateFlags, dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri); return E_NOTIMPL; } @@ -4465,16 +4453,11 @@ static HRESULT WINAPI UriBuilder_CreateUriWithFlags(IUriBuilder *iface, return E_POINTER;
/* Same as CreateUri. */ - if(dwAllowEncodingPropertyMask && !This->uri) { + if(dwAllowEncodingPropertyMask && (!This->uri || This->modified_props)) { *ppIUri = NULL; return E_NOTIMPL; }
- if(!This->uri) { - *ppIUri = NULL; - return INET_E_INVALID_URL; - } - FIXME("(%p)->(0x%08x 0x%08x %d %d %p)\n", This, dwCreateFlags, dwUriBuilderFlags, dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri); return E_NOTIMPL;