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
dbc8c07b
Commit
dbc8c07b
authored
Apr 20, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Added fprintf tests.
parent
942aa70a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
printf.c
dlls/msvcrt/tests/printf.c
+36
-0
No files found.
dlls/msvcrt/tests/printf.c
View file @
dbc8c07b
...
@@ -625,6 +625,41 @@ static void test_snprintf (void)
...
@@ -625,6 +625,41 @@ static void test_snprintf (void)
};
};
}
}
static
void
test_fprintf
(
void
)
{
static
char
file_name
[]
=
"fprintf.tst"
;
FILE
*
fp
=
fopen
(
file_name
,
"wb"
);
char
buf
[
1024
];
int
ret
;
ret
=
fprintf
(
fp
,
"simple test
\n
"
);
ok
(
ret
==
12
,
"ret = %d
\n
"
,
ret
);
ret
=
ftell
(
fp
);
ok
(
ret
==
12
,
"ftell returned %d
\n
"
,
ret
);
ret
=
fprintf
(
fp
,
"contains%cnull
\n
"
,
'\0'
);
ok
(
ret
==
14
,
"ret = %d
\n
"
,
ret
);
ret
=
ftell
(
fp
);
ok
(
ret
==
26
,
"ftell returned %d
\n
"
,
ret
);
fclose
(
fp
);
fp
=
fopen
(
file_name
,
"rb"
);
ret
=
fscanf
(
fp
,
"%[^
\n
] "
,
buf
);
ok
(
ret
==
1
,
"ret = %d
\n
"
,
ret
);
ret
=
ftell
(
fp
);
ok
(
ret
==
12
,
"ftell returned %d
\n
"
,
ret
);
ok
(
!
strcmp
(
buf
,
"simple test"
),
"buf = %s
\n
"
,
buf
);
fgets
(
buf
,
sizeof
(
buf
),
fp
);
ret
=
ftell
(
fp
);
ok
(
ret
==
26
,
"ret = %d
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
"contains
\0
null
\n
"
,
14
),
"buf = %s
\n
"
,
buf
);
fclose
(
fp
);
unlink
(
file_name
);
}
static
void
test_fcvt
(
void
)
static
void
test_fcvt
(
void
)
{
{
char
*
str
;
char
*
str
;
...
@@ -1036,6 +1071,7 @@ START_TEST(printf)
...
@@ -1036,6 +1071,7 @@ START_TEST(printf)
test_sprintf
();
test_sprintf
();
test_swprintf
();
test_swprintf
();
test_snprintf
();
test_snprintf
();
test_fprintf
();
test_fcvt
();
test_fcvt
();
test_xcvt
();
test_xcvt
();
test_vsnwprintf
();
test_vsnwprintf
();
...
...
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