Commit c56eec22 authored by Alexandre Julliard's avatar Alexandre Julliard

wininet/tests: Don't fail the tests if the network is unreachable.

parent 7f5b4a46
...@@ -591,7 +591,12 @@ static void HttpSendRequestEx_test(void) ...@@ -591,7 +591,12 @@ static void HttpSendRequestEx_test(void)
ok( hConnect != NULL, "Unable to connect to http://crossover.codeweavers.com\n"); ok( hConnect != NULL, "Unable to connect to http://crossover.codeweavers.com\n");
hRequest = HttpOpenRequest(hConnect, "POST", "/posttest.php", hRequest = HttpOpenRequest(hConnect, "POST", "/posttest.php",
NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0); NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0);
ok( hRequest != NULL, "Failed to open request handle\n"); if (!hRequest && GetLastError() == ERROR_INTERNET_NAME_NOT_RESOLVED)
{
trace( "Network unreachable, skipping test\n" );
goto done;
}
ok( hRequest != NULL, "Failed to open request handle err %lx\n", GetLastError());
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS); BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS);
...@@ -622,6 +627,7 @@ static void HttpSendRequestEx_test(void) ...@@ -622,6 +627,7 @@ static void HttpSendRequestEx_test(void)
ok(strncmp(szBuffer,"mode => Test\n",dwBytesRead)==0,"Got string %s\n",szBuffer); ok(strncmp(szBuffer,"mode => Test\n",dwBytesRead)==0,"Got string %s\n",szBuffer);
ok(InternetCloseHandle(hRequest), "Close request handle failed\n"); ok(InternetCloseHandle(hRequest), "Close request handle failed\n");
done:
ok(InternetCloseHandle(hConnect), "Close connect handle failed\n"); ok(InternetCloseHandle(hConnect), "Close connect handle failed\n");
ok(InternetCloseHandle(hSession), "Close session handle failed\n"); ok(InternetCloseHandle(hSession), "Close session handle failed\n");
} }
...@@ -644,6 +650,11 @@ static void HttpHeaders_test(void) ...@@ -644,6 +650,11 @@ static void HttpHeaders_test(void)
ok( hConnect != NULL, "Unable to connect to http://crossover.codeweavers.com\n"); ok( hConnect != NULL, "Unable to connect to http://crossover.codeweavers.com\n");
hRequest = HttpOpenRequest(hConnect, "POST", "/posttest.php", hRequest = HttpOpenRequest(hConnect, "POST", "/posttest.php",
NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0); NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0);
if (!hRequest && GetLastError() == ERROR_INTERNET_NAME_NOT_RESOLVED)
{
trace( "Network unreachable, skipping test\n" );
goto done;
}
ok( hRequest != NULL, "Failed to open request handle\n"); ok( hRequest != NULL, "Failed to open request handle\n");
index = 0; index = 0;
...@@ -799,6 +810,7 @@ static void HttpHeaders_test(void) ...@@ -799,6 +810,7 @@ static void HttpHeaders_test(void)
ok(InternetCloseHandle(hRequest), "Close request handle failed\n"); ok(InternetCloseHandle(hRequest), "Close request handle failed\n");
done:
ok(InternetCloseHandle(hConnect), "Close connect handle failed\n"); ok(InternetCloseHandle(hConnect), "Close connect handle failed\n");
ok(InternetCloseHandle(hSession), "Close session handle failed\n"); ok(InternetCloseHandle(hSession), "Close session handle failed\n");
} }
......
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