ReactOS
0.4.16-dev-240-gdb5fa3b
_vscwprintf.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS api tests
3
* LICENSE: GPL - See COPYING in the top level directory
4
* PURPOSE: Test for _vscprintf
5
*/
6
7
#include <
apitest.h
>
8
9
#include <stdio.h>
10
#include <tchar.h>
11
#include <errno.h>
12
13
static
void
call_varargs
(
int
expected_ret,
LPCWSTR
formatString, ...)
14
{
15
va_list
args
;
16
int
ret
;
17
/* Test the basic functionality */
18
va_start
(
args
, formatString);
19
ret
=
_vscwprintf
(formatString,
args
);
20
va_end
(
args
);
21
ok
(expected_ret ==
ret
,
"expected %i, got %i.\n"
, expected_ret,
ret
);
22
}
23
24
START_TEST
(
_vscwprintf
)
25
{
26
/* Lesson of the day: don't mix wide and ansi char */
27
/* Lesson of the week: don't ignore the lesson of the day */
28
call_varargs
(12,
L
"%hs world!"
,
"hello"
);
29
call_varargs
(12,
L
"%s world!"
,
L
"hello"
);
30
call_varargs
(17,
L
"Jack ate %u pies"
, 100);
31
/* Do not test NULL argument. That is verified to SEGV on a */
32
/* release-build with VC10 and MS' msvcrt. */
33
}
va_list
char * va_list
Definition:
acmsvcex.h:78
va_end
#define va_end(ap)
Definition:
acmsvcex.h:90
va_start
#define va_start(ap, A)
Definition:
acmsvcex.h:91
apitest.h
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
_vscwprintf
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
call_varargs
static void call_varargs(int expected_ret, LPCWSTR formatString,...)
Definition:
_vscwprintf.c:13
L
#define L(x)
Definition:
ntvdm.h:50
args
#define args
Definition:
format.c:66
args
Definition:
match.c:390
ret
int ret
Definition:
wcstombs-tests.c:31
LPCWSTR
const WCHAR * LPCWSTR
Definition:
xmlstorage.h:185
modules
rostests
apitests
crt
_vscwprintf.c
Generated on Tue Nov 5 2024 06:13:32 for ReactOS by
1.9.6