Skip to content

Commit 748fdbc

Browse files
committed
[MSVCRT_WINETEST] Fixes for windows 2003
1 parent 063c818 commit 748fdbc

File tree

7 files changed

+48
-13
lines changed

7 files changed

+48
-13
lines changed

modules/rostests/winetests/msvcrt/cpp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,11 @@ static void test_demangle(void)
13381338

13391339
for (i = 0; i < ARRAY_SIZE(test); i++)
13401340
{
1341+
if (((i == 149) || (i == 150)) && (_winver < 0x600))
1342+
{
1343+
skip("Skipping test with i = %u, because it fails on Windows 2003\n", i);
1344+
continue;
1345+
}
13411346
name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags);
13421347
ok(name != NULL, "%u: unDName failed\n", i);
13431348
if (!name) continue;

modules/rostests/winetests/msvcrt/environ.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ static void test__wenviron(void)
233233
wchar_t ***retptr = p__p___winitenv();
234234
wchar_t *value;
235235

236-
ok( *retptr != NULL, "Expected *__p___winitenv() to be NULL\n" );
236+
skip_2k3_fail ok( *retptr != NULL, "Expected *__p___winitenv() to be NULL\n" );
237237
ok( *retptr != *p_wenviron,
238238
"Expected _wenviron to be different from __p___winitenv() %p %p\n", *retptr, *p_wenviron );
239239
/* test that w-initial env is derived from current _environ[] and not from ansi initial env */
240240
value = env_get_valueW( *retptr, L"cat" );
241-
ok( value && !wcscmp( value, L"dog" ),
241+
skip_2k3_fail ok( value && !wcscmp( value, L"dog" ),
242242
"Expecting initial env to be derived from current env (got %ls)\n", value );
243243
}
244244
_putenv("cat=");
@@ -461,7 +461,7 @@ START_TEST(environ)
461461
{
462462
ok( getenv( "__winetest_dog" ) && !strcmp( getenv( "__winetest_dog" ), "bark" ),
463463
"Couldn't find env var\n" );
464-
ok( _wgetenv( L"__winetest_\u263a" ) && !wcscmp( _wgetenv( L"__winetest_\u263a" ), L"\u03b2" ),
464+
skip_2k3_fail ok( _wgetenv( L"__winetest_\u263a" ) && !wcscmp( _wgetenv( L"__winetest_\u263a" ), L"\u03b2" ),
465465
"Couldn't find unicode env var\n" );
466466
return;
467467
}

modules/rostests/winetests/msvcrt/file.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,9 +2099,11 @@ static void test_fopen_fclose_fcloseall( void )
20992099
ret = fclose(stream3);
21002100
ok(ret == EOF, "Closing file '%s' returned %d\n", fname3, ret);
21012101
ok(errno == 0xdeadbeef, "errno = %d\n", errno);
2102+
skip_2k3_crash {
21022103
ret = fclose(NULL);
21032104
ok(ret == EOF, "Closing NULL file returned %d\n", ret);
21042105
ok(errno == EINVAL, "errno = %d\n", errno);
2106+
}
21052107

21062108
/* testing fcloseall() */
21072109
numclosed = _fcloseall();
@@ -3051,13 +3053,13 @@ static void test_ioinfo_flags(void)
30513053
info = &__pioinfo[tempfd / MSVCRT_FD_BLOCK_SIZE][tempfd % MSVCRT_FD_BLOCK_SIZE];
30523054
ok(!!info, "NULL info.\n");
30533055
ok(info->handle == handle, "Unexpected handle %p, expected %p.\n", info->handle, handle);
3054-
ok(info->exflag == (EF_UTF16 | EF_CRIT_INIT | EF_UNK_UNICODE), "Unexpected exflag %#x.\n", info->exflag);
3056+
skip_2k3_fail ok(info->exflag == (EF_UTF16 | EF_CRIT_INIT | EF_UNK_UNICODE), "Unexpected exflag %#x.\n", info->exflag);
30553057
ok(info->wxflag == (WX_TEXT | WX_OPEN), "Unexpected wxflag %#x.\n", info->wxflag);
30563058

30573059
close(tempfd);
30583060

30593061
ok(info->handle == INVALID_HANDLE_VALUE, "Unexpected handle %p.\n", info->handle);
3060-
ok(info->exflag == (EF_UTF16 | EF_CRIT_INIT | EF_UNK_UNICODE), "Unexpected exflag %#x.\n", info->exflag);
3062+
skip_2k3_fail ok(info->exflag == (EF_UTF16 | EF_CRIT_INIT | EF_UNK_UNICODE), "Unexpected exflag %#x.\n", info->exflag);
30613063
ok(!info->wxflag, "Unexpected wxflag %#x.\n", info->wxflag);
30623064

30633065
info = &__pioinfo[(tempfd + 4) / MSVCRT_FD_BLOCK_SIZE][(tempfd + 4) % MSVCRT_FD_BLOCK_SIZE];

modules/rostests/winetests/msvcrt/printf.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,11 @@ static void test_xcvt(void)
723723
ok( decpt == test_cvt_testcases[i].expdecpt_e,
724724
"%d) _ecvt() decimal point wrong, got %d expected %d\n", i, decpt,
725725
test_cvt_testcases[i].expdecpt_e);
726+
if (((i == 10) || (i == 11) || (i == 12)) && (_winver < 0x600))
727+
{
728+
skip("broken on win 2003\n");
729+
continue;
730+
}
726731
ok( sign == test_cvt_testcases[i].expsign,
727732
"%d) _ecvt() sign wrong, got %d expected %d\n", i, sign,
728733
test_cvt_testcases[i].expsign);
@@ -739,6 +744,11 @@ static void test_xcvt(void)
739744
ok( decpt == test_cvt_testcases[i].expdecpt_f,
740745
"%d) _fcvt() decimal point wrong, got %d expected %d\n", i, decpt,
741746
test_cvt_testcases[i].expdecpt_f);
747+
if (((i == 10) || (i == 11) || (i == 12)) && (_winver < 0x600))
748+
{
749+
skip("broken on win 2003\n");
750+
continue;
751+
}
742752
ok( sign == test_cvt_testcases[i].expsign,
743753
"%d) _fcvt() sign wrong, got %d expected %d\n", i, sign,
744754
test_cvt_testcases[i].expsign);

modules/rostests/winetests/msvcrt/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ static void test___pxcptinfoptrs(void)
6767

6868
signal(SIGABRT, sighandler);
6969
res = raise(SIGABRT);
70-
ok(res == 0, "failed to raise SIGBREAK\n");
70+
skip_2k3_fail ok(res == 0, "failed to raise SIGBREAK\n");
7171
ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret);
7272

