Various test fixes for XP/msvc.

This commit is contained in:
Jon Griffiths 2003-09-25 20:29:40 +00:00 committed by Alexandre Julliard
parent 5e46d9f9d7
commit 90535ce905
10 changed files with 95 additions and 81 deletions

View File

@ -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;

View File

@ -23,12 +23,12 @@
#include <stdio.h>
/* DEFAULT_ATTRIB is used for all initial filling of the console.
* all modifications are made with TEST_ATTRIB so that we could check
* what has to be modified or not
* all modifications are made with TEST_ATTRIB so that we could check
* what has to be modified or not
*/
#define TEST_ATTRIB (BACKGROUND_BLUE | FOREGROUND_GREEN)
#define DEFAULT_ATTRIB (FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED)
/* when filling the screen with non-blank chars, this macro defines
/* when filling the screen with non-blank chars, this macro defines
* what character should be at position 'c'
*/
#define CONTENT(c) ('A' + (((c).Y * 17 + (c).X) % 23))
@ -56,7 +56,7 @@ static void resetContent(HANDLE hCon, COORD sbSize, BOOL content)
WORD attr = DEFAULT_ATTRIB;
char ch;
DWORD len;
for (c.X = 0; c.X < sbSize.X; c.X++)
{
for (c.Y = 0; c.Y < sbSize.Y; c.Y++)
@ -71,26 +71,27 @@ static void resetContent(HANDLE hCon, COORD sbSize, BOOL content)
static void testCursor(HANDLE hCon, COORD sbSize)
{
COORD c;
c.X = c.Y = 0;
ok(SetConsoleCursorPosition(0, c) == 0, "No handle");
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError: expecting %u got %lu",
ERROR_INVALID_HANDLE, GetLastError());
c.X = c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left");
okCURSOR(hCon, c);
c.X = sbSize.X - 1;
c.Y = sbSize.Y - 1;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in lower-right");
okCURSOR(hCon, c);
c.X = sbSize.X;
c.Y = sbSize.Y - 1;
ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %lu",
ERROR_INVALID_PARAMETER, GetLastError());
c.X = sbSize.X - 1;
c.Y = sbSize.Y;
ok(SetConsoleCursorPosition(hCon, c) == 0, "Cursor is outside");
@ -115,19 +116,19 @@ static void testWriteSimple(HANDLE hCon, COORD sbSize)
COORD c;
DWORD len;
const char* mytest = "abcdefg";
const size_t mylen = strlen(mytest);
const int mylen = strlen(mytest);
/* single line write */
c.X = c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (c.X = 0; c.X < mylen; c.X++)
{
okCHAR(hCon, c, mytest[c.X], TEST_ATTRIB);
}
okCURSOR(hCon, c);
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
}
@ -137,16 +138,16 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize)
COORD c;
DWORD len, mode;
const char* mytest = "abcd\nf\tg";
const size_t mylen = strlen(mytest);
const int mylen = strlen(mytest);
int p;
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, mode & ~(ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT)),
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, mode & ~(ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT)),
"clearing wrap at EOL & processed output");
/* write line, wrapping disabled, buffer exceeds sb width */
c.X = sbSize.X - 3; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (p = mylen - 3; p < mylen; p++)
@ -157,15 +158,15 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize)
c.X = 0; c.Y = 1;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
p = sbSize.X - 3 + mylen % 3;
c.X = p; c.Y = 0;
okCURSOR(hCon, c);
/* write line, wrapping disabled, strings end on end of line */
c.X = sbSize.X - mylen; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (p = 0; p < mylen; p++)
@ -173,10 +174,10 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize)
c.X = sbSize.X - mylen + p;
okCHAR(hCon, c, mytest[p], TEST_ATTRIB);
}
c.X = 0; c.Y = 1;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
p = sbSize.X - mylen;
c.X = p; c.Y = 0;
okCURSOR(hCon, c);
@ -187,17 +188,17 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
COORD c;
DWORD len, mode;
const char* mytest = "abcd\nf\tg";
const size_t mylen = strlen(mytest);
const size_t mylen2 = strchr(mytest, '\n') - mytest;
const int mylen = strlen(mytest);
const int mylen2 = strchr(mytest, '\n') - mytest;
int p;
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, (mode | ENABLE_PROCESSED_OUTPUT) & ~ENABLE_WRAP_AT_EOL_OUTPUT),
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, (mode | ENABLE_PROCESSED_OUTPUT) & ~ENABLE_WRAP_AT_EOL_OUTPUT),
"clearing wrap at EOL & setting processed output");
/* write line, wrapping disabled, buffer exceeds sb width */
c.X = sbSize.X - 5; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-5");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (c.X = sbSize.X - 5; c.X < sbSize.X - 1; c.X++)
@ -205,7 +206,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
okCHAR(hCon, c, mytest[c.X - sbSize.X + 5], TEST_ATTRIB);
}
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
c.X = 0; c.Y++;
okCHAR(hCon, c, mytest[5], TEST_ATTRIB);
for (c.X = 1; c.X < 8; c.X++)
@ -213,13 +214,13 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
okCHAR(hCon, c, mytest[7], TEST_ATTRIB);
c.X++;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
okCURSOR(hCon, c);
/* write line, wrapping disabled, strings end on end of line */
c.X = sbSize.X - 4; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-4");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (c.X = sbSize.X - 4; c.X < sbSize.X; c.X++)
@ -233,13 +234,13 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
okCHAR(hCon, c, mytest[7], TEST_ATTRIB);
c.X++;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
okCURSOR(hCon, c);
/* write line, wrapping disabled, strings end after end of line */
c.X = sbSize.X - 3; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-4");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (p = mylen2 - 3; p < mylen2; p++)
@ -254,7 +255,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
okCHAR(hCon, c, mytest[7], TEST_ATTRIB);
c.X++;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
okCURSOR(hCon, c);
}
@ -263,16 +264,16 @@ static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize)
COORD c;
DWORD len, mode;
const char* mytest = "abcd\nf\tg";
const size_t mylen = strlen(mytest);
const int mylen = strlen(mytest);
int p;
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon,(mode | ENABLE_WRAP_AT_EOL_OUTPUT) & ~(ENABLE_PROCESSED_OUTPUT)),
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon,(mode | ENABLE_WRAP_AT_EOL_OUTPUT) & ~(ENABLE_PROCESSED_OUTPUT)),
"setting wrap at EOL & clearing processed output");
/* write line, wrapping enabled, buffer doesn't exceed sb width */
c.X = sbSize.X - 9; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-9");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (p = 0; p < mylen; p++)
@ -284,11 +285,11 @@ static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize)
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
c.X = 0; c.Y = 1;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
/* write line, wrapping enabled, buffer does exceed sb width */
c.X = sbSize.X - 3; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
c.Y = 0;
for (p = 0; p < 3; p++)
@ -296,7 +297,7 @@ static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize)
c.X = sbSize.X - 3 + p;
okCHAR(hCon, c, mytest[p], TEST_ATTRIB);
}
c.Y = 1;
for (p = 0; p < mylen - 3; p++)
{
@ -305,7 +306,7 @@ static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize)
}
c.X = mylen - 3;
okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
okCURSOR(hCon, c);
}
@ -314,16 +315,16 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
COORD c;
DWORD len, mode;
const char* mytest = "abcd\nf\tg";
const size_t mylen = strlen(mytest);
const int mylen = strlen(mytest);
int p;
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, mode | (ENABLE_WRAP_AT_EOL_OUTPUT|ENABLE_PROCESSED_OUTPUT)),
ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, mode | (ENABLE_WRAP_AT_EOL_OUTPUT|ENABLE_PROCESSED_OUTPUT)),
"setting wrap at EOL & processed output");
/* write line, wrapping enabled, buffer doesn't exceed sb width */
c.X = sbSize.X - 9; c.Y = 0;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-9");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
for (p = 0; p < 4; p++)
{
@ -344,7 +345,7 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
/* write line, wrapping enabled, buffer does exceed sb width */
c.X = sbSize.X - 3; c.Y = 2;
ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3");
ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole");
for (p = 0; p < 3; p++)
{
@ -394,7 +395,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
/* no clipping, src & dst rect don't overlap */
resetContent(hCon, sbSize, TRUE);
#define IN_SRECT(r,c) ((r).Left <= (c).X && (c).X <= (r).Right && (r).Top <= (c).Y && (c).Y <= (r).Bottom)
#define IN_SRECT2(r,d,c) ((d).X <= (c).X && (c).X <= (d).X + (r).Right - (r).Left && (d).Y <= (c).Y && (c).Y <= (d).Y + (r).Bottom - (r).Top)
@ -424,7 +425,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
tc.Y = c.Y - dst.Y;
okCHAR(hCon, c, CONTENT(tc), DEFAULT_ATTRIB);
}
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
okCHAR(hCon, c, '#', TEST_ATTRIB);
else okCHAR(hCon, c, CONTENT(c), DEFAULT_ATTRIB);
}
@ -466,7 +467,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
/* clipping, src & dst rect don't overlap */
resetContent(hCon, sbSize, TRUE);
scroll.Left = 0;
scroll.Right = W - 1;
scroll.Top = 0;
@ -493,7 +494,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
tc.Y = c.Y - dst.Y;
okCHAR(hCon, c, CONTENT(tc), DEFAULT_ATTRIB);
}
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
okCHAR(hCon, c, '#', TEST_ATTRIB);
else okCHAR(hCon, c, CONTENT(c), DEFAULT_ATTRIB);
}
@ -501,7 +502,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
/* clipping, src & dst rect do overlap */
resetContent(hCon, sbSize, TRUE);
scroll.Left = 0;
scroll.Right = W - 1;
scroll.Top = 0;
@ -528,7 +529,7 @@ static void testScroll(HANDLE hCon, COORD sbSize)
tc.Y = c.Y - dst.Y;
okCHAR(hCon, c, CONTENT(tc), DEFAULT_ATTRIB);
}
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
else if (IN_SRECT(scroll, c) && IN_SRECT(clip, c))
okCHAR(hCon, c, '#', TEST_ATTRIB);
else okCHAR(hCon, c, CONTENT(c), DEFAULT_ATTRIB);
}
@ -542,7 +543,7 @@ START_TEST(console)
BOOL ret;
CONSOLE_SCREEN_BUFFER_INFO sbi;
/* be sure we have a clean console (and that's our own)
/* be sure we have a clean console (and that's our own)
* FIXME: this will make the test fail (currently) if we don't run
* under X11
* Another solution would be to rerun the test under wineconsole with

View File

@ -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");

View File

@ -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";

View File

@ -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);

View File

@ -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; */

View File

@ -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 */

View File

@ -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");
}

View File

@ -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)

View File

@ -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;