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
d0e77f8a
Commit
d0e77f8a
authored
Jan 25, 2009
by
Uwe Bonnes
Committed by
Alexandre Julliard
Jan 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Test case to show Wine still mishandles file text mode.
parent
45824821
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
file.c
dlls/msvcrt/tests/file.c
+40
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
d0e77f8a
...
...
@@ -306,6 +306,7 @@ static void test_asciimode(void)
{
FILE
*
fp
;
char
buf
[
64
];
int
c
,
i
,
j
;
/* Simple test of CR CR LF handling. Test both fgets and fread code paths, they're different! */
fp
=
fopen
(
"ascii.tst"
,
"wb"
);
...
...
@@ -334,6 +335,45 @@ static void test_asciimode(void)
ok
((
fread
(
buf
,
1
,
sizeof
(
buf
),
fp
)
==
0
),
"fread after logical EOF
\n
"
);
fclose
(
fp
);
/* Show ASCII mode handling*/
fp
=
fopen
(
"ascii.tst"
,
"wb"
);
fputs
(
"0
\r\n
1
\r\n
2
\r\n
3
\r\n
4
\r\n
5
\r\n
6
\r\n
7
\r\n
8
\r\n
9
\r\n
"
,
fp
);
fclose
(
fp
);
fp
=
fopen
(
"ascii.tst"
,
"r"
);
c
=
fgetc
(
fp
);
c
=
fgetc
(
fp
);
fseek
(
fp
,
0
,
SEEK_CUR
);
todo_wine
{
for
(
i
=
1
;
i
<
10
;
i
++
)
{
ok
((
j
=
ftell
(
fp
))
==
i
*
3
,
"ftell fails in TEXT mode
\n
"
);
fseek
(
fp
,
0
,
SEEK_CUR
);
ok
((
c
=
fgetc
(
fp
))
==
'0'
+
i
,
"fgetc after fseek failed in line %d
\n
"
,
i
);
c
=
fgetc
(
fp
);
}
/* Show that fseek doesn't skip \\r !*/
rewind
(
fp
);
c
=
fgetc
(
fp
);
fseek
(
fp
,
2
,
SEEK_CUR
);
for
(
i
=
1
;
i
<
10
;
i
++
)
{
ok
((
c
=
fgetc
(
fp
))
==
'0'
+
i
,
"fgetc after fseek with pos Offset failed in line %d
\n
"
,
i
);
fseek
(
fp
,
2
,
SEEK_CUR
);
}
fseek
(
fp
,
9
*
3
,
SEEK_SET
);
c
=
fgetc
(
fp
);
fseek
(
fp
,
-
4
,
SEEK_CUR
);
for
(
i
=
8
;
i
>=
0
;
i
--
)
{
ok
((
c
=
fgetc
(
fp
))
==
'0'
+
i
,
"fgetc after fseek with neg Offset failed in line %d
\n
"
,
i
);
fseek
(
fp
,
-
4
,
SEEK_CUR
);
}
}
/* Show what happens is fseek positions filepointer on \\r */
fclose
(
fp
);
fp
=
fopen
(
"ascii.tst"
,
"r"
);
fseek
(
fp
,
3
,
SEEK_SET
);
ok
((
c
=
fgetc
(
fp
))
==
'1'
,
"fgetc fails to read nect char when positioned on
\\
r
\n
"
);
fclose
(
fp
);
unlink
(
"ascii.tst"
);
}
...
...
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