Commit e49241f9 authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: Implemented IUri_GetAuthority.

parent 9ef60297
...@@ -95,7 +95,7 @@ static const uri_properties uri_tests[] = { ...@@ -95,7 +95,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://www.winehq.org/",S_OK,TRUE}, /* ABSOLUTE_URI */ {"http://www.winehq.org/",S_OK,TRUE}, /* ABSOLUTE_URI */
{"www.winehq.org",S_OK,TRUE}, /* AUTHORITY */ {"www.winehq.org",S_OK,FALSE}, /* AUTHORITY */
{"http://www.winehq.org/",S_OK,TRUE}, /* DISPLAY_URI */ {"http://www.winehq.org/",S_OK,TRUE}, /* DISPLAY_URI */
{"winehq.org",S_OK,TRUE}, /* DOMAIN */ {"winehq.org",S_OK,TRUE}, /* DOMAIN */
{"",S_FALSE,TRUE}, /* EXTENSION */ {"",S_FALSE,TRUE}, /* EXTENSION */
...@@ -124,7 +124,7 @@ static const uri_properties uri_tests[] = { ...@@ -124,7 +124,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://winehq.org/tests",S_OK,TRUE}, {"http://winehq.org/tests",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,FALSE},
{"http://winehq.org/tests",S_OK,TRUE}, {"http://winehq.org/tests",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -153,7 +153,7 @@ static const uri_properties uri_tests[] = { ...@@ -153,7 +153,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://www.winehq.org/?query=x&return=y",S_OK,TRUE}, {"http://www.winehq.org/?query=x&return=y",S_OK,TRUE},
{"www.winehq.org",S_OK,TRUE}, {"www.winehq.org",S_OK,FALSE},
{"http://www.winehq.org/?query=x&return=y",S_OK,TRUE}, {"http://www.winehq.org/?query=x&return=y",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -182,7 +182,7 @@ static const uri_properties uri_tests[] = { ...@@ -182,7 +182,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,TRUE}, {"http://usEr%3Ainfo@example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,TRUE},
{"usEr%3Ainfo@example.com",S_OK,TRUE}, {"usEr%3Ainfo@example.com",S_OK,FALSE},
{"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,TRUE}, {"http://example.com/path/a/Forbidden'%3C%7C%3E%20Characters",S_OK,TRUE},
{"example.com",S_OK,TRUE}, {"example.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -212,7 +212,7 @@ static const uri_properties uri_tests[] = { ...@@ -212,7 +212,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,TRUE}, {"ftp://winepass:wine@ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,TRUE},
{"winepass:wine@ftp.winehq.org:9999",S_OK,TRUE}, {"winepass:wine@ftp.winehq.org:9999",S_OK,FALSE},
{"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,TRUE}, {"ftp://ftp.winehq.org:9999/dir/foo%20bar.txt",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{".txt",S_OK,TRUE}, {".txt",S_OK,TRUE},
...@@ -240,7 +240,7 @@ static const uri_properties uri_tests[] = { ...@@ -240,7 +240,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"file:///c:/tests/foo%2520bar.mp3",S_OK,TRUE}, {"file:///c:/tests/foo%2520bar.mp3",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"file:///c:/tests/foo%2520bar.mp3",S_OK,TRUE}, {"file:///c:/tests/foo%2520bar.mp3",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".mp3",S_OK,TRUE}, {".mp3",S_OK,TRUE},
...@@ -268,7 +268,7 @@ static const uri_properties uri_tests[] = { ...@@ -268,7 +268,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"file:///tests/test%20file.README.txt",S_OK,TRUE}, {"file:///tests/test%20file.README.txt",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"file:///tests/test%20file.README.txt",S_OK,TRUE}, {"file:///tests/test%20file.README.txt",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".txt",S_OK,TRUE}, {".txt",S_OK,TRUE},
...@@ -296,7 +296,7 @@ static const uri_properties uri_tests[] = { ...@@ -296,7 +296,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"urn:nothing:should:happen here",S_OK,TRUE}, {"urn:nothing:should:happen here",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"urn:nothing:should:happen here",S_OK,TRUE}, {"urn:nothing:should:happen here",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -325,7 +325,7 @@ static const uri_properties uri_tests[] = { ...@@ -325,7 +325,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://127.0.0.1/test%20dir/test.txt",S_OK,TRUE}, {"http://127.0.0.1/test%20dir/test.txt",S_OK,TRUE},
{"127.0.0.1",S_OK,TRUE}, {"127.0.0.1",S_OK,FALSE},
{"http://127.0.0.1/test%20dir/test.txt",S_OK,TRUE}, {"http://127.0.0.1/test%20dir/test.txt",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".txt",S_OK,TRUE}, {".txt",S_OK,TRUE},
...@@ -354,7 +354,7 @@ static const uri_properties uri_tests[] = { ...@@ -354,7 +354,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,TRUE}, {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,TRUE},
{"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,TRUE}, {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]",S_OK,FALSE},
{"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,TRUE}, {"http://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -383,7 +383,7 @@ static const uri_properties uri_tests[] = { ...@@ -383,7 +383,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://[::13.1.68.3]/",S_OK,TRUE}, {"ftp://[::13.1.68.3]/",S_OK,TRUE},
{"[::13.1.68.3]",S_OK,TRUE}, {"[::13.1.68.3]",S_OK,FALSE},
{"ftp://[::13.1.68.3]/",S_OK,TRUE}, {"ftp://[::13.1.68.3]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -412,7 +412,7 @@ static const uri_properties uri_tests[] = { ...@@ -412,7 +412,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[fedc:ba98::3210]/",S_OK,TRUE}, {"http://[fedc:ba98::3210]/",S_OK,TRUE},
{"[fedc:ba98::3210]",S_OK,TRUE}, {"[fedc:ba98::3210]",S_OK,FALSE},
{"http://[fedc:ba98::3210]/",S_OK,TRUE}, {"http://[fedc:ba98::3210]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -441,7 +441,7 @@ static const uri_properties uri_tests[] = { ...@@ -441,7 +441,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"1234://www.winehq.org/",S_OK,TRUE}, {"1234://www.winehq.org/",S_OK,TRUE},
{"www.winehq.org",S_OK,TRUE}, {"www.winehq.org",S_OK,FALSE},
{"1234://www.winehq.org/",S_OK,TRUE}, {"1234://www.winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -470,7 +470,7 @@ static const uri_properties uri_tests[] = { ...@@ -470,7 +470,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"file:///C:/test/test.mp3",S_OK,TRUE}, {"file:///C:/test/test.mp3",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"file:///C:/test/test.mp3",S_OK,TRUE}, {"file:///C:/test/test.mp3",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".mp3",S_OK,TRUE}, {".mp3",S_OK,TRUE},
...@@ -500,7 +500,7 @@ static const uri_properties uri_tests[] = { ...@@ -500,7 +500,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"file://server/test.mp3",S_OK,TRUE}, {"file://server/test.mp3",S_OK,TRUE},
{"server",S_OK,TRUE}, {"server",S_OK,FALSE},
{"file://server/test.mp3",S_OK,TRUE}, {"file://server/test.mp3",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".mp3",S_OK,TRUE}, {".mp3",S_OK,TRUE},
...@@ -529,7 +529,7 @@ static const uri_properties uri_tests[] = { ...@@ -529,7 +529,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"*:www.winehq.org/test",S_OK,TRUE}, {"*:www.winehq.org/test",S_OK,TRUE},
{"www.winehq.org",S_OK,TRUE}, {"www.winehq.org",S_OK,FALSE},
{"*:www.winehq.org/test",S_OK,TRUE}, {"*:www.winehq.org/test",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -559,7 +559,7 @@ static const uri_properties uri_tests[] = { ...@@ -559,7 +559,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"*:www.winehq.org/test",S_OK,TRUE}, {"*:www.winehq.org/test",S_OK,TRUE},
{"www.winehq.org",S_OK,TRUE}, {"www.winehq.org",S_OK,FALSE},
{"*:www.winehq.org/test",S_OK,TRUE}, {"*:www.winehq.org/test",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -587,7 +587,7 @@ static const uri_properties uri_tests[] = { ...@@ -587,7 +587,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"/../some dir/test.ext",S_OK,TRUE}, {"/../some dir/test.ext",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"/../some dir/test.ext",S_OK,TRUE}, {"/../some dir/test.ext",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".ext",S_OK,TRUE}, {".ext",S_OK,TRUE},
...@@ -615,7 +615,7 @@ static const uri_properties uri_tests[] = { ...@@ -615,7 +615,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"*://implicit/wildcard/uri%20scheme",S_OK,TRUE}, {"*://implicit/wildcard/uri%20scheme",S_OK,TRUE},
{"",S_OK,TRUE}, {"",S_OK,FALSE},
{"*://implicit/wildcard/uri%20scheme",S_OK,TRUE}, {"*://implicit/wildcard/uri%20scheme",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -645,7 +645,7 @@ static const uri_properties uri_tests[] = { ...@@ -645,7 +645,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip:/.//google.com",S_OK,TRUE}, {"zip:/.//google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,FALSE},
{"zip:/.//google.com",S_OK,TRUE}, {"zip:/.//google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{".com",S_OK,TRUE}, {".com",S_OK,TRUE},
...@@ -676,7 +676,7 @@ static const uri_properties uri_tests[] = { ...@@ -676,7 +676,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://user:pass:word@winehq.org/",S_OK,TRUE}, {"ftp://user:pass:word@winehq.org/",S_OK,TRUE},
{"user:pass:word@winehq.org",S_OK,TRUE}, {"user:pass:word@winehq.org",S_OK,FALSE},
{"ftp://winehq.org/",S_OK,TRUE}, {"ftp://winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -707,7 +707,7 @@ static const uri_properties uri_tests[] = { ...@@ -707,7 +707,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://wINe:PASS@ftp.google.com/",S_OK,TRUE}, {"ftp://wINe:PASS@ftp.google.com/",S_OK,TRUE},
{"wINe:PASS@ftp.google.com",S_OK,TRUE}, {"wINe:PASS@ftp.google.com",S_OK,FALSE},
{"ftp://ftp.google.com/",S_OK,TRUE}, {"ftp://ftp.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -738,7 +738,7 @@ static const uri_properties uri_tests[] = { ...@@ -738,7 +738,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,TRUE}, {"ftp://w%5D%5Be:PA%7B%7D@ftp.google.com/",S_OK,TRUE},
{"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,TRUE}, {"w%5D%5Be:PA%7B%7D@ftp.google.com",S_OK,FALSE},
{"ftp://ftp.google.com/",S_OK,TRUE}, {"ftp://ftp.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -769,7 +769,7 @@ static const uri_properties uri_tests[] = { ...@@ -769,7 +769,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://empty:@ftp.google.com/",S_OK,TRUE}, {"ftp://empty:@ftp.google.com/",S_OK,TRUE},
{"empty:@ftp.google.com",S_OK,TRUE}, {"empty:@ftp.google.com",S_OK,FALSE},
{"ftp://ftp.google.com/",S_OK,TRUE}, {"ftp://ftp.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -800,7 +800,7 @@ static const uri_properties uri_tests[] = { ...@@ -800,7 +800,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://%22%20%22weird@ftp.google.com/",S_OK,TRUE}, {"ftp://%22%20%22weird@ftp.google.com/",S_OK,TRUE},
{"%22%20%22weird@ftp.google.com",S_OK,TRUE}, {"%22%20%22weird@ftp.google.com",S_OK,FALSE},
{"ftp://ftp.google.com/",S_OK,TRUE}, {"ftp://ftp.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -831,7 +831,7 @@ static const uri_properties uri_tests[] = { ...@@ -831,7 +831,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://\" \"weird@ftp.google.com/",S_OK,TRUE}, {"ftp://\" \"weird@ftp.google.com/",S_OK,TRUE},
{"\" \"weird@ftp.google.com",S_OK,TRUE}, {"\" \"weird@ftp.google.com",S_OK,FALSE},
{"ftp://ftp.google.com/",S_OK,TRUE}, {"ftp://ftp.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -861,7 +861,7 @@ static const uri_properties uri_tests[] = { ...@@ -861,7 +861,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://%xy:word@winehq.org/",S_OK,TRUE}, {"zip://%xy:word@winehq.org/",S_OK,TRUE},
{"%xy:word@winehq.org",S_OK,TRUE}, {"%xy:word@winehq.org",S_OK,FALSE},
{"zip://%xy:word@winehq.org/",S_OK,TRUE}, {"zip://%xy:word@winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -893,7 +893,7 @@ static const uri_properties uri_tests[] = { ...@@ -893,7 +893,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE}, {"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE},
{"%2E:%52%53ord@winehq.org",S_OK,TRUE}, {"%2E:%52%53ord@winehq.org",S_OK,FALSE},
{"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE}, {"zip://%2E:%52%53ord@winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -923,7 +923,7 @@ static const uri_properties uri_tests[] = { ...@@ -923,7 +923,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://[](),'test':word@winehq.org/",S_OK,TRUE}, {"ftp://[](),'test':word@winehq.org/",S_OK,TRUE},
{"[](),'test':word@winehq.org",S_OK,TRUE}, {"[](),'test':word@winehq.org",S_OK,FALSE},
{"ftp://winehq.org/",S_OK,TRUE}, {"ftp://winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -952,7 +952,7 @@ static const uri_properties uri_tests[] = { ...@@ -952,7 +952,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://test/?:word@winehq.org/",S_OK,TRUE}, {"ftp://test/?:word@winehq.org/",S_OK,TRUE},
{"test",S_OK,TRUE}, {"test",S_OK,FALSE},
{"ftp://test/?:word@winehq.org/",S_OK,TRUE}, {"ftp://test/?:word@winehq.org/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -981,7 +981,7 @@ static const uri_properties uri_tests[] = { ...@@ -981,7 +981,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://test/#:word@winehq.org/",S_OK,TRUE}, {"ftp://test/#:word@winehq.org/",S_OK,TRUE},
{"test",S_OK,TRUE}, {"test",S_OK,FALSE},
{"ftp://test/#:word@winehq.org/",S_OK,TRUE}, {"ftp://test/#:word@winehq.org/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1011,7 +1011,7 @@ static const uri_properties uri_tests[] = { ...@@ -1011,7 +1011,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://test\\:word@winehq.org/",S_OK,TRUE}, {"zip://test\\:word@winehq.org/",S_OK,TRUE},
{"test\\:word@winehq.org",S_OK,TRUE}, {"test\\:word@winehq.org",S_OK,FALSE},
{"zip://test\\:word@winehq.org/",S_OK,TRUE}, {"zip://test\\:word@winehq.org/",S_OK,TRUE},
{"winehq.org",S_OK,TRUE}, {"winehq.org",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1041,7 +1041,7 @@ static const uri_properties uri_tests[] = { ...@@ -1041,7 +1041,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://127.0.0.100/",S_OK,TRUE}, {"http://127.0.0.100/",S_OK,TRUE},
{"127.0.0.100",S_OK,TRUE}, {"127.0.0.100",S_OK,FALSE},
{"http://127.0.0.100/",S_OK,TRUE}, {"http://127.0.0.100/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1071,7 +1071,7 @@ static const uri_properties uri_tests[] = { ...@@ -1071,7 +1071,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://127.0.0.0/",S_OK,TRUE}, {"http://127.0.0.0/",S_OK,TRUE},
{"127.0.0.0",S_OK,TRUE}, {"127.0.0.0",S_OK,FALSE},
{"http://127.0.0.0/",S_OK,TRUE}, {"http://127.0.0.0/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1101,7 +1101,7 @@ static const uri_properties uri_tests[] = { ...@@ -1101,7 +1101,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://0.1.226.64/",S_OK,TRUE}, {"http://0.1.226.64/",S_OK,TRUE},
{"0.1.226.64",S_OK,TRUE}, {"0.1.226.64",S_OK,FALSE},
{"http://0.1.226.64/",S_OK,TRUE}, {"http://0.1.226.64/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1131,7 +1131,7 @@ static const uri_properties uri_tests[] = { ...@@ -1131,7 +1131,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://255.255.255.255/",S_OK,TRUE}, {"http://255.255.255.255/",S_OK,TRUE},
{"255.255.255.255",S_OK,TRUE}, {"255.255.255.255",S_OK,FALSE},
{"http://255.255.255.255/",S_OK,TRUE}, {"http://255.255.255.255/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1161,7 +1161,7 @@ static const uri_properties uri_tests[] = { ...@@ -1161,7 +1161,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://4294967296/",S_OK,TRUE}, {"http://4294967296/",S_OK,TRUE},
{"4294967296",S_OK,TRUE}, {"4294967296",S_OK,FALSE},
{"http://4294967296/",S_OK,TRUE}, {"http://4294967296/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1191,7 +1191,7 @@ static const uri_properties uri_tests[] = { ...@@ -1191,7 +1191,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"1234://4294967295/",S_OK,TRUE}, {"1234://4294967295/",S_OK,TRUE},
{"4294967295",S_OK,TRUE}, {"4294967295",S_OK,FALSE},
{"1234://4294967295/",S_OK,TRUE}, {"1234://4294967295/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1221,7 +1221,7 @@ static const uri_properties uri_tests[] = { ...@@ -1221,7 +1221,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"1234://127.001/",S_OK,TRUE}, {"1234://127.001/",S_OK,TRUE},
{"127.001",S_OK,TRUE}, {"127.001",S_OK,FALSE},
{"1234://127.001/",S_OK,TRUE}, {"1234://127.001/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1250,7 +1250,7 @@ static const uri_properties uri_tests[] = { ...@@ -1250,7 +1250,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[fedc:ba98::3210]/",S_OK,TRUE}, {"http://[fedc:ba98::3210]/",S_OK,TRUE},
{"[fedc:ba98::3210]",S_OK,TRUE}, {"[fedc:ba98::3210]",S_OK,FALSE},
{"http://[fedc:ba98::3210]/",S_OK,TRUE}, {"http://[fedc:ba98::3210]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1279,7 +1279,7 @@ static const uri_properties uri_tests[] = { ...@@ -1279,7 +1279,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[::]/",S_OK,TRUE}, {"http://[::]/",S_OK,TRUE},
{"[::]",S_OK,TRUE}, {"[::]",S_OK,FALSE},
{"http://[::]/",S_OK,TRUE}, {"http://[::]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1308,7 +1308,7 @@ static const uri_properties uri_tests[] = { ...@@ -1308,7 +1308,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[fedc:ba98::]/",S_OK,TRUE}, {"http://[fedc:ba98::]/",S_OK,TRUE},
{"[fedc:ba98::]",S_OK,TRUE}, {"[fedc:ba98::]",S_OK,FALSE},
{"http://[fedc:ba98::]/",S_OK,TRUE}, {"http://[fedc:ba98::]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1338,7 +1338,7 @@ static const uri_properties uri_tests[] = { ...@@ -1338,7 +1338,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[1:0:3:4:5:6:7:8]/",S_OK,TRUE}, {"http://[1:0:3:4:5:6:7:8]/",S_OK,TRUE},
{"[1:0:3:4:5:6:7:8]",S_OK,TRUE}, {"[1:0:3:4:5:6:7:8]",S_OK,FALSE},
{"http://[1:0:3:4:5:6:7:8]/",S_OK,TRUE}, {"http://[1:0:3:4:5:6:7:8]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1367,7 +1367,7 @@ static const uri_properties uri_tests[] = { ...@@ -1367,7 +1367,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[v2.34]/",S_OK,TRUE}, {"http://[v2.34]/",S_OK,TRUE},
{"[v2.34]",S_OK,TRUE}, {"[v2.34]",S_OK,FALSE},
{"http://[v2.34]/",S_OK,TRUE}, {"http://[v2.34]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1397,7 +1397,7 @@ static const uri_properties uri_tests[] = { ...@@ -1397,7 +1397,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[xyz:12345.com/test",S_OK,TRUE}, {"http://[xyz:12345.com/test",S_OK,TRUE},
{"[xyz:12345.com",S_OK,TRUE}, {"[xyz:12345.com",S_OK,FALSE},
{"http://[xyz:12345.com/test",S_OK,TRUE}, {"http://[xyz:12345.com/test",S_OK,TRUE},
{"[xyz:12345.com",S_OK,TRUE}, {"[xyz:12345.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1429,7 +1429,7 @@ static const uri_properties uri_tests[] = { ...@@ -1429,7 +1429,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"ftp://www.[works].com/",S_OK,TRUE}, {"ftp://www.[works].com/",S_OK,TRUE},
{"www.[works].com",S_OK,TRUE}, {"www.[works].com",S_OK,FALSE},
{"ftp://www.[works].com/",S_OK,TRUE}, {"ftp://www.[works].com/",S_OK,TRUE},
{"[works].com",S_OK,TRUE}, {"[works].com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1459,7 +1459,7 @@ static const uri_properties uri_tests[] = { ...@@ -1459,7 +1459,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://www.google.com]:12345/",S_OK,TRUE}, {"http://www.google.com]:12345/",S_OK,TRUE},
{"www.google.com]:12345",S_OK,TRUE}, {"www.google.com]:12345",S_OK,FALSE},
{"http://www.google.com]:12345/",S_OK,TRUE}, {"http://www.google.com]:12345/",S_OK,TRUE},
{"google.com]",S_OK,TRUE}, {"google.com]",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1489,7 +1489,7 @@ static const uri_properties uri_tests[] = { ...@@ -1489,7 +1489,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://w%XXw%GEw.google.com/",S_OK,TRUE}, {"zip://w%XXw%GEw.google.com/",S_OK,TRUE},
{"w%XXw%GEw.google.com",S_OK,TRUE}, {"w%XXw%GEw.google.com",S_OK,FALSE},
{"zip://w%XXw%GEw.google.com/",S_OK,TRUE}, {"zip://w%XXw%GEw.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1519,7 +1519,7 @@ static const uri_properties uri_tests[] = { ...@@ -1519,7 +1519,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://GOOGLE.com/",S_OK,TRUE}, {"zip://GOOGLE.com/",S_OK,TRUE},
{"GOOGLE.com",S_OK,TRUE}, {"GOOGLE.com",S_OK,FALSE},
{"zip://GOOGLE.com/",S_OK,TRUE}, {"zip://GOOGLE.com/",S_OK,TRUE},
{"GOOGLE.com",S_OK,TRUE}, {"GOOGLE.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1549,7 +1549,7 @@ static const uri_properties uri_tests[] = { ...@@ -1549,7 +1549,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://www.google.com/",S_OK,TRUE}, {"http://www.google.com/",S_OK,TRUE},
{"www.google.com",S_OK,TRUE}, {"www.google.com",S_OK,FALSE},
{"http://www.google.com/",S_OK,TRUE}, {"http://www.google.com/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1581,7 +1581,7 @@ static const uri_properties uri_tests[] = { ...@@ -1581,7 +1581,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://www.%7cgoogle%7c.com/",S_OK,TRUE}, {"http://www.%7cgoogle%7c.com/",S_OK,TRUE},
{"www.%7cgoogle%7c.com",S_OK,TRUE}, {"www.%7cgoogle%7c.com",S_OK,FALSE},
{"http://www.%7cgoogle%7c.com/",S_OK,TRUE}, {"http://www.%7cgoogle%7c.com/",S_OK,TRUE},
{"%7cgoogle%7c.com",S_OK,TRUE}, {"%7cgoogle%7c.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1611,7 +1611,7 @@ static const uri_properties uri_tests[] = { ...@@ -1611,7 +1611,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[1:2:3:4:5:6::]/",S_OK,TRUE}, {"http://[1:2:3:4:5:6::]/",S_OK,TRUE},
{"[1:2:3:4:5:6::]",S_OK,TRUE}, {"[1:2:3:4:5:6::]",S_OK,FALSE},
{"http://[1:2:3:4:5:6::]/",S_OK,TRUE}, {"http://[1:2:3:4:5:6::]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1641,7 +1641,7 @@ static const uri_properties uri_tests[] = { ...@@ -1641,7 +1641,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[::1.2.3.0]/",S_OK,TRUE}, {"http://[::1.2.3.0]/",S_OK,TRUE},
{"[::1.2.3.0]",S_OK,TRUE}, {"[::1.2.3.0]",S_OK,FALSE},
{"http://[::1.2.3.0]/",S_OK,TRUE}, {"http://[::1.2.3.0]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1671,7 +1671,7 @@ static const uri_properties uri_tests[] = { ...@@ -1671,7 +1671,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,TRUE}, {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,TRUE},
{"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,TRUE}, {"[0001:0:000:0004:0005:0006:001.002.003.000]",S_OK,FALSE},
{"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,TRUE}, {"zip://[0001:0:000:0004:0005:0006:001.002.003.000]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1701,7 +1701,7 @@ static const uri_properties uri_tests[] = { ...@@ -1701,7 +1701,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://[ffff::c0de:6f20]/",S_OK,TRUE}, {"http://[ffff::c0de:6f20]/",S_OK,TRUE},
{"[ffff::c0de:6f20]",S_OK,TRUE}, {"[ffff::c0de:6f20]",S_OK,FALSE},
{"http://[ffff::c0de:6f20]/",S_OK,TRUE}, {"http://[ffff::c0de:6f20]/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1731,7 +1731,7 @@ static const uri_properties uri_tests[] = { ...@@ -1731,7 +1731,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://google.com:65535/",S_OK,TRUE}, {"http://google.com:65535/",S_OK,TRUE},
{"google.com:65535",S_OK,TRUE}, {"google.com:65535",S_OK,FALSE},
{"http://google.com:65535/",S_OK,TRUE}, {"http://google.com:65535/",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1760,7 +1760,7 @@ static const uri_properties uri_tests[] = { ...@@ -1760,7 +1760,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://google.com:65536/",S_OK,TRUE}, {"zip://google.com:65536/",S_OK,TRUE},
{"google.com:65536",S_OK,TRUE}, {"google.com:65536",S_OK,FALSE},
{"zip://google.com:65536/",S_OK,TRUE}, {"zip://google.com:65536/",S_OK,TRUE},
{"google.com:65536",S_OK,TRUE}, {"google.com:65536",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1789,7 +1789,7 @@ static const uri_properties uri_tests[] = { ...@@ -1789,7 +1789,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://google.com:65536:25/",S_OK,TRUE}, {"zip://google.com:65536:25/",S_OK,TRUE},
{"google.com:65536:25",S_OK,TRUE}, {"google.com:65536:25",S_OK,FALSE},
{"zip://google.com:65536:25/",S_OK,TRUE}, {"zip://google.com:65536:25/",S_OK,TRUE},
{"google.com:65536:25",S_OK,TRUE}, {"google.com:65536:25",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1818,7 +1818,7 @@ static const uri_properties uri_tests[] = { ...@@ -1818,7 +1818,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://[::ffff]:abcd/",S_OK,TRUE}, {"zip://[::ffff]:abcd/",S_OK,TRUE},
{"[::ffff]:abcd",S_OK,TRUE}, {"[::ffff]:abcd",S_OK,FALSE},
{"zip://[::ffff]:abcd/",S_OK,TRUE}, {"zip://[::ffff]:abcd/",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1847,7 +1847,7 @@ static const uri_properties uri_tests[] = { ...@@ -1847,7 +1847,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"zip://127.0.0.1:abcd/",S_OK,TRUE}, {"zip://127.0.0.1:abcd/",S_OK,TRUE},
{"127.0.0.1:abcd",S_OK,TRUE}, {"127.0.0.1:abcd",S_OK,FALSE},
{"zip://127.0.0.1:abcd/",S_OK,TRUE}, {"zip://127.0.0.1:abcd/",S_OK,TRUE},
{"0.1:abcd",S_OK,TRUE}, {"0.1:abcd",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1876,7 +1876,7 @@ static const uri_properties uri_tests[] = { ...@@ -1876,7 +1876,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://google.com:00035",S_OK,TRUE}, {"http://google.com:00035",S_OK,TRUE},
{"google.com:00035",S_OK,TRUE}, {"google.com:00035",S_OK,FALSE},
{"http://google.com:00035",S_OK,TRUE,"http://google.com:35"}, {"http://google.com:00035",S_OK,TRUE,"http://google.com:35"},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -1905,7 +1905,7 @@ static const uri_properties uri_tests[] = { ...@@ -1905,7 +1905,7 @@ static const uri_properties uri_tests[] = {
TRUE, TRUE,
{ {
{"http://google.com:80",S_OK,TRUE}, {"http://google.com:80",S_OK,TRUE},
{"google.com:80",S_OK,TRUE}, {"google.com:80",S_OK,FALSE},
{"http://google.com:80",S_OK,TRUE}, {"http://google.com:80",S_OK,TRUE},
{"google.com",S_OK,TRUE}, {"google.com",S_OK,TRUE},
{"",S_FALSE,TRUE}, {"",S_FALSE,TRUE},
...@@ -2364,27 +2364,6 @@ static void test_IUri_GetStrProperties(void) { ...@@ -2364,27 +2364,6 @@ static void test_IUri_GetStrProperties(void) {
SysFreeString(received); SysFreeString(received);
received = NULL; received = NULL;
/* GetAuthority() tests. */
prop = test.str_props[Uri_PROPERTY_AUTHORITY];
hr = IUri_GetAuthority(uri, &received);
if(prop.todo) {
todo_wine {
ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
hr, prop.expected, i);
}
todo_wine {
ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
prop.value, wine_dbgstr_w(received), i);
}
} else {
ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
hr, prop.expected, i);
ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
prop.value, wine_dbgstr_w(received), i);
}
SysFreeString(received);
received = NULL;
/* GetDisplayUri() tests. */ /* GetDisplayUri() tests. */
prop = test.str_props[Uri_PROPERTY_DISPLAY_URI]; prop = test.str_props[Uri_PROPERTY_DISPLAY_URI];
hr = IUri_GetDisplayUri(uri, &received); hr = IUri_GetDisplayUri(uri, &received);
...@@ -2493,6 +2472,27 @@ static void test_IUri_GetStrProperties(void) { ...@@ -2493,6 +2472,27 @@ static void test_IUri_GetStrProperties(void) {
received = NULL; received = NULL;
skip_unimplemented: skip_unimplemented:
/* GetAuthority() tests. */
prop = test.str_props[Uri_PROPERTY_AUTHORITY];
hr = IUri_GetAuthority(uri, &received);
if(prop.todo) {
todo_wine {
ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
hr, prop.expected, i);
}
todo_wine {
ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
prop.value, wine_dbgstr_w(received), i);
}
} else {
ok(hr == prop.expected, "Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].\n",
hr, prop.expected, i);
ok(!strcmp_aw(prop.value, received), "Error: Expected %s but got %s on uri_tests[%d].\n",
prop.value, wine_dbgstr_w(received), i);
}
SysFreeString(received);
received = NULL;
/* GetHost() tests. */ /* GetHost() tests. */
prop = test.str_props[Uri_PROPERTY_HOST]; prop = test.str_props[Uri_PROPERTY_HOST];
hr = IUri_GetHost(uri, &received); hr = IUri_GetHost(uri, &received);
......
...@@ -53,6 +53,9 @@ typedef struct { ...@@ -53,6 +53,9 @@ typedef struct {
USHORT port; USHORT port;
BOOL has_port; BOOL has_port;
INT authority_start;
DWORD authority_len;
} Uri; } Uri;
typedef struct { typedef struct {
...@@ -1979,6 +1982,9 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO ...@@ -1979,6 +1982,9 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
/* Canonicalizes the authority of the URI represented by the parse_data. */ /* Canonicalizes the authority of the URI represented by the parse_data. */
static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) {
uri->authority_start = uri->canon_len;
uri->authority_len = 0;
if(!canonicalize_userinfo(data, uri, flags, computeOnly)) if(!canonicalize_userinfo(data, uri, flags, computeOnly))
return FALSE; return FALSE;
...@@ -1988,6 +1994,11 @@ static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags ...@@ -1988,6 +1994,11 @@ static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags
if(!canonicalize_port(data, uri, flags, computeOnly)) if(!canonicalize_port(data, uri, flags, computeOnly))
return FALSE; return FALSE;
if(uri->host_start != -1)
uri->authority_len = uri->canon_len - uri->authority_start;
else
uri->authority_start = -1;
return TRUE; return TRUE;
} }
...@@ -2023,6 +2034,8 @@ static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, ...@@ -2023,6 +2034,8 @@ static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags,
uri->host_len = 0; uri->host_len = 0;
uri->host_type = Uri_HOST_UNKNOWN; uri->host_type = Uri_HOST_UNKNOWN;
uri->has_port = FALSE; uri->has_port = FALSE;
uri->authority_start = -1;
uri->authority_len = 0;
} }
return TRUE; return TRUE;
...@@ -2222,6 +2235,19 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST ...@@ -2222,6 +2235,19 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST
} }
switch(uriProp) { switch(uriProp) {
case Uri_PROPERTY_AUTHORITY:
if(This->authority_start > -1) {
*pbstrProperty = SysAllocStringLen(This->canon_uri+This->authority_start, This->authority_len);
hres = S_OK;
} else {
*pbstrProperty = SysAllocStringLen(NULL, 0);
hres = S_FALSE;
}
if(!(*pbstrProperty))
hres = E_OUTOFMEMORY;
break;
case Uri_PROPERTY_HOST: case Uri_PROPERTY_HOST:
if(This->host_start > -1) { if(This->host_start > -1) {
/* The '[' and ']' aren't included for IPv6 addresses. */ /* The '[' and ']' aren't included for IPv6 addresses. */
...@@ -2337,6 +2363,10 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D ...@@ -2337,6 +2363,10 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D
} }
switch(uriProp) { switch(uriProp) {
case Uri_PROPERTY_AUTHORITY:
*pcchProperty = This->authority_len;
hres = (This->authority_start > -1) ? S_OK : S_FALSE;
break;
case Uri_PROPERTY_HOST: case Uri_PROPERTY_HOST:
*pcchProperty = This->host_len; *pcchProperty = This->host_len;
...@@ -2450,13 +2480,8 @@ static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri) ...@@ -2450,13 +2480,8 @@ static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority) static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
{ {
Uri *This = URI_THIS(iface); TRACE("(%p)->(%p)\n", iface, pstrAuthority);
FIXME("(%p)->(%p)\n", This, pstrAuthority); return Uri_GetPropertyBSTR(iface, Uri_PROPERTY_AUTHORITY, pstrAuthority, 0);
if(!pstrAuthority)
return E_POINTER;
return E_NOTIMPL;
} }
static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri) static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
......
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