73-
ok(test_value == 2, "test_value = %d\n", test_value);
73+
skip_2k3_fail ok(test_value == 2, "test_value = %d\n", test_value);
7474
}
7575

7676
START_TEST(signal)

modules/rostests/winetests/msvcrt/string.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static void test_mbcp(void)
338338
expect_eq(_ismbstrail(mbsonlylead, &mbsonlylead[5]), FALSE, int, "%d");
339339

340340
/* _mbsbtype */
341-
expect_eq(_mbsbtype(NULL, 0), _MBC_ILLEGAL, int, "%d");
341+
skip_2k3_crash expect_eq(_mbsbtype(NULL, 0), _MBC_ILLEGAL, int, "%d");
342342
expect_eq(_mbsbtype(mbstring, 0), _MBC_LEAD, int, "%d");
343343
expect_eq(_mbsbtype(mbstring, 1), _MBC_TRAIL, int, "%d");
344344
expect_eq(_mbsbtype(mbstring, 2), _MBC_LEAD, int, "%d");
@@ -465,6 +465,7 @@ static void test_mbcp(void)
465465
expect_bin(buf, "\x00\xff", 2);
466466
}
467467

468+
skip_2k3_crash {
468469
errno = 0xdeadbeef;
469470
ret = _mbsncpy(NULL, mbstring, 1);
470471
ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret);
@@ -476,6 +477,7 @@ static void test_mbcp(void)
476477
ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret);
477478
ok(errno == EINVAL, "_mbsncpy returned %d\n", errno);
478479
expect_bin(buf, "\xff\xff\xff", 3);
480+
}
479481

