Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c7890222
Commit
c7890222
authored
Dec 17, 2002
by
Bill Currie
Committed by
Alexandre Julliard
Dec 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fdopen: don't rewind the file after creating the FILE* handle. Added
unit test for that.
parent
3d60c63a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
2 deletions
+53
-2
file.c
dlls/msvcrt/file.c
+0
-2
.cvsignore
dlls/msvcrt/tests/.cvsignore
+1
-0
Makefile.in
dlls/msvcrt/tests/Makefile.in
+1
-0
file.c
dlls/msvcrt/tests/file.c
+51
-0
No files found.
dlls/msvcrt/file.c
View file @
c7890222
...
...
@@ -620,8 +620,6 @@ MSVCRT_FILE* _fdopen(int fd, const char *mode)
MSVCRT_FILE
*
file
=
msvcrt_alloc_fp
(
fd
);
TRACE
(
":fd (%d) mode (%s) FILE* (%p)
\n
"
,
fd
,
mode
,
file
);
if
(
file
)
MSVCRT_rewind
(
file
);
return
file
;
}
...
...
dlls/msvcrt/tests/.cvsignore
View file @
c7890222
Makefile
file.ok
msvcrt_test.exe.spec.c
scanf.ok
testlist.c
dlls/msvcrt/tests/Makefile.in
View file @
c7890222
...
...
@@ -7,6 +7,7 @@ IMPORTS = msvcrt
EXTRAINCL
=
-I
$(TOPSRCDIR)
/include/msvcrt
CTESTS
=
\
file.c
\
scanf.c
@MAKE_TEST_RULES@
...
...
dlls/msvcrt/tests/file.c
0 → 100644
View file @
c7890222
/*
* Unit test suite for file functions
*
* Copyright 2002 Bill Currie
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windef.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include "wine/test.h"
static
void
test_fdopen
(
void
)
{
static
char
buffer
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
int
fd
;
FILE
*
file
;
fd
=
open
(
"fdopen.tst"
,
O_WRONLY
|
O_CREAT
|
O_BINARY
);
write
(
fd
,
buffer
,
sizeof
(
buffer
));
close
(
fd
);
fd
=
open
(
"fdopen.tst"
,
O_RDONLY
|
O_BINARY
);
lseek
(
fd
,
5
,
SEEK_SET
);
file
=
fdopen
(
fd
,
"rb"
);
ok
(
fread
(
buffer
,
1
,
sizeof
(
buffer
),
file
)
==
5
,
"read wrong byte count"
);
ok
(
memcmp
(
buffer
,
buffer
+
5
,
5
)
==
0
,
"read wrong bytes"
);
fclose
(
file
);
unlink
(
"fdopen.tst"
);
}
START_TEST
(
file
)
{
test_fdopen
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment