From 1fef0ce8de78a7724057547bb3c81dc3b678b988 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 6 May 2025 18:56:00 +0300 Subject: [PATCH] [MSVCRT_WINETEST] Improve msvcrt_winetest - Reduce diff to wine - Enable todo_wine --- .../rostests/winetests/msvcrt/CMakeLists.txt | 2 ++ modules/rostests/winetests/msvcrt/cpp.c | 2 ++ modules/rostests/winetests/msvcrt/file.c | 20 +++++++++---------- modules/rostests/winetests/msvcrt/misc.c | 2 ++ modules/rostests/winetests/msvcrt/printf.c | 4 ++++ modules/rostests/winetests/msvcrt/string.c | 18 ++++++++++------- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt b/modules/rostests/winetests/msvcrt/CMakeLists.txt index 8ee88854dc9..44fc2334eef 100644 --- a/modules/rostests/winetests/msvcrt/CMakeLists.txt +++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt @@ -26,6 +26,8 @@ add_executable(msvcrt_winetest target_compile_definitions(msvcrt_winetest PRIVATE WINETEST_USE_DBGSTR_LONGLONG + USE_WINE_TODOS + USE_WIN_SKIP _CRT_NONSTDC_NO_DEPRECATE _USE_MATH_DEFINES WIN32_NO_STATUS= diff --git a/modules/rostests/winetests/msvcrt/cpp.c b/modules/rostests/winetests/msvcrt/cpp.c index 2bbf34dcd01..7aea9c78479 100644 --- a/modules/rostests/winetests/msvcrt/cpp.c +++ b/modules/rostests/winetests/msvcrt/cpp.c @@ -1338,11 +1338,13 @@ static void test_demangle(void) for (i = 0; i < ARRAY_SIZE(test); i++) { +#ifdef __REACTOS__ if (((i == 149) || (i == 150)) && (_winver < 0x600)) { skip("Skipping test with i = %u, because it fails on Windows 2003\n", i); continue; } +#endif // __REACTOS__ name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags); ok(name != NULL, "%u: unDName failed\n", i); if (!name) continue; diff --git a/modules/rostests/winetests/msvcrt/file.c b/modules/rostests/winetests/msvcrt/file.c index ac02ed58859..72f615f3b51 100644 --- a/modules/rostests/winetests/msvcrt/file.c +++ b/modules/rostests/winetests/msvcrt/file.c @@ -297,7 +297,7 @@ static void test_readmode( BOOL ascii_mode ) fd = open ("fdopen.tst", O_WRONLY | O_CREAT | O_BINARY, _S_IREAD |_S_IWRITE); /* an internal buffer of BUFSIZ is maintained, so make a file big - * enough to test operations that cross the buffer boundary + * enough to test operations that cross the buffer boundary */ j = (2*BUFSIZ-4)/strlen(padbuffer); for (i=0; i #include #include +#ifdef __REACTOS__ #include +#endif static inline BOOL almost_equal(double d1, double d2) { if(d1-d2>-1e-30 && d1-d2<1e-30) diff --git a/modules/rostests/winetests/msvcrt/printf.c b/modules/rostests/winetests/msvcrt/printf.c index ec314544c98..ac910e23f77 100644 --- a/modules/rostests/winetests/msvcrt/printf.c +++ b/modules/rostests/winetests/msvcrt/printf.c @@ -723,11 +723,13 @@ static void test_xcvt(void) ok( decpt == test_cvt_testcases[i].expdecpt_e, "%d) _ecvt() decimal point wrong, got %d expected %d\n", i, decpt, test_cvt_testcases[i].expdecpt_e); +#ifdef __REACTOS__ if (((i == 10) || (i == 11) || (i == 12)) && (_winver < 0x600)) { skip("broken on win 2003\n"); continue; } +#endif // __REACTOS__ ok( sign == test_cvt_testcases[i].expsign, "%d) _ecvt() sign wrong, got %d expected %d\n", i, sign, test_cvt_testcases[i].expsign); @@ -744,11 +746,13 @@ static void test_xcvt(void) ok( decpt == test_cvt_testcases[i].expdecpt_f, "%d) _fcvt() decimal point wrong, got %d expected %d\n", i, decpt, test_cvt_testcases[i].expdecpt_f); +#ifdef __REACTOS__ if (((i == 10) || (i == 11) || (i == 12)) && (_winver < 0x600)) { skip("broken on win 2003\n"); continue; } +#endif // __REACTOS__ ok( sign == test_cvt_testcases[i].expsign, "%d) _fcvt() sign wrong, got %d expected %d\n", i, sign, test_cvt_testcases[i].expsign); diff --git a/modules/rostests/winetests/msvcrt/string.c b/modules/rostests/winetests/msvcrt/string.c index f88d672d573..3ba10d3de7e 100644 --- a/modules/rostests/winetests/msvcrt/string.c +++ b/modules/rostests/winetests/msvcrt/string.c @@ -37,7 +37,9 @@ #include "winbase.h" #include "winnls.h" #include "winuser.h" +#ifdef __REACTOS__ #include +#endif static char *buf_to_string(const unsigned char *bin, int len, int nr) { @@ -136,13 +138,13 @@ static void test_swab( void ) { char expected1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ@#"; char expected2[] = "ABCDEFGHIJKLMNOPQRSTUVWX$"; char expected3[] = "$"; - + char from[30]; char to[30]; - + int testsize; - - /* Test 1 - normal even case */ + + /* Test 1 - normal even case */ memset(to,'$', sizeof(to)); memset(from,'@', sizeof(from)); testsize = 26; @@ -150,7 +152,7 @@ static void test_swab( void ) { _swab( from, to, testsize ); ok(memcmp(to,expected1,testsize) == 0, "Testing even size %d returned '%*.*s'\n", testsize, testsize, testsize, to); - /* Test 2 - uneven case */ + /* Test 2 - uneven case */ memset(to,'$', sizeof(to)); memset(from,'@', sizeof(from)); testsize = 25; @@ -158,7 +160,7 @@ static void test_swab( void ) { _swab( from, to, testsize ); ok(memcmp(to,expected2,testsize) == 0, "Testing odd size %d returned '%*.*s'\n", testsize, testsize, testsize, to); - /* Test 3 - from = to */ + /* Test 3 - from = to */ memset(to,'$', sizeof(to)); memset(from,'@', sizeof(from)); testsize = 26; @@ -166,7 +168,7 @@ static void test_swab( void ) { _swab( to, to, testsize ); ok(memcmp(to,expected1,testsize) == 0, "Testing overlapped size %d returned '%*.*s'\n", testsize, testsize, testsize, to); - /* Test 4 - 1 bytes */ + /* Test 4 - 1 bytes */ memset(to,'$', sizeof(to)); memset(from,'@', sizeof(from)); testsize = 1; @@ -3663,11 +3665,13 @@ static void test__wcstoi64(void) for (i = 0; i < ARRAY_SIZE(tests); i++) { +#ifdef __REACTOS__ if ((i == 20) && (_winver < 0x600)) { skip("Skipping test with i = 20, because it fails on Windows 2003\n"); continue; } +#endif // __REACTOS__ res = p_wcstoi64( tests[i].str, &endpos, tests[i].base ); ok( res == tests[i].res, "%u: %s res %s\n", i, wine_dbgstr_w(tests[i].str), wine_dbgstr_longlong(res) );