[APITESTS/CRT]
[reactos.git] / rostests / apitests / crt / _vscprintf.c
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 <stdio.h>
8 #include <wine/test.h>
9 #include <tchar.h>
10
11 static void call_varargs(int expected_ret, LPCSTR formatString, ...)
12 {
13 va_list args;
14 int ret;
15 /* Test the basic functionality */
16 va_start(args, formatString);
17 ret = _vscprintf(formatString, args);
18 ok(expected_ret == ret, "Test failed: expected %i, got %i.\n", expected_ret, ret);
19 }
20
21 START_TEST(_vscprintf)
22 {
23 /* Here you can mix wide and ANSI strings */
24 call_varargs(12, "%S world!", L"hello");
25 call_varargs(12, "%s world!", "hello");
26 call_varargs(11, "%u cookies", 100);
27 /* Test NULL argument */
28 call_varargs(-1, NULL);
29 }