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

This commit is contained in:
Thomas Mullaly 2010-09-17 17:17:11 -04:00 committed by Alexandre Julliard
parent 6704cd804f
commit 2e1f854860
1 changed files with 62 additions and 0 deletions

View File

@ -7932,6 +7932,37 @@ static void test_IUriBuilder_IUriProperty(void) {
} }
if(test) IUri_Release(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_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; test = NULL;
hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test); hr = IUriBuilder_CreateUriSimple(builder, 0, 0, &test);
todo_wine { 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); ok(test == uri, "Error: Expected test to be %p, but was %p instead.\n", uri, test);
} }
if(test) IUri_Release(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); if(uri) IUri_Release(uri);
} }