From d523c86a1b3da6e2d69a98c98587ef4f2b867133 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 20 Nov 2008 21:39:48 +0100 Subject: [PATCH] kernel32/tests: Fix test failures on Win9x and NT4. Get rid of most of the macros that make it hard to handle special cases. --- dlls/kernel32/tests/locale.c | 479 ++++++++++++++++++++++------------- 1 file changed, 302 insertions(+), 177 deletions(-) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 0077db2af71..c5f3ddb90eb 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -102,32 +102,16 @@ static void InitFunctionPointers(void) #define BUFFER_SIZE 128 #define COUNTOF(x) (sizeof(x)/sizeof(x)[0]) -#define EXPECT_LEN(len) ok(ret == (len), "Expected Len %d, got %d\n", (int)(len), ret) -#define EXPECT_INVALID ok(GetLastError() == ERROR_INVALID_PARAMETER, \ - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()) -#define EXPECT_BUFFER ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, \ - "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()) -#define EXPECT_FLAGS ok(GetLastError() == ERROR_INVALID_FLAGS, \ - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()) -#define EXPECT_INVALIDFLAGS ok(GetLastError() == ERROR_INVALID_FLAGS || \ - GetLastError() == ERROR_INVALID_PARAMETER, \ - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()) -#define EXPECT_LASTERROR_0 ok(GetLastError() == 0, \ - "Expected GetLastError() == 0, got %d\n", GetLastError()) -#define EXPECT_VALID ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()) - -#define STRINGSA(x,y) strcpy(input, x); strcpy(Expected, y); SetLastError(0); buffer[0] = '\0' -#define EXPECT_LENA EXPECT_LEN((int)strlen(Expected)+1) +#define STRINGSA(x,y) strcpy(input, x); strcpy(Expected, y); SetLastError(0xdeadbeef); buffer[0] = '\0' +#define EXPECT_LENA ok(ret == lstrlen(Expected)+1, "Expected Len %d, got %d\n", lstrlen(Expected)+1, ret) #define EXPECT_EQA ok(strncmp(buffer, Expected, strlen(Expected)) == 0, \ "Expected '%s', got '%s'\n", Expected, buffer) #define STRINGSW(x,y) MultiByteToWideChar(CP_ACP,0,x,-1,input,COUNTOF(input)); \ MultiByteToWideChar(CP_ACP,0,y,-1,Expected,COUNTOF(Expected)); \ - SetLastError(0); buffer[0] = '\0' -#define EXPECT_LENW EXPECT_LEN((int)strlenW(Expected)+1) + SetLastError(0xdeadbeef); buffer[0] = '\0' +#define EXPECT_LENW ok(ret == lstrlenW(Expected)+1, "Expected Len %d, got %d\n", lstrlenW(Expected)+1, ret) #define EXPECT_EQW ok(strncmpW(buffer, Expected, strlenW(Expected)) == 0, "Bad conversion\n") -#define EXPECT_FALSE ok(FALSE == ret, "Expected return value FALSE, got TRUE\n") -#define EXPECT_TRUE ok(FALSE != ret, "Expected return value TRUE, got FALSE\n") #define NUO LOCALE_NOUSEROVERRIDE @@ -148,12 +132,13 @@ static void test_GetLocaleInfoA(void) SetLastError(0); memset(buffer, 0, COUNTOF(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 3); - EXPECT_BUFFER; EXPECT_LEN(0); + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); ok(!strcmp(buffer, "Mon"), "Expected 'Mon', got '%s'\n", buffer); SetLastError(0); memset(buffer, 0, COUNTOF(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 10); - EXPECT_VALID; EXPECT_LEN(7); + ok(ret == 7, "Expected ret == 7, got %d, error %d\n", ret, GetLastError()); ok(!strcmp(buffer, "Monday"), "Expected 'Monday', got '%s'\n", buffer); } @@ -168,7 +153,8 @@ static void test_GetTimeFormatA(void) STRINGSA("tt HH':'mm'@'ss", ""); /* Invalid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wHour = 8; curtime.wMinute = 56; @@ -177,83 +163,104 @@ static void test_GetTimeFormatA(void) STRINGSA("tt HH':'mm'@'ss", "AM 08:56@13"); /* Valid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* MSDN: LOCALE_NOUSEROVERRIDE can't be specified with a format string */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, NUO|TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("tt HH':'mm'@'ss", "A"); /* Insufficient buffer */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("tt HH':'mm'@'ss", "AM 08:56@13"); /* Calculate length only */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, NULL, 0); - EXPECT_VALID; EXPECT_LENA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; STRINGSA("", "8 AM"); /* TIME_NOMINUTESORSECONDS, default format */ ret = GetTimeFormatA(lcid, NUO|TIME_NOMINUTESORSECONDS, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("m1s2m3s4", ""); /* TIME_NOMINUTESORSECONDS/complex format */ ret = GetTimeFormatA(lcid, TIME_NOMINUTESORSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret == strlen(buffer)+1, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "" ) || broken( !strcmp( buffer, "4" )), /* win9x */ + "Expected '', got '%s'\n", buffer ); STRINGSA("", "8:56 AM"); /* TIME_NOSECONDS/Default format */ ret = GetTimeFormatA(lcid, NUO|TIME_NOSECONDS, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "8:56 AM"); /* TIME_NOSECONDS */ strcpy(Expected, "8:56 AM"); ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h.@:m.@:s.@:tt", "8.@:56AM"); /* Multiple delimiters */ ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "8.@:56AM" ) || broken( !strcmp( buffer, "8.@:56.@:AM" )) /* win9x */, + "Expected '8.@:56AM', got '%s'\n", buffer ); STRINGSA("s1s2s3", ""); /* Duplicate tokens */ ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret == strlen(buffer)+1, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "" ) || broken( !strcmp( buffer, "3" )), /* win9x */ + "Expected '', got '%s'\n", buffer ); STRINGSA("t/tt", "A/AM"); /* AM time marker */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 13; STRINGSA("t/tt", "P/PM"); /* PM time marker */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h1t2tt3m", "156"); /* TIME_NOTIMEMARKER: removes text around time marker token */ ret = GetTimeFormatA(lcid, TIME_NOTIMEMARKER, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "13:56:13 PM"); /* TIME_FORCE24HOURFORMAT */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s", "13:56:13"); /* TIME_FORCE24HOURFORMAT doesn't add time marker */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 14; /* change this to 14 or 2pm */ curtime.wMinute = 5; curtime.wSecond = 3; STRINGSA("h hh H HH m mm s ss t tt", "2 02 14 14 5 05 3 03 P PM"); /* 24 hrs, leading 0 */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 0; STRINGSA("h/H/hh/HH", "12/0/12/00"); /* "hh" and "HH" */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "12:5:3 AM"); /* non-zero flags should fail with format, doesn't */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* try to convert formatting strings with more than two letters * "h:hh:hhh:H:HH:HHH:m:mm:mmm:M:MM:MMM:s:ss:sss:S:SS:SSS" @@ -268,55 +275,66 @@ static void test_GetTimeFormatA(void) STRINGSA("h:hh:hhh H:HH:HHH m:mm:mmm M:MM:MMM s:ss:sss S:SS:SSS", "8:08:08 8:08:08 56:56:56 M:MM:MMM 13:13:13 S:SS:SSS"); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h", "text"); /* Don't write to buffer if len is 0 */ strcpy(buffer, "text"); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, 0); - EXPECT_VALID; EXPECT_LEN(2); EXPECT_EQA; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + EXPECT_EQA; STRINGSA("h 'h' H 'H' HH 'HH' m 'm' s 's' t 't' tt 'tt'", "8 h 8 H 08 HH 56 m 13 s A t AM tt"); /* "'" preserves tokens */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'''", "'"); /* invalid quoted string */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* test that msdn suggested single quotation usage works as expected */ STRINGSA("''''", "'"); /* single quote mark */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("''HHHHHH", "08"); /* Normal use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* and test for normal use of the single quotation mark */ STRINGSA("'''HHHHHH'", "'HHHHHH"); /* Normal use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'''HHHHHH", "'HHHHHH"); /* Odd use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'123'tt", ""); /* TIME_NOTIMEMARKER drops literals too */ ret = GetTimeFormatA(lcid, TIME_NOTIMEMARKER, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 25; STRINGSA("'123'tt", ""); /* Invalid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wHour = 12; curtime.wMonth = 60; /* Invalid */ STRINGSA("h:m:s", "12:56:13"); /* Invalid date */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } static void test_GetDateFormatA(void) @@ -330,7 +348,8 @@ static void test_GetDateFormatA(void) STRINGSA("ddd',' MMM dd yy",""); SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wYear = 2002; curtime.wMonth = 5; @@ -338,48 +357,58 @@ static void test_GetDateFormatA(void) curtime.wDayOfWeek = 3; STRINGSA("ddd',' MMM dd yy","Sat, May 04 02"); /* Simple case */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* Same as above but with LOCALE_NOUSEROVERRIDE */ STRINGSA("ddd',' MMM dd yy",""); /* Simple case */ SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, NUO, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; STRINGSA("ddd',' MMM dd yy","Sat, May 04 02"); /* Format containing "'" */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 36; /* Invalid */ STRINGSA("ddd',' MMM dd ''''yy","Sat, May 04 '02"); /* Invalid time */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("ddd',' MMM dd ''''yy",""); /* Get size only */ ret = GetDateFormatA(lcid, 0, &curtime, input, NULL, 0); - EXPECT_VALID; EXPECT_LEN(16); EXPECT_EQA; + ok(ret == 16, "Expected ret == 16, got %d, error %d\n", ret, GetLastError()); + EXPECT_EQA; STRINGSA("ddd',' MMM dd ''''yy",""); /* Buffer too small */ SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("ddd',' MMM dd ''''yy","5/4/2002"); /* Default to DATE_SHORTDATE */ ret = GetDateFormat(lcid, NUO, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); if (strncmp(buffer, Expected, strlen(Expected)) && strncmp(buffer, "5/4/02", strlen(Expected)) != 0) ok (0, "Expected '%s' or '5/4/02', got '%s'\n", Expected, buffer); STRINGSA("ddd',' MMM dd ''''yy", "Saturday, May 04, 2002"); /* DATE_LONGDATE */ ret = GetDateFormat(lcid, NUO|DATE_LONGDATE, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* test for expected DATE_YEARMONTH behavior with null format */ /* NT4 returns ERROR_INVALID_FLAGS for DATE_YEARMONTH */ STRINGSA("ddd',' MMM dd ''''yy", ""); /* DATE_YEARMONTH */ SetLastError(0xdeadbeef); ret = GetDateFormat(lcid, NUO|DATE_YEARMONTH, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; /* Test that using invalid DATE_* flags results in the correct error */ /* and return values */ @@ -387,7 +416,9 @@ static void test_GetDateFormatA(void) SetLastError(0xdeadbeef); ret = GetDateFormat(lcid, DATE_YEARMONTH|DATE_SHORTDATE|DATE_LONGDATE, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; } static void test_GetDateFormatW(void) @@ -402,16 +433,20 @@ static void test_GetDateFormatW(void) input, buffer, COUNTOF(buffer)); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) return; - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQW; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQW; STRINGSW("",""); /* NULL buffer, len > 0 */ SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, NULL, input, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQW; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSW("",""); /* NULL buffer, len == 0 */ ret = GetDateFormatW (lcid, 0, NULL, input, NULL, 0); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; curtime.wYear = 2002; curtime.wMonth = 10; @@ -423,7 +458,8 @@ static void test_GetDateFormatW(void) curtime.wMilliseconds = 12345; STRINGSW("dddd d MMMM yyyy","Wednesday 23 October 2002"); /* Incorrect DOW and time */ ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; /* Limit tests */ @@ -438,7 +474,8 @@ static void test_GetDateFormatW(void) STRINGSW("dddd d MMMM yyyy","Monday 1 January 1601"); SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; curtime.wYear = 1600; curtime.wMonth = 12; @@ -451,7 +488,8 @@ static void test_GetDateFormatW(void) STRINGSW("dddd d MMMM yyyy","Friday 31 December 1600"); SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); } @@ -475,67 +513,82 @@ static void test_GetCurrencyFormatA(void) STRINGSA("23",""); /* NULL output, length > 0 --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("23,53",""); /* Invalid character --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("--",""); /* Double '-' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0-",""); /* Trailing '-' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0..",""); /* Double '.' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA(" 0.1",""); /* Leading space --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("1234","$"); /* Length too small --> Write up to length chars */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("2353",""); /* Format and flags given --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, NUO, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALIDFLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret, "Expected ret == 0, got %d\n", ret); + ok( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("2353",""); /* Invalid format --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("2353","$2,353.00"); /* Valid number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-2353","($2,353.00)"); /* Valid negative number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.1","$2,353.10"); /* Valid real number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.111","$2,353.11"); /* Too many DP --> Truncated */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.119","$2,353.12"); /* Too many DP --> Rounded */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 0; /* No decimal separator */ format.LeadingZero = 0; @@ -548,117 +601,140 @@ static void test_GetCurrencyFormatA(void) STRINGSA("2353","$2353"); /* No decimal or grouping chars expected */ ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 1; /* 1 DP --> Expect decimal separator */ STRINGSA("2353","$2353.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.Grouping = 2; /* Group by 100's */ STRINGSA("2353","$23,53.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.LeadingZero = 1; /* Always provide leading zero */ STRINGSA(".5","$0.5"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_RIGHT; STRINGSA("1","1.0$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_LEFT_SPACE; STRINGSA("1","$ 1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_RIGHT_SPACE; STRINGSA("1","1.0 $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 0; STRINGSA("-1","($1.0)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 1; STRINGSA("-1","-$1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 2; STRINGSA("-1","$-1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 3; STRINGSA("-1","$1.0-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 4; STRINGSA("-1","(1.0$)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 5; STRINGSA("-1","-1.0$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 6; STRINGSA("-1","1.0-$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 7; STRINGSA("-1","1.0$-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 8; STRINGSA("-1","-1.0 $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 9; STRINGSA("-1","-$ 1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 10; STRINGSA("-1","1.0 $-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 11; STRINGSA("-1","$ 1.0-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 12; STRINGSA("-1","$ -1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 13; STRINGSA("-1","1.0- $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 14; STRINGSA("-1","($ 1.0)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 15; STRINGSA("-1","(1.0 $)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } #define NEG_PARENS 0 /* "(1.1)" */ @@ -681,71 +757,87 @@ static void test_GetNumberFormatA(void) STRINGSA("23",""); /* NULL output, length > 0 --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("23,53",""); /* Invalid character --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("--",""); /* Double '-' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0-",""); /* Trailing '-' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0..",""); /* Double '.' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA(" 0.1",""); /* Leading space --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("1234","1"); /* Length too small --> Write up to length chars */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("2353",""); /* Format and flags given --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, NUO, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALIDFLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret, "Expected ret == 0, got %d\n", ret); + ok( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("2353",""); /* Invalid format --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("2353","2,353.00"); /* Valid number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-2353","-2,353.00"); /* Valid negative number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-353","-353.00"); /* test for off by one error in grouping */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.1","2,353.10"); /* Valid real number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.111","2,353.11"); /* Too many DP --> Truncated */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.119","2,353.12"); /* Too many DP --> Rounded */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 0; /* No decimal separator */ format.LeadingZero = 0; @@ -756,47 +848,56 @@ static void test_GetNumberFormatA(void) STRINGSA("2353","2353"); /* No decimal or grouping chars expected */ ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 1; /* 1 DP --> Expect decimal separator */ STRINGSA("2353","2353.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.Grouping = 2; /* Group by 100's */ STRINGSA("2353","23,53.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.LeadingZero = 1; /* Always provide leading zero */ STRINGSA(".5","0.5"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_PARENS; STRINGSA("-1","(1.0)"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_LEFT; STRINGSA("-1","-1.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_LEFT_SPACE; STRINGSA("-1","- 1.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_RIGHT; STRINGSA("-1","1.0-"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_RIGHT_SPACE; STRINGSA("-1","1.0 -"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; lcid = MAKELCID(MAKELANGID(LANG_FRENCH, SUBLANG_DEFAULT), SORT_DEFAULT); @@ -805,7 +906,8 @@ static void test_GetNumberFormatA(void) STRINGSA("-12345","-12 345,00"); /* Try French formatting */ Expected[3] = 160; /* Non breaking space */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } } @@ -855,14 +957,14 @@ static void test_CompareStringA(void) ok (ret == 0, "lstrcmpA(\"\", \"\") should return 0, got %d\n", ret); ret = lstrcmpA(NULL, NULL); - ok (ret == 0, "lstrcmpA(NULL, NULL) should return 0, got %d\n", ret); + ok (ret == 0 || broken(ret == -2) /* win9x */, "lstrcmpA(NULL, NULL) should return 0, got %d\n", ret); ret = lstrcmpA("", NULL); - ok (ret == 1, "lstrcmpA(\"\", NULL) should return 1, got %d\n", ret); + ok (ret == 1 || broken(ret == -2) /* win9x */, "lstrcmpA(\"\", NULL) should return 1, got %d\n", ret); ret = lstrcmpA(NULL, ""); - ok (ret == -1, "lstrcmpA(NULL, \"\") should return -1, got %d\n", ret); - + ok (ret == -1 || broken(ret == -2) /* win9x */, "lstrcmpA(NULL, \"\") should return -1, got %d\n", ret); + ret = CompareStringA(LOCALE_SYSTEM_DEFAULT,0,"EndDialog",-1,"_Property",-1); ok( ret == 3, "EndDialog vs _Property ... expected 3, got %d\n", ret); @@ -1523,7 +1625,7 @@ static void test_FoldStringA(void) ret = pFoldStringA(MAP_FOLDDIGITS, digits_src, -1, dst, 256); if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) return; - EXPECT_LEN(4); EXPECT_VALID; + ok(ret == 4, "Expected ret == 4, got %d, error %d\n", ret, GetLastError()); ok(strcmp(dst, digits_dst) == 0, "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", digits_dst, dst); for (i = 1; i < 256; i++) @@ -1534,7 +1636,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", src, dst); } @@ -1545,7 +1647,7 @@ static void test_FoldStringA(void) ret = pFoldStringA(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); /* NT 4.0 doesn't support MAP_EXPAND_LIGATURES */ if (!(ret == 0 && GetLastError() == ERROR_INVALID_FLAGS)) { - EXPECT_LEN(sizeof(ligatures_dst)); EXPECT_VALID; + ok(ret == sizeof(ligatures_dst), "Got %d, error %d\n", ret, GetLastError()); ok(strcmp(dst, ligatures_dst) == 0, "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst, dst); for (i = 1; i < 256; i++) @@ -1556,7 +1658,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_EXPAND_LIGATURES, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", src, dst); } @@ -1566,11 +1668,11 @@ static void test_FoldStringA(void) /* MAP_COMPOSITE */ SetLastError(0); ret = pFoldStringA(MAP_COMPOSITE, composite_src, -1, dst, 256); - EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); todo_wine { /* Wine gets close, but doesn't produce quite the same result as native */ - EXPECT_LEN(121); + ok(ret == 121, "Expected 121, got %d\n", ret); ok(strcmp(dst, composite_dst) == 0, "MAP_COMPOSITE: Expected '%s', got '%s'\n", composite_dst, dst); } @@ -1583,7 +1685,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_COMPOSITE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "0x%02x, 0x%02x,0x%02x,0x%02x,\n", (unsigned char)src[0], (unsigned char)dst[0],(unsigned char)dst[1],(unsigned char)dst[2]); @@ -1597,7 +1699,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_FOLDCZONE: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -1610,7 +1712,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_PRECOMPOSED, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_PRECOMPOSED: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -1814,28 +1916,33 @@ static void test_FoldStringW(void) skip("FoldStringW is not implemented\n"); return; } - EXPECT_LEN(0); EXPECT_FLAGS; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); } /* src & dst cannot be the same */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, -1, src, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* src can't be NULL */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, NULL, -1, dst, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* srclen can't be 0 */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, 0, dst, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* dstlen can't be < 0 */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, -1); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* Ret includes terminating NUL which is appended if srclen = -1 */ SetLastError(0); @@ -1843,7 +1950,7 @@ static void test_FoldStringW(void) src[1] = '\0'; dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == '\0', "srclen=-1: Expected ret=2 [%d,%d], got ret=%d [%d,%d], err=%d\n", 'A', '\0', ret, dst[0], dst[1], GetLastError()); @@ -1855,7 +1962,7 @@ static void test_FoldStringW(void) dst[0] = 'X'; dst[1] = 'X'; ret = pFoldStringW(MAP_FOLDCZONE, src, 1, dst, 256); - EXPECT_LEN(1); EXPECT_VALID; + ok(ret == 1, "Expected ret == 1, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == 'X', "srclen=1: Expected ret=1, [%d,%d], got ret=%d,[%d,%d], err=%d\n", 'A','X', ret, dst[0], dst[1], GetLastError()); @@ -1870,7 +1977,7 @@ static void test_FoldStringW(void) src[0] = ch; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == ch || strchrW(outOfSequenceDigits, ch) || /* Wine (correctly) maps all Unicode 4.0+ digits */ @@ -1896,9 +2003,10 @@ static void test_FoldStringW(void) src[0] = c; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok((dst[0] == '0' + ch - digitRanges[j] && dst[1] == '\0') || + broken( dst[0] == ch ) || /* old Windows versions don't have all mappings */ strchrW(noDigitAvailable, c), "MAP_FOLDDIGITS: ch %d Expected %d got %d\n", ch, '0' + digitRanges[j] - ch, dst[0]); @@ -1925,8 +2033,9 @@ static void test_FoldStringW(void) src[0] = ch; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == expected || + broken( dst[0] == ch ) || /* old Windows versions don't have all mappings */ /* Wine (correctly) uses updated mappings for some Unicode 4.0 chars */ /* FIXME: But they should be re-checked */ ch == 0xf92c || ch == 0xf979 || ch == 0xf995 || ch == 0xf9e7 || @@ -1951,7 +2060,8 @@ static void test_FoldStringW(void) ret = pFoldStringW(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); /* NT 4.0 doesn't support MAP_EXPAND_LIGATURES */ if (!(ret == 0 && GetLastError() == ERROR_INVALID_FLAGS)) { - EXPECT_LEN(sizeof(ligatures_dst)/sizeof(ligatures_dst[0])); EXPECT_VALID; + ok(ret == sizeof(ligatures_dst)/sizeof(ligatures_dst[0]), + "Got %d, error %d\n", ret, GetLastError()); ok(!memcmp(dst, ligatures_dst, sizeof(ligatures_dst)), "MAP_EXPAND_LIGATURES: Expanded incorrectly\n"); for (i = 1, failures = 0; i <= 0xffff; i++) @@ -1962,7 +2072,7 @@ static void test_FoldStringW(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringW(MAP_EXPAND_LIGATURES, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); if (ret == 3) ok(0, "MAP_EXPAND_LIGATURES: %04x : Expected %04x, got %04x %04x\n", i, src[0], dst[0], dst[1]); @@ -2058,17 +2168,18 @@ static void test_EnumSystemLanguageGroupsA(void) win_skip("EnumSystemLanguageGroupsA is not implemented\n"); return; } - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* Invalid flags */ SetLastError(0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED|LGRPID_SUPPORTED, 0); - EXPECT_FLAGS; + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); /* No flags - defaults to LGRPID_INSTALLED */ - SetLastError(0); + SetLastError(0xdeadbeef); pEnumSystemLanguageGroupsA(langgrp_procA, 0, 1); - EXPECT_LASTERROR_0; + ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED, 0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_SUPPORTED, 0); @@ -2109,22 +2220,26 @@ static void test_EnumLanguageGroupLocalesA(void) win_skip("EnumLanguageGroupLocalesA is not implemented\n"); return; } - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* lgrpid too small */ SetLastError(0); - pEnumLanguageGroupLocalesA(lgrplocale_procA, 0, 0, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, 0, 0, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* lgrpid too big */ SetLastError(0); - pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_ARMENIAN + 1, 0, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_ARMENIAN + 1, 0, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* dwFlags is reserved */ SetLastError(0); - pEnumLanguageGroupLocalesA(0, LGRPID_WESTERN_EUROPE, 0x1, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(0, LGRPID_WESTERN_EUROPE, 0x1, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_WESTERN_EUROPE, 0, 0); } @@ -2137,17 +2252,20 @@ static void test_SetLocaleInfoA(void) /* Null data */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_SDATE, 0); - EXPECT_INVALID; + ok( !bRet && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* IDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_IDATE, (LPSTR)test_SetLocaleInfoA); - EXPECT_FLAGS; + ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); /* ILDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_ILDATE, (LPSTR)test_SetLocaleInfoA); - EXPECT_FLAGS; + ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); } static BOOL CALLBACK luilocale_proc1A(LPSTR value, LONG_PTR lParam) @@ -2184,24 +2302,29 @@ static void test_EnumUILanguageA(void) win_skip("EnumUILanguagesA is not implemented\n"); return; } - EXPECT_TRUE; EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); enumCount = 0; SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc2A, 0, 0); - EXPECT_TRUE; EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0, 0); - EXPECT_FALSE; EXPECT_INVALID; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc3A, 0x5a5a5a5a, 0); - EXPECT_FALSE; EXPECT_FLAGS; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0x5a5a5a5a, 0); - EXPECT_FALSE; EXPECT_INVALID; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); } static char date_fmt_buf[1024]; @@ -2294,7 +2417,8 @@ static void test_EnumDateFormatsA(void) if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SYEARMONTH, buf, sizeof(buf)); ok(ret, "GetLocaleInfoA(LOCALE_SYEARMONTH) error %d\n", GetLastError()); - ok(!lstrcmpA(date_fmt_buf, buf), "expected \"%s\" got \"%s\"\n", date_fmt_buf, buf); + ok(!lstrcmpA(date_fmt_buf, buf) || broken(!buf[0]) /* win9x */, + "expected \"%s\" got \"%s\"\n", date_fmt_buf, buf); } static void test_EnumTimeFormatsA(void) @@ -2366,7 +2490,8 @@ static void test_GetCPInfo(void) ok(cpinfo.DefaultChar[1] == 0, "expected 0, got 0x%x\n", cpinfo.DefaultChar[1]); ok(cpinfo.LeadByte[0] == 0, "expected 0, got 0x%x\n", cpinfo.LeadByte[0]); ok(cpinfo.LeadByte[1] == 0, "expected 0, got 0x%x\n", cpinfo.LeadByte[1]); - ok(cpinfo.MaxCharSize == 4, "expected 4, got 0x%x\n", cpinfo.MaxCharSize); + ok(cpinfo.MaxCharSize == 4 || broken(cpinfo.MaxCharSize == 3) /* win9x */, + "expected 4, got %u\n", cpinfo.MaxCharSize); } }