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
a2af7ccd
Commit
a2af7ccd
authored
Dec 10, 2010
by
Eryk Wieliczko
Committed by
Alexandre Julliard
Dec 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Add _ecvt_s tests.
parent
1ade6c2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
printf.c
dlls/msvcrt/tests/printf.c
+29
-1
No files found.
dlls/msvcrt/tests/printf.c
View file @
a2af7ccd
...
@@ -38,6 +38,8 @@ static int (__cdecl *p__vscwprintf)(const wchar_t *format, __ms_va_list valist);
...
@@ -38,6 +38,8 @@ static int (__cdecl *p__vscwprintf)(const wchar_t *format, __ms_va_list valist);
static
int
(
__cdecl
*
p__vsnwprintf_s
)(
wchar_t
*
str
,
size_t
sizeOfBuffer
,
static
int
(
__cdecl
*
p__vsnwprintf_s
)(
wchar_t
*
str
,
size_t
sizeOfBuffer
,
size_t
count
,
const
wchar_t
*
format
,
size_t
count
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__ecvt_s
)(
char
*
buffer
,
size_t
length
,
double
number
,
int
ndigits
,
int
*
decpt
,
int
*
sign
);
static
void
init
(
void
)
static
void
init
(
void
)
{
{
...
@@ -46,6 +48,7 @@ static void init( void )
...
@@ -46,6 +48,7 @@ static void init( void )
p__vscprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscprintf"
);
p__vscprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscprintf"
);
p__vscwprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscwprintf"
);
p__vscwprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscwprintf"
);
p__vsnwprintf_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vsnwprintf_s"
);
p__vsnwprintf_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vsnwprintf_s"
);
p__ecvt_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_ecvt_s"
);
}
}
static
void
test_sprintf
(
void
)
static
void
test_sprintf
(
void
)
...
@@ -766,7 +769,7 @@ static struct {
...
@@ -766,7 +769,7 @@ static struct {
static
void
test_xcvt
(
void
)
static
void
test_xcvt
(
void
)
{
{
char
*
str
;
char
*
str
;
int
i
,
decpt
,
sign
;
int
i
,
decpt
,
sign
,
err
;
for
(
i
=
0
;
strcmp
(
test_cvt_testcases
[
i
].
expstr_e
,
"END"
);
i
++
){
for
(
i
=
0
;
strcmp
(
test_cvt_testcases
[
i
].
expstr_e
,
"END"
);
i
++
){
decpt
=
sign
=
100
;
decpt
=
sign
=
100
;
str
=
_ecvt
(
test_cvt_testcases
[
i
].
value
,
str
=
_ecvt
(
test_cvt_testcases
[
i
].
value
,
...
@@ -779,6 +782,9 @@ static void test_xcvt(void)
...
@@ -779,6 +782,9 @@ static void test_xcvt(void)
ok
(
decpt
==
test_cvt_testcases
[
i
].
expdecpt_e
,
ok
(
decpt
==
test_cvt_testcases
[
i
].
expdecpt_e
,
"_ecvt() decimal point wrong, got %d expected %d
\n
"
,
decpt
,
"_ecvt() decimal point wrong, got %d expected %d
\n
"
,
decpt
,
test_cvt_testcases
[
i
].
expdecpt_e
);
test_cvt_testcases
[
i
].
expdecpt_e
);
ok
(
sign
==
test_cvt_testcases
[
i
].
expsign
,
"_ecvt() sign wrong, got %d expected %d
\n
"
,
sign
,
test_cvt_testcases
[
i
].
expsign
);
}
}
for
(
i
=
0
;
strcmp
(
test_cvt_testcases
[
i
].
expstr_e
,
"END"
);
i
++
){
for
(
i
=
0
;
strcmp
(
test_cvt_testcases
[
i
].
expstr_e
,
"END"
);
i
++
){
decpt
=
sign
=
100
;
decpt
=
sign
=
100
;
...
@@ -796,6 +802,28 @@ static void test_xcvt(void)
...
@@ -796,6 +802,28 @@ static void test_xcvt(void)
"_ecvt() sign wrong, got %d expected %d
\n
"
,
sign
,
"_ecvt() sign wrong, got %d expected %d
\n
"
,
sign
,
test_cvt_testcases
[
i
].
expsign
);
test_cvt_testcases
[
i
].
expsign
);
}
}
if
(
p__ecvt_s
)
{
str
=
malloc
(
1024
);
for
(
i
=
0
;
strcmp
(
test_cvt_testcases
[
i
].
expstr_e
,
"END"
);
i
++
){
decpt
=
sign
=
100
;
err
=
p__ecvt_s
(
str
,
1024
,
test_cvt_testcases
[
i
].
value
,
test_cvt_testcases
[
i
].
nrdigits
,
&
decpt
,
&
sign
);
ok
(
err
==
0
,
"_ecvt_s() failed with error code %d"
,
err
);
ok
(
0
==
strncmp
(
str
,
test_cvt_testcases
[
i
].
expstr_e
,
15
),
"_ecvt_s() bad return, got
\n
'%s' expected
\n
'%s'
\n
"
,
str
,
test_cvt_testcases
[
i
].
expstr_e
);
ok
(
decpt
==
test_cvt_testcases
[
i
].
expdecpt_e
,
"_ecvt_s() decimal point wrong, got %d expected %d
\n
"
,
decpt
,
test_cvt_testcases
[
i
].
expdecpt_e
);
ok
(
sign
==
test_cvt_testcases
[
i
].
expsign
,
"_ecvt_s() sign wrong, got %d expected %d
\n
"
,
sign
,
test_cvt_testcases
[
i
].
expsign
);
}
free
(
str
);
}
else
win_skip
(
"_ecvt_s not available
\n
"
);
}
}
static
int
__cdecl
_vsnwprintf_wrapper
(
wchar_t
*
str
,
size_t
len
,
const
wchar_t
*
format
,
...)
static
int
__cdecl
_vsnwprintf_wrapper
(
wchar_t
*
str
,
size_t
len
,
const
wchar_t
*
format
,
...)
...
...
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