Commit de3b5be3 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet/tests: Win64 printf format warning fixes.

parent f4ac836f
......@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = wininet.dll
IMPORTS = wininet ws2_32 kernel32
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
generated.c \
......
......@@ -46,84 +46,84 @@ static VOID WINAPI callback(
switch (dwInternetStatus)
{
case INTERNET_STATUS_RESOLVING_NAME:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_RESOLVING_NAME \"%s\" %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_RESOLVING_NAME \"%s\" %d\n",
GetCurrentThreadId(), hInternet, dwContext,
(LPCSTR)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_NAME_RESOLVED:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_NAME_RESOLVED \"%s\" %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_NAME_RESOLVED \"%s\" %d\n",
GetCurrentThreadId(), hInternet, dwContext,
(LPCSTR)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_CONNECTING_TO_SERVER:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_CONNECTING_TO_SERVER \"%s\" %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_CONNECTING_TO_SERVER \"%s\" %d\n",
GetCurrentThreadId(), hInternet, dwContext,
(LPCSTR)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_CONNECTED_TO_SERVER:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_CONNECTED_TO_SERVER \"%s\" %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_CONNECTED_TO_SERVER \"%s\" %d\n",
GetCurrentThreadId(), hInternet, dwContext,
(LPCSTR)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_SENDING_REQUEST:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_SENDING_REQUEST %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_SENDING_REQUEST %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_REQUEST_SENT:
ok(dwStatusInformationLength == sizeof(DWORD),
"info length should be sizeof(DWORD) instead of %ld\n",
"info length should be sizeof(DWORD) instead of %d\n",
dwStatusInformationLength);
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_REQUEST_SENT 0x%lx %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_REQUEST_SENT 0x%x %d\n",
GetCurrentThreadId(), hInternet, dwContext,
*(DWORD *)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_RECEIVING_RESPONSE:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_RECEIVING_RESPONSE %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_RECEIVING_RESPONSE %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_RESPONSE_RECEIVED:
ok(dwStatusInformationLength == sizeof(DWORD),
"info length should be sizeof(DWORD) instead of %ld\n",
"info length should be sizeof(DWORD) instead of %d\n",
dwStatusInformationLength);
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_RESPONSE_RECEIVED 0x%lx %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_RESPONSE_RECEIVED 0x%x %d\n",
GetCurrentThreadId(), hInternet, dwContext,
*(DWORD *)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_CTL_RESPONSE_RECEIVED:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_CTL_RESPONSE_RECEIVED %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_CTL_RESPONSE_RECEIVED %p %d\n",
GetCurrentThreadId(), hInternet,dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_PREFETCH:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_PREFETCH %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_PREFETCH %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_CLOSING_CONNECTION:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_CLOSING_CONNECTION %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_CLOSING_CONNECTION %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_CONNECTION_CLOSED:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_CONNECTION_CLOSED %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_CONNECTION_CLOSED %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_HANDLE_CREATED:
ok(dwStatusInformationLength == sizeof(HINTERNET),
"info length should be sizeof(HINTERNET) instead of %ld\n",
"info length should be sizeof(HINTERNET) instead of %d\n",
dwStatusInformationLength);
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_HANDLE_CREATED %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_HANDLE_CREATED %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
*(HINTERNET *)lpvStatusInformation,dwStatusInformationLength);
break;
case INTERNET_STATUS_HANDLE_CLOSING:
ok(dwStatusInformationLength == sizeof(HINTERNET),
"info length should be sizeof(HINTERNET) instead of %ld\n",
"info length should be sizeof(HINTERNET) instead of %d\n",
dwStatusInformationLength);
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_HANDLE_CLOSING %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_HANDLE_CLOSING %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
*(HINTERNET *)lpvStatusInformation, dwStatusInformationLength);
break;
......@@ -131,26 +131,26 @@ static VOID WINAPI callback(
{
INTERNET_ASYNC_RESULT *iar = (INTERNET_ASYNC_RESULT *)lpvStatusInformation;
ok(dwStatusInformationLength == sizeof(INTERNET_ASYNC_RESULT),
"info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %ld\n",
"info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %d\n",
dwStatusInformationLength);
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_REQUEST_COMPLETE {%ld,%ld} %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_REQUEST_COMPLETE {%d,%d} %d\n",
GetCurrentThreadId(), hInternet, dwContext,
iar->dwResult,iar->dwError,dwStatusInformationLength);
SetEvent(hCompleteEvent);
break;
}
case INTERNET_STATUS_REDIRECT:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_REDIRECT \"%s\" %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_REDIRECT \"%s\" %d\n",
GetCurrentThreadId(), hInternet, dwContext,
(LPCSTR)lpvStatusInformation, dwStatusInformationLength);
break;
case INTERNET_STATUS_INTERMEDIATE_RESPONSE:
trace("%04lx:Callback %p 0x%lx INTERNET_STATUS_INTERMEDIATE_RESPONSE %p %ld\n",
trace("%04x:Callback %p 0x%x INTERNET_STATUS_INTERMEDIATE_RESPONSE %p %d\n",
GetCurrentThreadId(), hInternet, dwContext,
lpvStatusInformation, dwStatusInformationLength);
break;
default:
trace("%04lx:Callback %p 0x%lx %ld %p %ld\n",
trace("%04x:Callback %p 0x%x %d %p %d\n",
GetCurrentThreadId(), hInternet, dwContext, dwInternetStatus,
lpvStatusInformation, dwStatusInformationLength);
}
......@@ -171,7 +171,7 @@ static void InternetReadFile_test(int flags)
trace("InternetOpenA <--\n");
hi = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, flags);
ok((hi != 0x0),"InternetOpen failed with error %ld\n", GetLastError());
ok((hi != 0x0),"InternetOpen failed with error %d\n", GetLastError());
trace("InternetOpenA -->\n");
if (hi == 0x0) goto abort;
......@@ -181,7 +181,7 @@ static void InternetReadFile_test(int flags)
trace("InternetConnectA <--\n");
hic=InternetConnectA(hi, "www.winehq.org", INTERNET_INVALID_PORT_NUMBER,
NULL, NULL, INTERNET_SERVICE_HTTP, 0x0, 0xdeadbeef);
ok((hic != 0x0),"InternetConnect failed with error %ld\n", GetLastError());
ok((hic != 0x0),"InternetConnect failed with error %d\n", GetLastError());
trace("InternetConnectA -->\n");
if (hic == 0x0) goto abort;
......@@ -198,7 +198,7 @@ static void InternetReadFile_test(int flags)
* abort.
*/
} else {
ok((hor != 0x0),"HttpOpenRequest failed with error %ld\n", GetLastError());
ok((hor != 0x0),"HttpOpenRequest failed with error %d\n", GetLastError());
}
trace("HttpOpenRequestA -->\n");
......@@ -212,7 +212,7 @@ static void InternetReadFile_test(int flags)
"Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
else
ok((rc != 0) || GetLastError() == ERROR_INTERNET_NAME_NOT_RESOLVED,
"Synchronous HttpSendRequest returning 0, error %ld\n", GetLastError());
"Synchronous HttpSendRequest returning 0, error %d\n", GetLastError());
trace("HttpSendRequestA <--\n");
if (flags & INTERNET_FLAG_ASYNC)
......@@ -220,36 +220,36 @@ static void InternetReadFile_test(int flags)
length = 4;
rc = InternetQueryOptionA(hor,INTERNET_OPTION_REQUEST_FLAGS,&out,&length);
trace("Option 0x17 -> %li %li\n",rc,out);
trace("Option 0x17 -> %i %i\n",rc,out);
length = 100;
rc = InternetQueryOptionA(hor,INTERNET_OPTION_URL,buffer,&length);
trace("Option 0x22 -> %li %s\n",rc,buffer);
trace("Option 0x22 -> %i %s\n",rc,buffer);
length = 4000;
rc = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length,0x0);
buffer[length]=0;
trace("Option 0x16 -> %li %s\n",rc,buffer);
trace("Option 0x16 -> %i %s\n",rc,buffer);
length = 4000;
rc = InternetQueryOptionA(hor,INTERNET_OPTION_URL,buffer,&length);
buffer[length]=0;
trace("Option 0x22 -> %li %s\n",rc,buffer);
trace("Option 0x22 -> %i %s\n",rc,buffer);
length = 16;
rc = HttpQueryInfoA(hor,HTTP_QUERY_CONTENT_LENGTH,&buffer,&length,0x0);
trace("Option 0x5 -> %li %s (%li)\n",rc,buffer,GetLastError());
trace("Option 0x5 -> %i %s (%i)\n",rc,buffer,GetLastError());
length = 100;
rc = HttpQueryInfoA(hor,HTTP_QUERY_CONTENT_TYPE,buffer,&length,0x0);
buffer[length]=0;
trace("Option 0x1 -> %li %s\n",rc,buffer);
trace("Option 0x1 -> %i %s\n",rc,buffer);
SetLastError(0xdeadbeef);
rc = InternetReadFile(NULL, buffer, 100, &length);
ok(!rc, "InternetReadFile should have failed\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"InternetReadFile should have set last error to ERROR_INVALID_HANDLE instead of %ld\n",
"InternetReadFile should have set last error to ERROR_INVALID_HANDLE instead of %d\n",
GetLastError());
length = 100;
......@@ -269,7 +269,7 @@ static void InternetReadFile_test(int flags)
buffer[length]=0;
trace("ReadFile -> %li %li\n",rc,length);
trace("ReadFile -> %i %i\n",rc,length);
HeapFree(GetProcessHeap(),0,buffer);
}
......@@ -283,7 +283,7 @@ abort:
rc = InternetCloseHandle(hor);
ok ((rc == 0), "Double close of handle opened by HttpOpenRequestA succeeded\n");
ok (GetLastError() == ERROR_INVALID_HANDLE,
"Double close of handle should have set ERROR_INVALID_HANDLE instead of %ld\n",
"Double close of handle should have set ERROR_INVALID_HANDLE instead of %d\n",
GetLastError());
}
if (hic != 0x0) {
......@@ -313,7 +313,7 @@ static void InternetReadFileExA_test(int flags)
trace("InternetOpenA <--\n");
hi = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, flags);
ok((hi != 0x0),"InternetOpen failed with error %ld\n", GetLastError());
ok((hi != 0x0),"InternetOpen failed with error %d\n", GetLastError());
trace("InternetOpenA -->\n");
if (hi == 0x0) goto abort;
......@@ -323,7 +323,7 @@ static void InternetReadFileExA_test(int flags)
trace("InternetConnectA <--\n");
hic=InternetConnectA(hi, "www.winehq.org", INTERNET_INVALID_PORT_NUMBER,
NULL, NULL, INTERNET_SERVICE_HTTP, 0x0, 0xdeadbeef);
ok((hic != 0x0),"InternetConnect failed with error %ld\n", GetLastError());
ok((hic != 0x0),"InternetConnect failed with error %d\n", GetLastError());
trace("InternetConnectA -->\n");
if (hic == 0x0) goto abort;
......@@ -340,7 +340,7 @@ static void InternetReadFileExA_test(int flags)
* abort.
*/
} else {
ok((hor != 0x0),"HttpOpenRequest failed with error %ld\n", GetLastError());
ok((hor != 0x0),"HttpOpenRequest failed with error %d\n", GetLastError());
}
trace("HttpOpenRequestA -->\n");
......@@ -354,7 +354,7 @@ static void InternetReadFileExA_test(int flags)
"Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n");
else
ok((rc != 0) || GetLastError() == ERROR_INTERNET_NAME_NOT_RESOLVED,
"Synchronous HttpSendRequest returning 0, error %ld\n", GetLastError());
"Synchronous HttpSendRequest returning 0, error %d\n", GetLastError());
trace("HttpSendRequestA <--\n");
if (!rc && (GetLastError() == ERROR_IO_PENDING))
......@@ -370,7 +370,7 @@ static void InternetReadFileExA_test(int flags)
inetbuffers.dwOffsetLow = 5678;
rc = InternetReadFileEx(hor, &inetbuffers, 0, 0xdeadcafe);
ok(!rc && (GetLastError() == ERROR_INVALID_PARAMETER),
"InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %ld\n",
"InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %d\n",
rc ? "TRUE" : "FALSE", GetLastError());
HeapFree(GetProcessHeap(), 0, inetbuffers.lpvBuffer);
......@@ -383,11 +383,11 @@ static void InternetReadFileExA_test(int flags)
inetbuffers.dwOffsetHigh = 1234;
inetbuffers.dwOffsetLow = 5678;
rc = InternetReadFileEx(hor, &inetbuffers, 0, 0xdeadcafe);
ok(rc, "InternetReadFileEx failed with error %ld\n", GetLastError());
ok(rc, "InternetReadFileEx failed with error %d\n", GetLastError());
rc = InternetReadFileEx(NULL, &inetbuffers, 0, 0xdeadcafe);
ok(!rc && (GetLastError() == ERROR_INVALID_HANDLE),
"InternetReadFileEx should have failed with ERROR_INVALID_HANDLE instead of %s, %ld\n",
"InternetReadFileEx should have failed with ERROR_INVALID_HANDLE instead of %s, %d\n",
rc ? "TRUE" : "FALSE", GetLastError());
length = 0;
......@@ -411,18 +411,18 @@ static void InternetReadFileExA_test(int flags)
}
else
{
trace("InternetReadFileEx -> FAILED %ld\n", GetLastError());
trace("InternetReadFileEx -> FAILED %d\n", GetLastError());
break;
}
}
else
trace("InternetReadFileEx -> SUCCEEDED\n");
trace("read %li bytes\n", inetbuffers.dwBufferLength);
trace("read %i bytes\n", inetbuffers.dwBufferLength);
((char *)inetbuffers.lpvBuffer)[inetbuffers.dwBufferLength] = '\0';
ok(inetbuffers.dwOffsetHigh == 1234 && inetbuffers.dwOffsetLow == 5678,
"InternetReadFileEx sets offsets to 0x%lx%08lx\n",
"InternetReadFileEx sets offsets to 0x%x%08x\n",
inetbuffers.dwOffsetHigh, inetbuffers.dwOffsetLow);
HeapFree(GetProcessHeap(), 0, inetbuffers.lpvBuffer);
......@@ -432,7 +432,7 @@ static void InternetReadFileExA_test(int flags)
length += inetbuffers.dwBufferLength;
}
trace("Finished. Read %ld bytes\n", length);
trace("Finished. Read %d bytes\n", length);
abort:
if (hor) {
......@@ -462,23 +462,23 @@ static void InternetOpenUrlA_test(void)
BOOL ret;
myhinternet = InternetOpen("Winetest",0,NULL,NULL,INTERNET_FLAG_NO_CACHE_WRITE);
ok((myhinternet != 0), "InternetOpen failed, error %lx\n",GetLastError());
ok((myhinternet != 0), "InternetOpen failed, error %x\n",GetLastError());
size = 0x400;
ret = InternetCanonicalizeUrl(TEST_URL, buffer, &size,ICU_BROWSER_MODE);
ok( ret, "InternetCanonicalizeUrl failed, error %lx\n",GetLastError());
ok( ret, "InternetCanonicalizeUrl failed, error %x\n",GetLastError());
SetLastError(0);
myhttp = InternetOpenUrl(myhinternet, TEST_URL, 0, 0,
INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_TRANSFER_BINARY,0);
if (GetLastError() == 12007)
return; /* WinXP returns this when not connected to the net */
ok((myhttp != 0),"InternetOpenUrl failed, error %lx\n",GetLastError());
ok((myhttp != 0),"InternetOpenUrl failed, error %x\n",GetLastError());
ret = InternetReadFile(myhttp, buffer,0x400,&readbytes);
ok( ret, "InternetReadFile failed, error %lx\n",GetLastError());
ok( ret, "InternetReadFile failed, error %x\n",GetLastError());
totalbytes += readbytes;
while (readbytes && InternetReadFile(myhttp, buffer,0x400,&readbytes))
totalbytes += readbytes;
trace("read 0x%08lx bytes\n",totalbytes);
trace("read 0x%08x bytes\n",totalbytes);
}
static void InternetTimeFromSystemTimeA_test(void)
......@@ -489,10 +489,10 @@ static void InternetTimeFromSystemTimeA_test(void)
static const char expect[] = "Fri, 07 Jan 2005 12:06:35 GMT";
ret = InternetTimeFromSystemTimeA( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
ok( ret, "InternetTimeFromSystemTimeA failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeFromSystemTimeA failed (%d)\n", GetLastError() );
ok( !memcmp( string, expect, sizeof(expect) ),
"InternetTimeFromSystemTimeA failed (%ld)\n", GetLastError() );
"InternetTimeFromSystemTimeA failed (%d)\n", GetLastError() );
}
static void InternetTimeFromSystemTimeW_test(void)
......@@ -504,10 +504,10 @@ static void InternetTimeFromSystemTimeW_test(void)
'1','2',':','0','6',':','3','5',' ','G','M','T',0 };
ret = InternetTimeFromSystemTimeW( &time, INTERNET_RFC1123_FORMAT, string, sizeof(string) );
ok( ret, "InternetTimeFromSystemTimeW failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeFromSystemTimeW failed (%d)\n", GetLastError() );
ok( !memcmp( string, expect, sizeof(expect) ),
"InternetTimeFromSystemTimeW failed (%ld)\n", GetLastError() );
"InternetTimeFromSystemTimeW failed (%d)\n", GetLastError() );
}
static void InternetTimeToSystemTimeA_test(void)
......@@ -519,14 +519,14 @@ static void InternetTimeToSystemTimeA_test(void)
static const char string2[] = " fri 7 jan 2005 12 06 35";
ret = InternetTimeToSystemTimeA( string, &time, 0 );
ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeA failed (%d)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
"InternetTimeToSystemTimeA failed (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeA( string2, &time, 0 );
ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeA failed (%d)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
"InternetTimeToSystemTimeA failed (%d)\n", GetLastError() );
}
static void InternetTimeToSystemTimeW_test(void)
......@@ -541,29 +541,29 @@ static void InternetTimeToSystemTimeW_test(void)
static const WCHAR string3[] = { 'F','r',0 };
ret = InternetTimeToSystemTimeW( NULL, NULL, 0 );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( NULL, &time, 0 );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( string, NULL, 0 );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%ld)\n", GetLastError() );
ok( !ret, "InternetTimeToSystemTimeW succeeded (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( string, &time, 1 );
ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( string, &time, 0 );
ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
"InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( string2, &time, 0 );
ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
"InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
ret = InternetTimeToSystemTimeW( string3, &time, 0 );
ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
ok( ret, "InternetTimeToSystemTimeW failed (%d)\n", GetLastError() );
}
static void HttpSendRequestEx_test(void)
......@@ -596,7 +596,7 @@ static void HttpSendRequestEx_test(void)
trace( "Network unreachable, skipping test\n" );
goto done;
}
ok( hRequest != NULL, "Failed to open request handle err %lx\n", GetLastError());
ok( hRequest != NULL, "Failed to open request handle err %x\n", GetLastError());
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS);
......@@ -611,7 +611,7 @@ static void HttpSendRequestEx_test(void)
BufferIn.dwOffsetHigh = 0;
ret = HttpSendRequestEx(hRequest, &BufferIn, NULL, 0 ,0);
ok(ret, "HttpSendRequestEx Failed with error %ld\n", GetLastError());
ok(ret, "HttpSendRequestEx Failed with error %d\n", GetLastError());
for (i = 3; szPostData[i]; i++)
ok(InternetWriteFile(hRequest, &szPostData[i], 1, &dwBytesWritten),
......@@ -623,7 +623,7 @@ static void HttpSendRequestEx_test(void)
"Unable to read response\n");
szBuffer[dwBytesRead] = 0;
ok(dwBytesRead == 13,"Read %lu bytes instead of 13\n",dwBytesRead);
ok(dwBytesRead == 13,"Read %u bytes instead of 13\n",dwBytesRead);
ok(strncmp(szBuffer,"mode => Test\n",dwBytesRead)==0,"Got string %s\n",szBuffer);
ok(InternetCloseHandle(hRequest), "Close request handle failed\n");
......
......@@ -43,9 +43,9 @@ static void InternetQueryOptionA_test(void)
len=strlen(useragent)+1;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == strlen(useragent)+1,"Got wrong user agent length %ld instead of %d\n",len,lstrlenA(useragent));
ok(len == strlen(useragent)+1,"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent));
ok(retval == 0,"Got wrong return value %d\n",retval);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%ld\n",err);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
SetLastError(0xdeadbeef);
len=strlen(useragent)+1;
......@@ -53,9 +53,9 @@ static void InternetQueryOptionA_test(void)
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,buffer,&len);
err=GetLastError();
todo_wine ok(!strcmp(useragent,buffer),"Got wrong user agent string %s instead of %s\n",buffer,useragent);
todo_wine ok(len == strlen(useragent),"Got wrong user agent length %ld instead of %d\n",len,lstrlenA(useragent));
todo_wine ok(len == strlen(useragent),"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent));
todo_wine ok(retval == 1,"Got wrong return value %d\n",retval);
ok(err == 0xdeadbeef, "Got wrong error code %ld\n",err);
ok(err == 0xdeadbeef, "Got wrong error code %d\n",err);
HeapFree(GetProcessHeap(),0,buffer);
SetLastError(0xdeadbeef);
......@@ -63,9 +63,9 @@ static void InternetQueryOptionA_test(void)
buffer=HeapAlloc(GetProcessHeap(),0,100);
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,buffer,&len);
err=GetLastError();
todo_wine ok(len == strlen(useragent) + 1,"Got wrong user agent length %ld instead of %d\n", len, lstrlenA(useragent) + 1);
todo_wine ok(len == strlen(useragent) + 1,"Got wrong user agent length %d instead of %d\n", len, lstrlenA(useragent) + 1);
ok(!retval, "Got wrong return value %d\n", retval);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %ld\n", err);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code %d\n", err);
HeapFree(GetProcessHeap(),0,buffer);
hurl = InternetConnectA(hinet,"www.winehq.com",INTERNET_DEFAULT_HTTP_PORT,NULL,NULL,INTERNET_SERVICE_HTTP,0,0);
......@@ -74,9 +74,9 @@ static void InternetQueryOptionA_test(void)
len=0;
retval = InternetQueryOptionA(hurl,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
ok(len == 0,"Got wrong user agent length %ld instead of 0\n",len);
ok(len == 0,"Got wrong user agent length %d instead of 0\n",len);
ok(retval == 0,"Got wrong return value %d\n",retval);
todo_wine ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %ld\n",err);
todo_wine ok(err == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "Got wrong error code %d\n",err);
InternetCloseHandle(hurl);
InternetCloseHandle(hinet);
......@@ -88,9 +88,9 @@ static void InternetQueryOptionA_test(void)
len=0;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
todo_wine ok(len == 1,"Got wrong user agent length %ld instead of %d\n",len,1);
todo_wine ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1);
ok(retval == 0,"Got wrong return value %d\n",retval);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%ld\n",err);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
InternetCloseHandle(hinet);
......@@ -100,9 +100,9 @@ static void InternetQueryOptionA_test(void)
len=0;
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
err=GetLastError();
todo_wine ok(len == 1,"Got wrong user agent length %ld instead of %d\n",len,1);
todo_wine ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1);
ok(retval == 0,"Got wrong return value %d\n",retval);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%ld\n",err);
todo_wine ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
InternetCloseHandle(hinet);
}
......@@ -115,7 +115,7 @@ static void test_get_cookie(void)
SetLastError(0xdeadbeef);
ret = InternetGetCookie("http://www.example.com", NULL, NULL, &len);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS,
"InternetGetCookie should have failed with %s and error %ld\n",
"InternetGetCookie should have failed with %s and error %d\n",
ret ? "TRUE" : "FALSE", GetLastError());
}
......
......@@ -112,70 +112,70 @@ static void InternetCrackUrl_test(void)
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrl(TEST_URL, 0,0,&urlComponents);
ok( ret, "InternetCrackUrl failed, error %lx\n",GetLastError());
ok( ret, "InternetCrackUrl failed, error %x\n",GetLastError());
ok((strcmp(TEST_URL_PATH,path) == 0),"path cracked wrong\n");
/* Bug 1805: Confirm the returned lengths are correct: */
/* 1. When extra info split out explicitly */
zero_compsA(&urlComponents, 0, 1, 0, 0, 1, 1);
ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed, error 0x%lx\n", GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATH),".dwUrlPathLength should be %ld, but is %ld\n", (DWORD)strlen(TEST_URL2_PATH), urlComponents.dwUrlPathLength);
ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed, error 0x%x\n", GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATH),".dwUrlPathLength should be %d, but is %d\n", (DWORD)strlen(TEST_URL2_PATH), urlComponents.dwUrlPathLength);
ok(!strncmp(urlComponents.lpszUrlPath,TEST_URL2_PATH,strlen(TEST_URL2_PATH)),"lpszUrlPath should be %s but is %s\n", TEST_URL2_PATH, urlComponents.lpszUrlPath);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %ld, but is %ld\n", (DWORD)strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %d, but is %d\n", (DWORD)strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName);
ok(urlComponents.dwExtraInfoLength == strlen(TEST_URL2_EXTRA),".dwExtraInfoLength should be %ld, but is %ld\n", (DWORD)strlen(TEST_URL2_EXTRA), urlComponents.dwExtraInfoLength);
ok(urlComponents.dwExtraInfoLength == strlen(TEST_URL2_EXTRA),".dwExtraInfoLength should be %d, but is %d\n", (DWORD)strlen(TEST_URL2_EXTRA), urlComponents.dwExtraInfoLength);
ok(!strncmp(urlComponents.lpszExtraInfo,TEST_URL2_EXTRA,strlen(TEST_URL2_EXTRA)),"lpszExtraInfo should be %s but is %s\n", TEST_URL2_EXTRA, urlComponents.lpszHostName);
/* 2. When extra info is not split out explicitly and is in url path */
zero_compsA(&urlComponents, 0, 1, 0, 0, 1, 0);
ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATHEXTRA),".dwUrlPathLength should be %ld, but is %ld\n", (DWORD)strlen(TEST_URL2_PATHEXTRA), urlComponents.dwUrlPathLength);
ok(InternetCrackUrlA(TEST_URL2, 0, 0, &urlComponents),"InternetCrackUrl failed with GLE 0x%x\n",GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL2_PATHEXTRA),".dwUrlPathLength should be %d, but is %d\n", (DWORD)strlen(TEST_URL2_PATHEXTRA), urlComponents.dwUrlPathLength);
ok(!strncmp(urlComponents.lpszUrlPath,TEST_URL2_PATHEXTRA,strlen(TEST_URL2_PATHEXTRA)),"lpszUrlPath should be %s but is %s\n", TEST_URL2_PATHEXTRA, urlComponents.lpszUrlPath);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %ld, but is %ld\n", (DWORD)strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL2_SERVER),".dwHostNameLength should be %d, but is %d\n", (DWORD)strlen(TEST_URL2_SERVER), urlComponents.dwHostNameLength);
ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName);
ok(urlComponents.nPort == INTERNET_DEFAULT_HTTP_PORT,"urlComponents->nPort should have been 80 instead of %d\n", urlComponents.nPort);
ok(urlComponents.nScheme == INTERNET_SCHEME_HTTP,"urlComponents->nScheme should have been INTERNET_SCHEME_HTTP instead of %d\n", urlComponents.nScheme);
zero_compsA(&urlComponents, 1, 1, 1, 1, 1, 1);
ok(InternetCrackUrlA(TEST_URL, strlen(TEST_URL), 0, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL_PATH),".dwUrlPathLength should be %d, but is %ld\n", lstrlenA(TEST_URL_PATH), urlComponents.dwUrlPathLength);
ok(InternetCrackUrlA(TEST_URL, strlen(TEST_URL), 0, &urlComponents),"InternetCrackUrl failed with GLE 0x%x\n",GetLastError());
ok(urlComponents.dwUrlPathLength == strlen(TEST_URL_PATH),".dwUrlPathLength should be %d, but is %d\n", lstrlenA(TEST_URL_PATH), urlComponents.dwUrlPathLength);
ok(!strncmp(urlComponents.lpszUrlPath,TEST_URL_PATH,strlen(TEST_URL_PATH)),"lpszUrlPath should be %s but is %s\n", TEST_URL_PATH, urlComponents.lpszUrlPath);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL_HOST),".dwHostNameLength should be %d, but is %ld\n", lstrlenA(TEST_URL_HOST), urlComponents.dwHostNameLength);
ok(urlComponents.dwHostNameLength == strlen(TEST_URL_HOST),".dwHostNameLength should be %d, but is %d\n", lstrlenA(TEST_URL_HOST), urlComponents.dwHostNameLength);
ok(!strncmp(urlComponents.lpszHostName,TEST_URL_HOST,strlen(TEST_URL_HOST)),"lpszHostName should be %s but is %s\n", TEST_URL_HOST, urlComponents.lpszHostName);
ok(urlComponents.nPort == INTERNET_DEFAULT_HTTP_PORT,"urlComponents->nPort should have been 80 instead of %d\n", urlComponents.nPort);
ok(urlComponents.nScheme == INTERNET_SCHEME_HTTP,"urlComponents->nScheme should have been INTERNET_SCHEME_HTTP instead of %d\n", urlComponents.nScheme);
ok(!urlComponents.lpszUserName, ".lpszUserName should have been set to NULL\n");
ok(!urlComponents.lpszPassword, ".lpszPassword should have been set to NULL\n");
ok(!urlComponents.lpszExtraInfo, ".lpszExtraInfo should have been set to NULL\n");
ok(!urlComponents.dwUserNameLength,".dwUserNameLength should be 0, but is %ld\n", urlComponents.dwUserNameLength);
ok(!urlComponents.dwPasswordLength,".dwPasswordLength should be 0, but is %ld\n", urlComponents.dwPasswordLength);
ok(!urlComponents.dwExtraInfoLength,".dwExtraInfoLength should be 0, but is %ld\n", urlComponents.dwExtraInfoLength);
ok(!urlComponents.dwUserNameLength,".dwUserNameLength should be 0, but is %d\n", urlComponents.dwUserNameLength);
ok(!urlComponents.dwPasswordLength,".dwPasswordLength should be 0, but is %d\n", urlComponents.dwPasswordLength);
ok(!urlComponents.dwExtraInfoLength,".dwExtraInfoLength should be 0, but is %d\n", urlComponents.dwExtraInfoLength);
/*3. Check for %20 */
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ok(InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError());
ok(InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents),"InternetCrackUrl failed with GLE 0x%x\n",GetLastError());
/* Tests for lpsz* members pointing to real strings while
* some corresponding length members are set to zero */
copy_compsA(&urlSrc, &urlComponents, 0, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ok(ret==1, "InternetCrackUrl returned %d with GLE=%d (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 0, 1024, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ok(ret==1, "InternetCrackUrl returned %d with GLE=%d (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 0, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ok(ret==1, "InternetCrackUrl returned %d with GLE=%d (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 0, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ok(ret==1, "InternetCrackUrl returned %d with GLE=%d (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 0, 1024);
......@@ -183,7 +183,7 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 0);
......@@ -191,7 +191,7 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 0, 0, 0, 0, 0, 0);
......@@ -199,12 +199,12 @@ static void InternetCrackUrl_test(void)
GLE = GetLastError();
todo_wine
ok(ret==0 && GLE==ERROR_INVALID_PARAMETER,
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_PARAMETER)\n",
"InternetCrackUrl returned %d with GLE=%d (expected to return 0 and ERROR_INVALID_PARAMETER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrl("about://host/blank", 0,0,&urlComponents);
ok(ret, "InternetCrackUrl failed with %ld\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.lpszHostName, "host"), "lpszHostName was \"%s\" instead of \"host\"\n", urlComponents.lpszHostName);
ok(!strcmp(urlComponents.lpszUrlPath, "/blank"), "lpszUrlPath was \"%s\" instead of \"/blank\"\n", urlComponents.lpszUrlPath);
......@@ -215,7 +215,7 @@ static void InternetCrackUrl_test(void)
ret = InternetCrackUrl(NULL, 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GLE);
ok(GLE == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GLE);
/* try an empty lpszUrl, GetLastError returns 12006, whatever that means
* we just need to fail and not return success
......@@ -341,7 +341,7 @@ static void InternetCrackUrlW_test(void)
todo_wine {
ok(!r, "InternetCrackUrl should have failed\n");
ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME,
"InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %ld\n",
"InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %d\n",
GetLastError());
}
}
......@@ -395,8 +395,8 @@ static void InternetCreateUrlA_test(void)
SetLastError(0xdeadbeef);
ok(!ret, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == -1, "Expected len -1, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == -1, "Expected len -1, got %d\n", len);
/* test zero'ed lpUrlComponents */
ZeroMemory(&urlComp, sizeof(URL_COMPONENTS));
......@@ -404,8 +404,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == -1, "Expected len -1, got %ld\n", len);
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == -1, "Expected len -1, got %d\n", len);
/* test valid lpUrlComponets, NULL lpdwUrlLength */
fill_url_components(&urlComp);
......@@ -413,8 +413,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, NULL);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == -1, "Expected len -1, got %ld\n", len);
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == -1, "Expected len -1, got %d\n", len);
/* test valid lpUrlComponets, emptry szUrl
* lpdwUrlLength is size of buffer required on exit, including
......@@ -424,8 +424,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
/* test correct size, NULL szUrl */
fill_url_components(&urlComp);
......@@ -433,8 +433,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, NULL, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
/* test valid lpUrlComponets, alloced szUrl, small size */
SetLastError(0xdeadbeef);
......@@ -443,8 +443,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
ok(len == 51, "Expected len 51, got %ld\n", len);
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(len == 51, "Expected len 51, got %d\n", len);
/* alloced szUrl, NULL lpszScheme
* shows that it uses nScheme instead
......@@ -454,8 +454,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
/* alloced szUrl, invalid nScheme
......@@ -468,8 +468,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
/* test valid lpUrlComponets, alloced szUrl */
fill_url_components(&urlComp);
......@@ -478,8 +478,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
ok(strstr(szUrl, "80") == NULL, "Didn't expect to find 80 in szUrl\n");
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
......@@ -491,8 +491,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 41, "Expected len 41, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 41, "Expected len 41, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL2), "Expected %s, got %s\n", CREATE_URL2, szUrl);
/* valid username, empty password */
......@@ -503,8 +503,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL3), "Expected %s, got %s\n", CREATE_URL3, szUrl);
/* valid password, NULL username
......@@ -517,8 +517,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
ok(len == 42, "Expected len 42, got %ld\n", len);
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(len == 42, "Expected len 42, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL3), "Expected %s, got %s\n", CREATE_URL3, szUrl);
/* valid password, empty username
......@@ -531,8 +531,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL5), "Expected %s, got %s\n", CREATE_URL5, szUrl);
/* NULL username, NULL password */
......@@ -544,8 +544,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 32, "Expected len 32, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 32, "Expected len 32, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL4), "Expected %s, got %s\n", CREATE_URL4, szUrl);
/* empty username, empty password */
......@@ -557,8 +557,8 @@ static void InternetCreateUrlA_test(void)
ret = InternetCreateUrlA(&urlComp, 0, szUrl, &len);
ok(ret, "Expected success\n");
ok(GetLastError() == 0xdeadbeef,
"Expected 0xdeadbeef, got %ld\n", GetLastError());
ok(len == 50, "Expected len 50, got %ld\n", len);
"Expected 0xdeadbeef, got %d\n", GetLastError());
ok(len == 50, "Expected len 50, got %d\n", len);
ok(!strcmp(szUrl, CREATE_URL5), "Expected %s, got %s\n", CREATE_URL5, szUrl);
/* shows that nScheme is ignored, as the appearance of the port number
......@@ -572,7 +572,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL6), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL6) + 1, len);
ok(len == strlen(CREATE_URL6), "Expected len %d, got %d\n", lstrlenA(CREATE_URL6) + 1, len);
ok(!strcmp(szUrl, CREATE_URL6), "Expected %s, got %s\n", CREATE_URL6, szUrl);
/* if lpszScheme != "http" or nPort != 80, display nPort */
......@@ -583,7 +583,7 @@ static void InternetCreateUrlA_test(void)
szUrl = HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == 53, "Expected len 53, got %ld\n", len);
ok(len == 53, "Expected len 53, got %d\n", len);
ok(strstr(szUrl, "42") != NULL, "Expected to find 42 in szUrl\n");
ok(!strcmp(szUrl, CREATE_URL7), "Expected %s, got %s\n", CREATE_URL7, szUrl);
......@@ -609,7 +609,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL1), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL1), len);
ok(len == strlen(CREATE_URL1), "Expected len %d, got %d\n", lstrlenA(CREATE_URL1), len);
ok(!strcmp(szUrl, CREATE_URL1), "Expected %s, got %s\n", CREATE_URL1, szUrl);
memset(&urlComp, 0, sizeof(urlComp));
......@@ -632,7 +632,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL8), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL8), len);
ok(len == strlen(CREATE_URL8), "Expected len %d, got %d\n", lstrlenA(CREATE_URL8), len);
ok(!strcmp(szUrl, CREATE_URL8), "Expected %s, got %s\n", CREATE_URL8, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -648,7 +648,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL9), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL9), len);
ok(len == strlen(CREATE_URL9), "Expected len %d, got %d\n", lstrlenA(CREATE_URL9), len);
ok(!strcmp(szUrl, CREATE_URL9), "Expected %s, got %s\n", CREATE_URL9, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -663,7 +663,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL10), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL10), len);
ok(len == strlen(CREATE_URL10), "Expected len %d, got %d\n", lstrlenA(CREATE_URL10), len);
ok(!strcmp(szUrl, CREATE_URL10), "Expected %s, got %s\n", CREATE_URL10, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -676,7 +676,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL11), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL11), len);
ok(len == strlen(CREATE_URL11), "Expected len %d, got %d\n", lstrlenA(CREATE_URL11), len);
ok(!strcmp(szUrl, CREATE_URL11), "Expected %s, got %s\n", CREATE_URL11, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......@@ -693,7 +693,7 @@ static void InternetCreateUrlA_test(void)
szUrl = (char *)HeapAlloc(GetProcessHeap(), 0, ++len);
ret = InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len);
ok(ret, "Expected success\n");
ok(len == strlen(CREATE_URL12), "Expected len %d, got %ld\n", lstrlenA(CREATE_URL12), len);
ok(len == strlen(CREATE_URL12), "Expected len %d, got %d\n", lstrlenA(CREATE_URL12), len);
ok(!strcmp(szUrl, CREATE_URL12), "Expected %s, got %s\n", CREATE_URL12, szUrl);
HeapFree(GetProcessHeap(), 0, szUrl);
......
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