480482
errno = 0xdeadbeef;
481483
ret = _mbsncpy(NULL, mbstring, 0);
@@ -488,6 +490,7 @@ static void test_mbcp(void)
488490
ok(ret == buf, "_mbsncpy returned %p, expected %sp\n", ret, buf);
489491
ok(errno == 0xdeadbeef, "_mbsncpy should not change errno\n");
490492

493+
skip_2k3_crash {
491494
memset(buf, 0xff, sizeof(buf));
492495
errno = 0xdeadbeef;
493496
ret = _mbsncpy(NULL, mbstring, 1);
@@ -499,6 +502,7 @@ static void test_mbcp(void)
499502
ret = _mbsncpy(buf, NULL, 1);
500503
ok(ret == NULL, "_mbsncpy returned %p, expected NULL\n", ret);
501504
ok(errno == EINVAL, "_mbsncpy returned %d\n", errno);
505+
}
502506

503507
memset(buf, 0xff, sizeof(buf));
504508
ret = _mbsncpy(NULL, mbstring, 0);
@@ -724,6 +728,7 @@ static void test_strcmp(void)
724728

725729
ret = p_strncmp( "abc", "abcd", 3 );
726730
ok( ret == 0, "wrong ret %d\n", ret );
731+
skip_2k3_fail {
727732
#ifdef _WIN64
728733
ret = p_strncmp( "", "abc", 3 );
729734
ok( ret == -1, "wrong ret %d\n", ret );
@@ -739,6 +744,7 @@ static void test_strcmp(void)
739744
ret = p_strncmp( "ab\xb0", "ab\xa0", 3 );
740745
ok( ret == 0xb0 - 0xa0, "wrong ret %d\n", ret );
741746
#endif
747+
}
742748
ret = p_strncmp( "ab\xb0", "ab\xa0", 2 );
743749
ok( ret == 0, "wrong ret %d\n", ret );
744750
ret = p_strncmp( "ab\xc2", "ab\xc2", 3 );
@@ -3389,6 +3395,7 @@ static void test_tolower(void)
33893395
ret = p_tolower((unsigned char)0xD0);
33903396
ok(ret == 0xF0, "ret = %x\n", ret);
33913397

3398+
skip_2k3_fail {
33923399
ok(setlocale(LC_ALL, "Japanese_Japan.932") != NULL, "setlocale failed.\n");
33933400
errno = 0xdeadbeef;
33943401
ret = p_tolower((signed char)0xd0);
@@ -3428,6 +3435,7 @@ static void test_tolower(void)
34283435
ret = p_tolower(0xd0);
34293436
ok(ret == 0xd0, "Got %#x.\n", ret);
34303437
ok(errno == 0xdeadbeef, "Got errno %d.\n", errno);
3438+
}
34313439

34323440
setlocale(LC_ALL, "C");
34333441
}
@@ -3578,7 +3586,7 @@ static void test__stricmp(void)
35783586
ret = _stricmp("abc\xa5\xa1", "abc");
35793587
ok(ret > 0, "_stricmp returned %d\n", ret);
35803588

3581-
ok(setlocale(LC_ALL, "Japanese_Japan.932") != NULL, "setlocale failed.\n");
3589+
skip_2k3_fail ok(setlocale(LC_ALL, "Japanese_Japan.932") != NULL, "setlocale failed.\n");
35823590
ret = _stricmp("test", "test");
35833591
ok(ret == 0, "_stricmp returned %d\n", ret);
35843592
ret = _stricmp("a", "z");
@@ -3647,6 +3655,11 @@ static void test__wcstoi64(void)
36473655

