Commit 05a10d5f authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

wininet/tests: Add more tests for INTERNET_INVALID_PORT_NUMBER.

parent d488f6b8
......@@ -5733,7 +5733,8 @@ static void test_connection_failure(void)
static void test_default_service_port(void)
{
HINTERNET session, connect, request;
DWORD error;
DWORD size, error;
char buffer[128];
BOOL ret;
session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
......@@ -5753,6 +5754,50 @@ static void test_default_service_port(void)
ok(error == ERROR_INTERNET_SECURITY_CHANNEL_ERROR || error == ERROR_INTERNET_CANNOT_CONNECT,
"got %u\n", error);
size = sizeof(buffer);
memset(buffer, 0, sizeof(buffer));
ret = HttpQueryInfoA(request, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL);
ok(ret, "HttpQueryInfo failed with error %u\n", GetLastError());
ok(!strcmp(buffer, "test.winehq.org:80"), "Expected test.winehg.org:80, got '%s'\n", buffer);
InternetCloseHandle(request);
InternetCloseHandle(connect);
connect = InternetConnectA(session, "test.winehq.org", INTERNET_INVALID_PORT_NUMBER, NULL, NULL,
INTERNET_SERVICE_HTTP, INTERNET_FLAG_SECURE, 0);
ok(connect != NULL, "InternetConnect failed\n");
request = HttpOpenRequestA(connect, NULL, "/", NULL, NULL, NULL, INTERNET_FLAG_SECURE, 0);
ok(request != NULL, "HttpOpenRequest failed\n");
ret = HttpSendRequestA(request, NULL, 0, NULL, 0);
todo_wine ok(ret, "HttpSendRequest failed with error %u\n", GetLastError());
size = sizeof(buffer);
memset(buffer, 0, sizeof(buffer));
ret = HttpQueryInfoA(request, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL);
ok(ret, "HttpQueryInfo failed with error %u\n", GetLastError());
todo_wine ok(!strcmp(buffer, "test.winehq.org"), "Expected test.winehg.org, got '%s'\n", buffer);
InternetCloseHandle(request);
InternetCloseHandle(connect);
connect = InternetConnectA(session, "test.winehq.org", INTERNET_INVALID_PORT_NUMBER, NULL, NULL,
INTERNET_SERVICE_HTTP, INTERNET_FLAG_SECURE, 0);
ok(connect != NULL, "InternetConnect failed\n");
request = HttpOpenRequestA(connect, NULL, "/", NULL, NULL, NULL, 0, 0);
ok(request != NULL, "HttpOpenRequest failed\n");
ret = HttpSendRequestA(request, NULL, 0, NULL, 0);
ok(ret, "HttpSendRequest failed with error %u\n", GetLastError());
size = sizeof(buffer);
memset(buffer, 0, sizeof(buffer));
ret = HttpQueryInfoA(request, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL);
ok(ret, "HttpQueryInfo failed with error %u\n", GetLastError());
todo_wine ok(!strcmp(buffer, "test.winehq.org:443"), "Expected test.winehg.org:443, got '%s'\n", buffer);
InternetCloseHandle(request);
InternetCloseHandle(connect);
InternetCloseHandle(session);
......
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