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