From f3968fdf80fc15f12f8000640873b059adfd75ad Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 7 Jun 2010 13:41:40 -0700 Subject: [PATCH] winhttp/tests: Skip tests when a connection fails. --- dlls/winhttp/tests/winhttp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 26477ee2974..05c548c5f65 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -211,6 +211,11 @@ static void test_OpenRequest (void) 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); + if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + { + skip("Connection failed, skipping.\n"); + goto done; + } ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); ret = WinHttpCloseHandle(request); ok(ret == TRUE, "WinHttpCloseHandle failed on closing request, got %d.\n", ret); @@ -781,6 +786,11 @@ static void test_secure_connection(void) ok(req != NULL, "failed to open a request %u\n", GetLastError()); 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()); ret = WinHttpReceiveResponse(req, NULL);