[MSVCRT_WINETEST] Improve msvcrt_winetest

- Reduce diff to wine
- Enable todo_wine
This commit is contained in:
Timo Kreuzer
2025-06-14 10:48:15 +00:00
parent 17289faf7f
commit 1fef0ce8de
6 changed files with 31 additions and 17 deletions
@@ -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=
+2
View File
@@ -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;
+10 -10
View File
@@ -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<j; i++)
@@ -315,7 +315,7 @@ static void test_readmode( BOOL ascii_mode )
ok(_doserrno == ERROR_ACCESS_DENIED, "doserrno = %ld\n", _doserrno);
close (fd);
fd = open ("fdopen.tst", O_RDONLY, _S_IREAD |_S_IWRITE);
errno = 0xdeadbeef;
ok(dup2(fd, -1) == -1, "dup2(fd, -1) succeeded\n");
@@ -333,7 +333,7 @@ static void test_readmode( BOOL ascii_mode )
file = fdopen (fd, "rb");
ao = 0;
}
/* first is a test of fgets, ftell, fseek */
ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE);
ok(fgets(buffer,2*BUFSIZ+256,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE);
@@ -372,7 +372,7 @@ static void test_readmode( BOOL ascii_mode )
ok(write(fd, buffer, 1) == -1, "read succeeded on write-only file\n");
ok(errno == EBADF, "errno = %d\n", errno);
ok(_doserrno == ERROR_ACCESS_DENIED, "doserrno = %ld\n", _doserrno);
/* test fread across buffer boundary */
rewind(file);
ok(ftell(file) == 0,"Did not start at beginning of file in %s\n", IOMODE);
@@ -878,7 +878,7 @@ static void test_fgetwc( void )
ok(*wptr == '\n', "Carriage return was not skipped\n");
fclose(tempfh);
unlink(tempf);
tempfh = fopen(tempf,"wb");
j = 'a';
/* pad to almost the length of the internal buffer. Use an odd number of bytes
@@ -1339,7 +1339,7 @@ static void test_ctrlz( void )
ok(l==j, "ftell expected %d got %ld\n", j, l);
ok(feof(tempfh), "did not get EOF\n");
fclose(tempfh);
tempfh = fopen(tempf,"rb"); /* open in BINARY mode */
ok(fgets(buffer,256,tempfh) != 0,"fgets failed unexpected\n");
i=strlen(buffer);
@@ -1662,7 +1662,7 @@ static void test_file_inherit_child_no(const char* fd_s)
int ret;
ret = write(fd, "Success", 8);
ok( ret == -1 && errno == EBADF,
ok( ret == -1 && errno == EBADF,
"Wrong write result in child process on %d (%s)\n", fd, strerror(errno));
}
@@ -1778,7 +1778,7 @@ static void test_file_inherit( const char* selfname )
ok(read(fd, buffer, sizeof (buffer)) == 8 && memcmp(buffer, "Success", 8) == 0, "Couldn't read back the data\n");
close (fd);
ok(unlink("fdopen.tst") == 0, "Couldn't unlink\n");
fd = open ("fdopen.tst", O_CREAT | O_RDWR | O_BINARY | O_NOINHERIT, _S_IREAD |_S_IWRITE);
ok(fd != -1, "Couldn't create test file\n");
arg_v[1] = "file";
@@ -2049,7 +2049,7 @@ static void test_chsize( void )
ok( _filelength( fd ) == sizeof(temptext) / 2, "Wrong file size\n" );
/* enlarge the file */
ok( _chsize( fd, sizeof(temptext) * 2 ) == 0, "_chsize() failed\n" );
ok( _chsize( fd, sizeof(temptext) * 2 ) == 0, "_chsize() failed\n" );
pos = _lseek( fd, 0, SEEK_CUR );
ok( cur == pos, "File pointer changed from: %ld to: %ld\n", cur, pos );
@@ -2084,7 +2084,7 @@ static void test_fopen_fclose_fcloseall( void )
"filename is empty, errno = %d (expected 2 or 22)\n", errno);
errno = 0xfaceabad;
stream4 = fopen(NULL, "w+");
ok(stream4 == NULL && (errno == EINVAL || errno == ENOENT),
ok(stream4 == NULL && (errno == EINVAL || errno == ENOENT),
"filename is NULL, errno = %d (expected 2 or 22)\n", errno);
/* testing fclose() */
+2
View File
@@ -25,7 +25,9 @@
#include <stdio.h>
#include <math.h>
#include <process.h>
#ifdef __REACTOS__
#include <versionhelpers.h>
#endif
static inline BOOL almost_equal(double d1, double d2) {
if(d1-d2>-1e-30 && d1-d2<1e-30)
@@ -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);
+11 -7
View File
@@ -37,7 +37,9 @@
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#ifdef __REACTOS__
#include <versionhelpers.h>
#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) );