Commit e857a70a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Compile tests with -D__WINESRC__.

parent f5113d2d
TESTDLL = wininet.dll TESTDLL = wininet.dll
IMPORTS = wininet crypt32 ws2_32 user32 advapi32 IMPORTS = wininet crypt32 ws2_32 user32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
ftp.c \ ftp.c \
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wininet.h" #include "wininet.h"
#include "winsock.h" #include "winsock2.h"
#include "wine/test.h" #include "wine/test.h"
...@@ -71,7 +71,7 @@ static void test_connect(HINTERNET hInternet) ...@@ -71,7 +71,7 @@ static void test_connect(HINTERNET hInternet)
*/ */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (hFtp) /* some servers accept an empty password */ if (hFtp) /* some servers accept an empty password */
{ {
ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError());
...@@ -82,13 +82,13 @@ static void test_connect(HINTERNET hInternet) ...@@ -82,13 +82,13 @@ static void test_connect(HINTERNET hInternet)
"Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError()); "Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
ok ( hFtp == NULL, "Expected InternetConnect to fail\n"); ok ( hFtp == NULL, "Expected InternetConnect to fail\n");
ok ( GetLastError() == ERROR_INVALID_PARAMETER, ok ( GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@", hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@",
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
ok(!hFtp, "Expected InternetConnect to fail\n"); ok(!hFtp, "Expected InternetConnect to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
...@@ -102,19 +102,19 @@ static void test_connect(HINTERNET hInternet) ...@@ -102,19 +102,19 @@ static void test_connect(HINTERNET hInternet)
*/ */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (!hFtp && (GetLastError() == ERROR_INTERNET_LOGIN_FAILURE)) if (!hFtp && (GetLastError() == ERROR_INTERNET_LOGIN_FAILURE))
{ {
/* We are most likely running on a clean Wine install or a Windows install where the registry key is removed */ /* We are most likely running on a clean Wine install or a Windows install where the registry key is removed */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", "IEUser@", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
} }
ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError()); ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError());
ok ( GetLastError() == ERROR_SUCCESS, ok ( GetLastError() == ERROR_SUCCESS,
"ERROR_SUCCESS, got %d\n", GetLastError()); "ERROR_SUCCESS, got %d\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", NULL, hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", NULL,
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (!hFtp) if (!hFtp)
{ {
...@@ -746,7 +746,7 @@ static void test_command(HINTERNET hFtp, HINTERNET hConnect) ...@@ -746,7 +746,7 @@ static void test_command(HINTERNET hFtp, HINTERNET hConnect)
static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect) static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
{ {
WIN32_FIND_DATA findData; WIN32_FIND_DATAA findData;
HINTERNET hSearch; HINTERNET hSearch;
HINTERNET hSearch2; HINTERNET hSearch2;
HINTERNET hOpenFile; HINTERNET hOpenFile;
...@@ -943,7 +943,7 @@ static void test_status_callbacks(HINTERNET hInternet) ...@@ -943,7 +943,7 @@ static void test_status_callbacks(HINTERNET hInternet)
cb = pInternetSetStatusCallbackA(hInternet, status_callback); cb = pInternetSetStatusCallbackA(hInternet, status_callback);
ok(cb == NULL, "expected NULL got %p\n", cb); ok(cb == NULL, "expected NULL got %p\n", cb);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL,
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 1); INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 1);
if (!hFtp) if (!hFtp)
{ {
...@@ -974,17 +974,17 @@ START_TEST(ftp) ...@@ -974,17 +974,17 @@ START_TEST(ftp)
pInternetSetStatusCallbackA = (void*)GetProcAddress(hWininet, "InternetSetStatusCallbackA"); pInternetSetStatusCallbackA = (void*)GetProcAddress(hWininet, "InternetSetStatusCallbackA");
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hInternet = InternetOpen("winetest", 0, NULL, NULL, 0); hInternet = InternetOpenA("winetest", 0, NULL, NULL, 0);
ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError()); ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError());
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); hFtp = InternetConnectA(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if (!hFtp) if (!hFtp)
{ {
InternetCloseHandle(hInternet); InternetCloseHandle(hInternet);
skip("No ftp connection could be made to ftp.winehq.org\n"); skip("No ftp connection could be made to ftp.winehq.org\n");
return; return;
} }
hHttp = InternetConnect(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); hHttp = InternetConnectA(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
if (!hHttp) if (!hHttp)
{ {
InternetCloseHandle(hFtp); InternetCloseHandle(hFtp);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -517,7 +517,7 @@ static void InternetCrackUrl_test(void) ...@@ -517,7 +517,7 @@ static void InternetCrackUrl_test(void)
ret, GLE); ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024); copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrl("about://host/blank", 0,0,&urlComponents); ret = InternetCrackUrlA("about://host/blank", 0,0,&urlComponents);
ok(ret, "InternetCrackUrl failed with %d\n", GetLastError()); ok(ret, "InternetCrackUrl failed with %d\n", GetLastError());
ok(!strcmp(urlComponents.lpszScheme, "about"), "lpszScheme was \"%s\" instead of \"about\"\n", urlComponents.lpszScheme); ok(!strcmp(urlComponents.lpszScheme, "about"), "lpszScheme was \"%s\" instead of \"about\"\n", urlComponents.lpszScheme);
ok(!strcmp(urlComponents.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName); ok(!strcmp(urlComponents.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName);
...@@ -526,7 +526,7 @@ static void InternetCrackUrl_test(void) ...@@ -526,7 +526,7 @@ static void InternetCrackUrl_test(void)
/* try a NULL lpszUrl */ /* try a NULL lpszUrl */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024); copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrl(NULL, 0, 0, &urlComponents); ret = InternetCrackUrlA(NULL, 0, 0, &urlComponents);
GLE = GetLastError(); GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n"); ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GLE); ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GLE);
...@@ -536,7 +536,7 @@ static void InternetCrackUrl_test(void) ...@@ -536,7 +536,7 @@ static void InternetCrackUrl_test(void)
*/ */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024); copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrl("", 0, 0, &urlComponents); ret = InternetCrackUrlA("", 0, 0, &urlComponents);
GLE = GetLastError(); GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n"); ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n"); ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n");
...@@ -746,7 +746,7 @@ static void InternetCrackUrlW_test(void) ...@@ -746,7 +746,7 @@ static void InternetCrackUrlW_test(void)
ok( urlpart[0] == 0, "urlpart should be empty\n"); ok( urlpart[0] == 0, "urlpart should be empty\n");
} }
static void fill_url_components(LPURL_COMPONENTS lpUrlComponents) static void fill_url_components(URL_COMPONENTSA *lpUrlComponents)
{ {
static CHAR http[] = "http", static CHAR http[] = "http",
winehq[] = "www.winehq.org", winehq[] = "www.winehq.org",
...@@ -755,7 +755,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents) ...@@ -755,7 +755,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
site_about[] = "/site/about", site_about[] = "/site/about",
empty[] = ""; empty[] = "";
lpUrlComponents->dwStructSize = sizeof(URL_COMPONENTS); lpUrlComponents->dwStructSize = sizeof(URL_COMPONENTSA);
lpUrlComponents->lpszScheme = http; lpUrlComponents->lpszScheme = http;
lpUrlComponents->dwSchemeLength = strlen(lpUrlComponents->lpszScheme); lpUrlComponents->dwSchemeLength = strlen(lpUrlComponents->lpszScheme);
lpUrlComponents->nScheme = INTERNET_SCHEME_HTTP; lpUrlComponents->nScheme = INTERNET_SCHEME_HTTP;
...@@ -774,7 +774,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents) ...@@ -774,7 +774,7 @@ static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
static void InternetCreateUrlA_test(void) static void InternetCreateUrlA_test(void)
{ {
URL_COMPONENTS urlComp; URL_COMPONENTSA urlComp;
LPSTR szUrl; LPSTR szUrl;
DWORD len = -1; DWORD len = -1;
BOOL ret; BOOL ret;
...@@ -802,7 +802,7 @@ static void InternetCreateUrlA_test(void) ...@@ -802,7 +802,7 @@ static void InternetCreateUrlA_test(void)
ok(len == -1, "Expected len -1, got %d\n", len); ok(len == -1, "Expected len -1, got %d\n", len);
/* test zero'ed lpUrlComponents */ /* test zero'ed lpUrlComponents */
ZeroMemory(&urlComp, sizeof(URL_COMPONENTS)); ZeroMemory(&urlComp, sizeof(urlComp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len); ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
...@@ -992,7 +992,7 @@ static void InternetCreateUrlA_test(void) ...@@ -992,7 +992,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = http; urlComp.lpszScheme = http;
urlComp.dwSchemeLength = 0; urlComp.dwSchemeLength = 0;
urlComp.nScheme = INTERNET_SCHEME_HTTP; urlComp.nScheme = INTERNET_SCHEME_HTTP;
...@@ -1017,7 +1017,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1017,7 +1017,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = https; urlComp.lpszScheme = https;
urlComp.dwSchemeLength = 0; urlComp.dwSchemeLength = 0;
urlComp.nScheme = INTERNET_SCHEME_HTTP; urlComp.nScheme = INTERNET_SCHEME_HTTP;
...@@ -1042,7 +1042,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1042,7 +1042,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = about; urlComp.lpszScheme = about;
urlComp.dwSchemeLength = 5; urlComp.dwSchemeLength = 5;
urlComp.lpszUrlPath = blank; urlComp.lpszUrlPath = blank;
...@@ -1058,7 +1058,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1058,7 +1058,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = about; urlComp.lpszScheme = about;
urlComp.lpszHostName = host; urlComp.lpszHostName = host;
urlComp.lpszUrlPath = blank; urlComp.lpszUrlPath = blank;
...@@ -1073,7 +1073,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1073,7 +1073,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.nPort = 8080; urlComp.nPort = 8080;
urlComp.lpszScheme = about; urlComp.lpszScheme = about;
len = strlen(CREATE_URL11); len = strlen(CREATE_URL11);
...@@ -1086,7 +1086,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1086,7 +1086,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = http; urlComp.lpszScheme = http;
urlComp.dwSchemeLength = 0; urlComp.dwSchemeLength = 0;
urlComp.nScheme = INTERNET_SCHEME_HTTP; urlComp.nScheme = INTERNET_SCHEME_HTTP;
...@@ -1103,7 +1103,7 @@ static void InternetCreateUrlA_test(void) ...@@ -1103,7 +1103,7 @@ static void InternetCreateUrlA_test(void)
HeapFree(GetProcessHeap(), 0, szUrl); HeapFree(GetProcessHeap(), 0, szUrl);
memset(&urlComp, 0, sizeof(urlComp)); memset(&urlComp, 0, sizeof(urlComp));
urlComp.dwStructSize = sizeof(URL_COMPONENTS); urlComp.dwStructSize = sizeof(urlComp);
urlComp.lpszScheme = http; urlComp.lpszScheme = http;
urlComp.dwSchemeLength = strlen(urlComp.lpszScheme); urlComp.dwSchemeLength = strlen(urlComp.lpszScheme);
urlComp.lpszHostName = localhost; urlComp.lpszHostName = localhost;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* between the A and W versions, we just define a set of macros so the * between the A and W versions, we just define a set of macros so the
* generated tests work anyway. * generated tests work anyway.
*/ */
#ifndef GOPHER_ABSTRACT_ATTRIBUTE_TYPE #ifndef __WINESRC__
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEA GOPHER_ABSTRACT_ATTRIBUTE_TYPE #define GOPHER_ABSTRACT_ATTRIBUTE_TYPEA GOPHER_ABSTRACT_ATTRIBUTE_TYPE
#define GOPHER_ABSTRACT_ATTRIBUTE_TYPEW GOPHER_ABSTRACT_ATTRIBUTE_TYPE #define GOPHER_ABSTRACT_ATTRIBUTE_TYPEW GOPHER_ABSTRACT_ATTRIBUTE_TYPE
......
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