Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
77f3ce0b
Commit
77f3ce0b
authored
Jan 11, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added fputwc tests.
parent
ebfa6536
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
file.c
dlls/msvcrt/tests/file.c
+58
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
77f3ce0b
...
...
@@ -792,6 +792,63 @@ static void test_fgetwc( void )
free
(
tempf
);
}
static
void
test_fputwc
(
void
)
{
char
temppath
[
MAX_PATH
];
char
tempfile
[
MAX_PATH
];
FILE
*
f
;
char
buf
[
1024
];
int
ret
;
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
f
=
fopen
(
tempfile
,
"w"
);
ret
=
fputwc
(
'a'
,
f
);
ok
(
ret
==
'a'
,
"fputwc returned %x, expected 'a'
\n
"
,
ret
);
ret
=
fputwc
(
'\n'
,
f
);
ok
(
ret
==
'\n'
,
"fputwc returned %x, expected '
\\
n'
\n
"
,
ret
);
fclose
(
f
);
f
=
fopen
(
tempfile
,
"rb"
);
ret
=
fread
(
buf
,
1
,
sizeof
(
buf
),
f
);
ok
(
ret
==
3
,
"fread returned %d, expected 3
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
"a
\r\n
"
,
3
),
"incorrect file data
\n
"
);
fclose
(
f
);
if
(
p_fopen_s
)
{
f
=
fopen
(
tempfile
,
"w,ccs=unicode"
);
ret
=
fputwc
(
'a'
,
f
);
ok
(
ret
==
'a'
,
"fputwc returned %x, expected 'a'
\n
"
,
ret
);
ret
=
fputwc
(
'\n'
,
f
);
ok
(
ret
==
'\n'
,
"fputwc returned %x, expected '
\\
n'
\n
"
,
ret
);
fclose
(
f
);
f
=
fopen
(
tempfile
,
"rb"
);
ret
=
fread
(
buf
,
1
,
sizeof
(
buf
),
f
);
ok
(
ret
==
8
,
"fread returned %d, expected 8
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
"
\xff\xfe\x61\x00\r\x00\n\x00
"
,
8
),
"incorrect file data
\n
"
);
fclose
(
f
);
f
=
fopen
(
tempfile
,
"w,ccs=utf-8"
);
ret
=
fputwc
(
'a'
,
f
);
ok
(
ret
==
'a'
,
"fputwc returned %x, expected 'a'
\n
"
,
ret
);
ret
=
fputwc
(
'\n'
,
f
);
ok
(
ret
==
'\n'
,
"fputwc returned %x, expected '
\\
n'
\n
"
,
ret
);
fclose
(
f
);
f
=
fopen
(
tempfile
,
"rb"
);
ret
=
fread
(
buf
,
1
,
sizeof
(
buf
),
f
);
ok
(
ret
==
6
,
"fread returned %d, expected 6
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
"
\xef\xbb\xbf\x61\r\n
"
,
6
),
"incorrect file data
\n
"
);
fclose
(
f
);
}
else
{
win_skip
(
"fputwc tests on unicode files
\n
"
);
}
_unlink
(
tempfile
);
}
static
void
test_ctrlz
(
void
)
{
char
*
tempf
;
...
...
@@ -1955,6 +2012,7 @@ START_TEST(file)
test_flsbuf
();
test_fflush
();
test_fgetwc
();
test_fputwc
();
test_ctrlz
();
test_file_put_get
();
test_tmpnam
();
...
...
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