mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 05:22:59 +00:00
4b95e17c61
Introduce a "apitest.h" header gathering special things for apitests (SEH macros, wine/test.h inclusion, and so on...). svn path=/trunk/; revision=60313
31 lines
861 B
C
31 lines
861 B
C
/*
|
|
* PROJECT: ReactOS api tests
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
* PURPOSE: Test for _vscprintf
|
|
*/
|
|
|
|
#include <apitest.h>
|
|
|
|
#include <stdio.h>
|
|
#include <tchar.h>
|
|
#include <errno.h>
|
|
|
|
static void call_varargs(int expected_ret, LPCSTR formatString, ...)
|
|
{
|
|
va_list args;
|
|
int ret;
|
|
/* Test the basic functionality */
|
|
va_start(args, formatString);
|
|
ret = _vscprintf(formatString, args);
|
|
ok(expected_ret == ret, "Test failed: expected %i, got %i.\n", expected_ret, ret);
|
|
}
|
|
|
|
START_TEST(_vscprintf)
|
|
{
|
|
/* Here you can mix wide and ANSI strings */
|
|
call_varargs(12, "%S world!", L"hello");
|
|
call_varargs(12, "%s world!", "hello");
|
|
call_varargs(11, "%u cookies", 100);
|
|
/* Do not test NULL argument. That is verified to SEGV on a */
|
|
/* release-build with VC10 and MS' msvcrt. */
|
|
}
|