Commit f3968fdf authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

winhttp/tests: Skip tests when a connection fails.

parent 1edc58ea
...@@ -211,6 +211,11 @@ static void test_OpenRequest (void) ...@@ -211,6 +211,11 @@ static void test_OpenRequest (void)
ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError());
ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0); ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0);
if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT)
{
skip("Connection failed, skipping.\n");
goto done;
}
ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError());
ret = WinHttpCloseHandle(request); ret = WinHttpCloseHandle(request);
ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret);
...@@ -781,6 +786,11 @@ static void test_secure_connection(void) ...@@ -781,6 +786,11 @@ static void test_secure_connection(void)
ok(req != NULL, "failed to open a request %u\n", GetLastError()); ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0);
if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT)
{
skip("Connection failed, skipping.\n");
goto cleanup;
}
ok(ret, "failed to send request %u\n", GetLastError()); ok(ret, "failed to send request %u\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); ret = WinHttpReceiveResponse(req, NULL);
......
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