1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * PROJECT:         ReactOS api tests
3*c2c66affSColin Finck  * LICENSE:         GPL - See COPYING in the top level directory
4*c2c66affSColin Finck  * PURPOSE:         Test for _vscprintf
5*c2c66affSColin Finck  */
6*c2c66affSColin Finck 
7*c2c66affSColin Finck #include <apitest.h>
8*c2c66affSColin Finck 
9*c2c66affSColin Finck #include <stdio.h>
10*c2c66affSColin Finck #include <tchar.h>
11*c2c66affSColin Finck #include <errno.h>
12*c2c66affSColin Finck 
call_varargs(int expected_ret,LPCWSTR formatString,...)13*c2c66affSColin Finck static void call_varargs(int expected_ret, LPCWSTR formatString, ...)
14*c2c66affSColin Finck {
15*c2c66affSColin Finck     va_list args;
16*c2c66affSColin Finck     int ret;
17*c2c66affSColin Finck     /* Test the basic functionality */
18*c2c66affSColin Finck     va_start(args, formatString);
19*c2c66affSColin Finck     ret = _vscwprintf(formatString, args);
20*c2c66affSColin Finck     va_end(args);
21*c2c66affSColin Finck     ok(expected_ret == ret, "expected %i, got %i.\n", expected_ret, ret);
22*c2c66affSColin Finck }
23*c2c66affSColin Finck 
START_TEST(_vscwprintf)24*c2c66affSColin Finck START_TEST(_vscwprintf)
25*c2c66affSColin Finck {
26*c2c66affSColin Finck     /* Lesson of the day: don't mix wide and ansi char */
27*c2c66affSColin Finck     /* Lesson of the week: don't ignore the lesson of the day */
28*c2c66affSColin Finck     call_varargs(12, L"%hs world!", "hello");
29*c2c66affSColin Finck     call_varargs(12, L"%s world!", L"hello");
30*c2c66affSColin Finck     call_varargs(17, L"Jack ate %u pies", 100);
31*c2c66affSColin Finck     /* Do not test NULL argument. That is verified to SEGV on a */
32*c2c66affSColin Finck     /* release-build with VC10 and MS' msvcrt. */
33*c2c66affSColin Finck }
34