From: Jacek Caban Subject: wininet: Skip more problematic tests on IE6. Message-Id: <574B28BE.9030408@codeweavers.com> Date: Sun, 29 May 2016 19:37:02 +0200 Signed-off-by: Jacek Caban --- dlls/wininet/tests/http.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index f27db62..e84ffa3 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -111,6 +111,7 @@ static const char *status_string[MAX_INTERNET_STATUS]; static HANDLE hCompleteEvent, conn_close_event, conn_wait_event, server_req_rec_event; static DWORD req_error; +static BOOL is_ie7plus = TRUE; #define TESTF_REDIRECT 0x01 #define TESTF_COMPRESSED 0x02 @@ -1079,10 +1080,12 @@ static void InternetReadFileExA_test(int flags) CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTING_TO_SERVER); CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTED_TO_SERVER); - rc = InternetReadFileExW(hor, NULL, 0, 0xdeadcafe); - ok(!rc && (GetLastError() == ERROR_INVALID_PARAMETER), - "InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %u\n", - rc ? "TRUE" : "FALSE", GetLastError()); + if(is_ie7plus) { + rc = InternetReadFileExW(hor, NULL, 0, 0xdeadcafe); + ok(!rc && (GetLastError() == ERROR_INVALID_PARAMETER), + "InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %u\n", + rc ? "TRUE" : "FALSE", GetLastError()); + } /* tests invalid dwStructSize */ inetbuffers.dwStructSize = sizeof(inetbuffers)+1; @@ -4681,6 +4684,9 @@ static void test_http_read(int port) test_request_t req; char buf[4096]; + if(!is_ie7plus) + return; + hCompleteEvent = CreateEventW(NULL, FALSE, FALSE, NULL); conn_wait_event = CreateEventW(NULL, FALSE, FALSE, NULL); server_req_rec_event = CreateEventW(NULL, FALSE, FALSE, NULL); @@ -4725,6 +4731,9 @@ static void test_long_url(int port) DWORD size, len; BOOL ret; + if(!is_ie7plus) + return; + memset(long_path+strlen(long_path), 'x', sizeof(long_path)-strlen(long_path)); long_path[sizeof(long_path)-1] = 0; open_simple_request(&req, "localhost", port, NULL, long_path); @@ -5567,10 +5576,8 @@ static void test_open_url_async(void) * other versions never do. They also hang of following tests. We disable it for everything older * than IE7. */ - if(!pInternetGetSecurityInfoByURLA) { - win_skip("Skipping async open on too old wininet version.\n"); + if(!is_ie7plus) return; - } ctx.req = NULL; ctx.event = CreateEventA(NULL, TRUE, FALSE, "Z:_home_hans_jaman-installer.exe_ev1"); @@ -6055,6 +6062,9 @@ static void test_default_service_port(void) char buffer[128]; BOOL ret; + if(!is_ie7plus) + return; + session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(session != NULL, "InternetOpen failed\n"); @@ -6231,6 +6241,11 @@ START_TEST(http) pInternetSetStatusCallbackW = (void*)GetProcAddress(hdll, "InternetSetStatusCallbackW"); pInternetGetSecurityInfoByURLA = (void*)GetProcAddress(hdll, "InternetGetSecurityInfoByURLA"); + if(!pInternetGetSecurityInfoByURLA) { + is_ie7plus = FALSE; + win_skip("IE6 found. It's too old for some tests.\n"); + } + init_status_tests(); test_InternetCloseHandle(); InternetReadFile_test(INTERNET_FLAG_ASYNC, &test_data[0]);