36483656
for (i = 0; i < ARRAY_SIZE(tests); i++)
36493657
{
3658+
if ((i == 20) && (_winver < 0x600))
3659+
{
3660+
skip("Skipping test with i = 20, because it fails on Windows 2003\n");
3661+
continue;
3662+
}
36503663
res = p_wcstoi64( tests[i].str, &endpos, tests[i].base );
36513664
ok( res == tests[i].res, "%u: %s res %s\n",
36523665
i, wine_dbgstr_w(tests[i].str), wine_dbgstr_longlong(res) );
@@ -4867,7 +4880,7 @@ static void test_mbsrev(void)
48674880
strcpy((char *)buf, "\x36\x8c");
48684881
ret = _mbsrev(buf);
48694882
ok(ret == buf, "ret = %p, expected %p\n", ret, buf);
4870-
ok(!memcmp(buf, "\x36", 2), "buf = %s\n", wine_dbgstr_a((char *)buf));
4883+
skip_2k3_fail ok(!memcmp(buf, "\x36", 2), "buf = %s\n", wine_dbgstr_a((char *)buf));
48714884

48724885
_setmbcp(cp);
48734886
}
@@ -4985,7 +4998,7 @@ static void test_toupper(void)
49854998
errno = 0xdeadbeef;
49864999
ret = p_toupper((signed char)0xf0);
49875000
ok(ret == 0xd0, "Got %#x.\n", ret);
4988-
ok(errno == EILSEQ, "Got errno %d.\n", errno);
5001+
skip_2k3_fail ok(errno == EILSEQ, "Got errno %d.\n", errno);
49895002
errno = 0xdeadbeef;
49905003
ret = p_toupper(0xf0);
49915004
ok(ret == 0xd0, "Got %#x.\n", ret);
@@ -4995,12 +5008,13 @@ static void test_toupper(void)
49955008
errno = 0xdeadbeef;
49965009
ret = p_toupper((signed char)0xa5);
49975010
ok(ret == 0xa5, "Got %#x.\n", ret);
4998-
ok(errno == EILSEQ, "Got errno %d.\n", errno);
5011+
skip_2k3_fail ok(errno == EILSEQ, "Got errno %d.\n", errno);
49995012
errno = 0xdeadbeef;
50005013
ret = p_toupper((signed char)0xb9);
50015014
ok(ret == 0xa5, "Got %#x.\n", ret);
5002-
ok(errno == EILSEQ, "Got errno %d.\n", errno);
5015+
skip_2k3_fail ok(errno == EILSEQ, "Got errno %d.\n", errno);
50035016

5017+
skip_2k3_fail {
50045018
ok(setlocale(LC_ALL, "Japanese_Japan.932") != NULL, "setlocale failed.\n");
50055019
errno = 0xdeadbeef;
50065020
ret = p_toupper((signed char)0xf0);
@@ -5020,6 +5034,7 @@ static void test_toupper(void)
50205034
ret = p_toupper(0xf0);
50215035
ok(ret == 0xf0, "Got %#x.\n", ret);
50225036
ok(errno == 0xdeadbeef, "Got errno %d.\n", errno);
5037+
}
50235038

50245039
setlocale(LC_ALL, "C");
50255040
}

sdk/include/reactos/wine/test.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ extern void winetest_pop_context(void);
187187
winetest_loop_nocount(); \
188188
winetest_end_nocount())
189189

190+
#define skip_2k3_crash if (_winver < 0x600) skip("Test skipped, because it crashes on win 2003\n"); else
191+
#define skip_2k3_fail if (_winver < 0x600) skip("Test skipped, because it fails on win 2003\n"); else
192+
190193
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
191194

192195
#ifdef NONAMELESSUNION

0 commit comments

Comments
 (0)