msvcrt: Few failing tests for O_TEXT files

Vitaliy Margolen wine-patch at kievinfo.com
Fri Oct 7 20:18:13 CDT 2005


Found this problem while working on another bug. Adding tests for now so I will
not forget about it.

Vitaliy Margolen

changelog:
  msvcrt
  - Add few tests that fail under wine.
-------------- next part --------------
Index: dlls/msvcrt/tests/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/tests/file.c,v
retrieving revision 1.17
diff -u -p -r1.17 file.c
--- dlls/msvcrt/tests/file.c	7 Oct 2005 15:01:15 -0000	1.17
+++ dlls/msvcrt/tests/file.c	8 Oct 2005 01:13:57 -0000
@@ -250,6 +250,19 @@ static void test_file_write_read( void )
   ok( memcmp(mytext,btext,strlen(mytext)) == 0, "problems with _O_APPEND _read\n");
   _close(tempfd);
 
+  /* Test reading only \n or \r */
+  tempfd = _open(tempf,_O_RDONLY|_O_TEXT); /* open in TEXT mode */
+  _lseek(tempfd, -1, FILE_END);
+  ok(_read(tempfd,btext,LLEN) == 1, "_read expected 0 got '\\n'\n");
+  _lseek(tempfd, -2, FILE_END);
+  ret = _read(tempfd,btext,LLEN);
+  ok(ret == 1 && *btext == '\n', "_read expected '\\n' got bad length: %d\n", ret);
+  _lseek(tempfd, -3, FILE_END);
+  ret = _read(tempfd,btext,2);
+  todo_wine ok(ret == 1 && *btext == 'e', "_read expected 'e' got \"%.*s\" bad length: %d\n", ret, btext, ret);
+  todo_wine ok(tell(tempfd) == 42, "bad position %lu expecting 42\n", tell(tempfd));
+  _close(tempfd);
+
   ret = unlink(tempf);
   ok( ret !=-1 ,"Can't unlink '%s': %d\n", tempf, errno);
 


More information about the wine-patches mailing list