Commit 90535ce9 authored by Jon Griffiths's avatar Jon Griffiths Committed by Alexandre Julliard

Various test fixes for XP/msvc.

parent 5e46d9f9
......@@ -96,8 +96,11 @@ static void test_enum_value(void)
ok( val_count == 2 || val_count == 3, "val_count set to %ld", val_count );
ok( data_count == 7, "data_count set to %ld instead of 7", data_count );
ok( type == REG_SZ, "type %ld is not REG_SZ", type );
#if 0
/* v5.1.2600.0 (XP Home) does not touch value or data in this case */
ok( !strcmp( value, "Te" ), "value set to '%s' instead of 'Te'", value );
ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'", data );
#endif
/* overflow empty name */
val_count = 0;
......@@ -111,7 +114,10 @@ static void test_enum_value(void)
ok( data_count == 7, "data_count set to %ld instead of 7", data_count );
ok( type == REG_SZ, "type %ld is not REG_SZ", type );
ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'", value );
#if 0
/* v5.1.2600.0 (XP Home) does not touch data in this case */
ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'", data );
#endif
/* overflow data */
val_count = 20;
......
......@@ -695,7 +695,7 @@ void test_MoveFileA(void)
WIN32_FIND_DATAA fd;
char temppath[MAX_PATH];
HANDLE hFind;
lstrcpyA(temppath, tempdir);
lstrcatA(temppath, "\\*.*");
hFind = FindFirstFileA(temppath, &fd);
......@@ -902,11 +902,6 @@ void test_FindFirstFileA()
WIN32_FIND_DATAA search_results;
int err;
handle = FindFirstFileA("C:",&search_results);
err = GetLastError();
ok ( handle == INVALID_HANDLE_VALUE , "FindFirstFile on Root directory should Fail");
if (handle == INVALID_HANDLE_VALUE)
ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number\n");
handle = FindFirstFileA("C:\\",&search_results);
err = GetLastError();
ok ( handle == INVALID_HANDLE_VALUE , "FindFirstFile on Root directory should Fail");
......
......@@ -27,7 +27,7 @@ static void test_sscanf( void )
char buffer[100], buffer1[100];
char format[20];
int result, ret;
float res1= -82.6267, res2= 27.76, res11, res12;
float res1= -82.6267f, res2= 27.76f, res11, res12;
char pname[]=" St. Petersburg, Florida\n";
......
......@@ -107,7 +107,8 @@ void run_usergetinfo_tests(void)
todo_wine {
/* FIXME - Currently Wine can't verify whether the network path is good or bad */
rc=pNetUserGetInfo(sBadNetPath, sAdminUserName, 0, (LPBYTE *)&ui0);
ok(rc == ERROR_BAD_NETPATH,"Bad Network Path: rc=%ld",rc);
ok(rc == ERROR_BAD_NETPATH || rc == ERROR_NETWORK_UNREACHABLE,
"Bad Network Path: rc=%ld",rc);
}
rc=pNetUserGetInfo(sEmptyStr, sAdminUserName, 0, (LPBYTE *)&ui0);
ok(rc == ERROR_BAD_NETPATH,"Bad Network Path: rc=%ld",rc);
......
......@@ -25,7 +25,6 @@
#include "winbase.h"
#include "wingdi.h"
#include "winnls.h"
#include "ntstatus.h"
#include "winresrc.h" /* Ensure we use Unicode defns with native headers */
#include "nb30.h"
#include "lmcons.h"
......@@ -136,7 +135,8 @@ static void run_wkstatransportenum_tests(void)
/* 1st check: is param 2 (level) correct? (only if param 5 passed?) */
apiReturn = pNetWkstaTransportEnum(NULL, 1, NULL, MAX_PREFERRED_LENGTH,
NULL, &totalEntries, NULL);
ok(apiReturn == ERROR_INVALID_LEVEL, "Invalid level");
ok(apiReturn == ERROR_INVALID_LEVEL || apiReturn == ERROR_INVALID_PARAMETER,
"NetWkstaTransportEnum returned %ld", apiReturn);
/* 2nd check: is param 5 passed? (only if level passes?) */
apiReturn = pNetWkstaTransportEnum(NULL, 0, NULL, MAX_PREFERRED_LENGTH,
......@@ -146,12 +146,14 @@ static void run_wkstatransportenum_tests(void)
if (apiReturn == ERROR_NETWORK_UNREACHABLE)
return;
ok(apiReturn == STATUS_ACCESS_VIOLATION, "access violation");
ok(apiReturn == STATUS_ACCESS_VIOLATION || apiReturn == ERROR_INVALID_PARAMETER,
"NetWkstaTransportEnum returned %ld", apiReturn);
/* 3rd check: is param 3 passed? */
apiReturn = pNetWkstaTransportEnum(NULL, 0, NULL, MAX_PREFERRED_LENGTH,
NULL, NULL, NULL);
ok(apiReturn == STATUS_ACCESS_VIOLATION, "STATUS_ACCESS_VIOLATION");
ok(apiReturn == STATUS_ACCESS_VIOLATION || apiReturn == ERROR_INVALID_PARAMETER,
"NetWkstaTransportEnum returned %ld", apiReturn);
/* 4th check: is param 6 passed? */
apiReturn = pNetWkstaTransportEnum(NULL, 0, &bufPtr, MAX_PREFERRED_LENGTH,
......@@ -161,7 +163,8 @@ static void run_wkstatransportenum_tests(void)
/* final check: valid return, actually get data back */
apiReturn = pNetWkstaTransportEnum(NULL, 0, &bufPtr, MAX_PREFERRED_LENGTH,
&entriesRead, &totalEntries, NULL);
ok(apiReturn == NERR_Success, "NetWkstaTransportEnum is successful");
ok(apiReturn == NERR_Success || apiReturn == ERROR_NETWORK_UNREACHABLE,
"NetWkstaTransportEnum returned %ld", apiReturn);
if (apiReturn == NERR_Success) {
/* WKSTA_TRANSPORT_INFO_0 *transports = (WKSTA_TRANSPORT_INFO_0 *)bufPtr; */
......
......@@ -434,7 +434,7 @@ static void test_RtlDuplicateUnicodeString(void)
dest_ansi_str.Length = dest_str.Length / sizeof(WCHAR);
dest_ansi_str.MaximumLength = dest_ansi_str.Length + 1;
for (pos = 0; pos < dest_ansi_str.Length; pos++) {
dest_ansi_buf[pos] = dest_buf[pos];
dest_ansi_buf[pos] = (char)dest_buf[pos];
} /* for */
dest_ansi_buf[dest_ansi_str.Length] = '\0';
dest_ansi_str.Buffer = dest_ansi_buf;
......@@ -1286,7 +1286,7 @@ static const str2int_t str2int[] = {
{ 0, "-xFEDCBA00", 0, STATUS_SUCCESS}, /* Negative Hexadecimal (x-notation) */
{ 0, "0x89abcdef", 0x89abcdef, STATUS_SUCCESS}, /* Hex with lower case digits a-f (0x-notation) */
{ 0, "0xFEDCBA00", 0xFEDCBA00, STATUS_SUCCESS}, /* Hex with upper case digits A-F (0x-notation) */
{ 0, "-0xFEDCBA00", -0xFEDCBA00, STATUS_SUCCESS}, /* Negative Hexadecimal (0x-notation) */
{ 0, "-0xFEDCBA00", 19088896, STATUS_SUCCESS}, /* Negative Hexadecimal (0x-notation) */
{ 0, "0xabcdefgh", 0xabcdef, STATUS_SUCCESS}, /* Hex with illegal lower case digits (g-z) */
{ 0, "0xABCDEFGH", 0xABCDEF, STATUS_SUCCESS}, /* Hex with illegal upper case digits (G-Z) */
{ 0, "0xF", 0xf, STATUS_SUCCESS}, /* one digit hexadecimal */
......
......@@ -299,13 +299,13 @@ static void test_CList(void)
inserted = pSHLWAPI_22(list, item->ulId);
ok(inserted != NULL, "lost after adding");
ok(!inserted || inserted->ulId != -1, "find returned a container");
ok(!inserted || inserted->ulId != ~0UL, "find returned a container");
/* Check size */
if (inserted && inserted->ulSize & 0x3)
{
/* Contained */
ok(inserted[-1].ulId == -1, "invalid size is not countained");
ok(inserted[-1].ulId == ~0UL, "invalid size is not countained");
ok(inserted[-1].ulSize > inserted->ulSize+sizeof(SHLWAPI_CLIST),
"container too small");
}
......@@ -374,7 +374,7 @@ static void test_CList(void)
inserted = (LPSHLWAPI_CLIST)buff;
inserted->ulSize = 44;
inserted->ulId = -1;
inserted->ulId = ~0UL;
hRet = pSHLWAPI_20(&list, inserted);
/* The call succeeds but the item is not inserted */
ok(hRet == S_OK, "failed adding a container");
......@@ -419,13 +419,13 @@ static void test_CList(void)
inserted = pSHLWAPI_22(list, item->ulId);
ok(inserted != NULL, "lost after adding");
ok(!inserted || inserted->ulId != -1, "find returned a container");
ok(!inserted || inserted->ulId != ~0UL, "find returned a container");
/* Check size */
if (inserted && inserted->ulSize & 0x3)
{
/* Contained */
ok(inserted[-1].ulId == -1, "invalid size is not countained");
ok(inserted[-1].ulId == ~0UL, "invalid size is not countained");
ok(inserted[-1].ulSize > inserted->ulSize+sizeof(SHLWAPI_CLIST),
"container too small");
}
......
......@@ -92,7 +92,10 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, char*
FreeWideString(wszUrl);
FreeWideString(wszConvertedPart);
ok(strcmp(szPart,szExpected)==0, "Expected %s, but got %s", szExpected, szPart);
/* Note that v6.0 and later don't return '?' with the query */
ok(strcmp(szPart,szExpected)==0 ||
(*szExpected=='?' && !strcmp(szPart,szExpected+1)),
"Expected %s, but got %s", szExpected, szPart);
}
static void test_UrlGetPart(void)
......
......@@ -125,12 +125,14 @@ void winapi_test(int flags)
if (hor == 0x0) goto abort;
trace("HttpSendRequestA -->\n");
SetLastError(0);
rc = HttpSendRequestA(hor, "", 0xffffffff,0x0,0x0);
if (flags)
ok(((rc == 0)&&(GetLastError()==997)),
"Asyncronous HttpSendRequest NOT returning 0 with error 997");
else
ok((rc != 0), "Syncronous HttpSendRequest returning 0");
ok((rc != 0) || GetLastError() == 12007, /* 12007 == XP */
"Syncronous HttpSendRequest returning 0, error %ld", GetLastError());
trace("HttpSendRequestA <--\n");
while ((flags)&&(!goon))
......@@ -233,8 +235,11 @@ void InternetOpenUrlA_test(void)
urlComponents.dwExtraInfoLength = 1024;
ok((InternetCrackUrl("http://LTspice.linear-tech.com/fieldsync2/release.log.gz", 0,0,&urlComponents)),
"InternetCrackUrl failed, error %lx\n",GetLastError());
SetLastError(0);
myhttp = InternetOpenUrl(myhinternet, "http://LTspice.linear-tech.com/fieldsync2/release.log.gz", 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(InternetReadFile(myhttp, buffer,0x400,&readbytes), "InternetReadFile failed, error %lx\n",GetLastError());
totalbytes += readbytes;
......
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