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
f2229e6d
Commit
f2229e6d
authored
Jun 08, 2010
by
Alexander Scott-Johns
Committed by
Alexandre Julliard
Jun 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Move function pointer initialization code in printf.c into separate init function.
parent
4dff55bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
25 deletions
+38
-25
printf.c
dlls/msvcrt/tests/printf.c
+38
-25
No files found.
dlls/msvcrt/tests/printf.c
View file @
f2229e6d
...
...
@@ -33,6 +33,21 @@
#include "wine/test.h"
static
int
(
__cdecl
*
p__vscprintf
)(
const
char
*
format
,
__ms_va_list
valist
);
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
,
size_t
count
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
static
void
init
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"msvcrt.dll"
);
p__vscprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscprintf"
);
p__vscwprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vscwprintf"
);
p__vsnwprintf_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vsnwprintf_s"
);
}
static
void
test_sprintf
(
void
)
{
char
buffer
[
100
];
...
...
@@ -810,12 +825,6 @@ static void test_vsnwprintf(void)
ok
(
!
strcmp
(
buf
,
"onetwothree"
),
"got %s expected 'onetwothree'
\n
"
,
buf
);
}
static
int
(
__cdecl
*
p__vscprintf
)(
const
char
*
format
,
__ms_va_list
valist
);
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
,
size_t
count
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
static
int
__cdecl
_vscprintf_wrapper
(
const
char
*
format
,
...)
{
int
ret
;
...
...
@@ -830,6 +839,12 @@ static void test_vscprintf(void)
{
int
ret
;
if
(
!
p__vscprintf
)
{
win_skip
(
"_vscprintf not available
\n
"
);
return
;
}
ret
=
_vscprintf_wrapper
(
"%s %d"
,
"number"
,
1
);
ok
(
ret
==
8
,
"got %d expected 8
\n
"
,
ret
);
}
...
...
@@ -851,6 +866,12 @@ static void test_vscwprintf(void)
int
ret
;
if
(
!
p__vscwprintf
)
{
win_skip
(
"_vscwprintf not available
\n
"
);
return
;
}
ret
=
_vscwprintf_wrapper
(
format
,
number
,
1
);
ok
(
ret
==
8
,
"got %d expected 8
\n
"
,
ret
);
}
...
...
@@ -876,6 +897,12 @@ static void test_vsnwprintf_s(void)
wchar_t
buffer
[
14
]
=
{
0
};
int
exp
,
got
;
if
(
!
p__vsnwprintf_s
)
{
win_skip
(
"_vsnwprintf_s not available
\n
"
);
return
;
}
/* Enough room. */
exp
=
wcslen
(
out7
);
...
...
@@ -909,29 +936,15 @@ static void test_vsnwprintf_s(void)
START_TEST
(
printf
)
{
init
();
test_sprintf
();
test_swprintf
();
test_snprintf
();
test_fcvt
();
test_xcvt
();
test_vsnwprintf
();
p__vscprintf
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"msvcrt.dll"
),
"_vscprintf"
);
p__vscwprintf
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"msvcrt.dll"
),
"_vscwprintf"
);
p__vsnwprintf_s
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"msvcrt.dll"
),
"_vsnwprintf_s"
);
if
(
p__vscprintf
)
test_vscprintf
();
else
win_skip
(
"_vscprintf not available
\n
"
);
if
(
p__vscwprintf
)
test_vscwprintf
();
else
win_skip
(
"_vscwprintf not available
\n
"
);
if
(
p__vsnwprintf_s
)
test_vsnwprintf_s
();
else
win_skip
(
"_vsnwprintf_s not available
\n
"
);
test_vscprintf
();
test_vscwprintf
();
test_vsnwprintf_s
();
}
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