ReactOS 0.4.16-dev-1946-g52006dd
_vscwprintf.c File Reference
#include <apitest.h>
#include <stdio.h>
#include <tchar.h>
#include <errno.h>
Include dependency graph for _vscwprintf.c:

Go to the source code of this file.

Macros

#define _vscprintf   p_vscwprintf
 

Typedefs

typedef int(__cdeclPFN_vscwprintf) (const char *format, va_list argptr)
 

Functions

static BOOL Init (void)
 
static void call_varargs (int expected_ret, LPCWSTR formatString,...)
 
 START_TEST (_vscwprintf)
 

Variables

static PFN_vscwprintf p_vscwprintf
 

Macro Definition Documentation

◆ _vscprintf

#define _vscprintf   p_vscwprintf

Definition at line 25 of file _vscwprintf.c.

Typedef Documentation

◆ PFN_vscwprintf

typedef int(__cdecl * PFN_vscwprintf) (const char *format, va_list argptr)

Definition at line 15 of file _vscwprintf.c.

Function Documentation

◆ call_varargs()

static void call_varargs ( int  expected_ret,
LPCWSTR  formatString,
  ... 
)
static

Definition at line 29 of file _vscwprintf.c.

30{
32 int ret;
33 /* Test the basic functionality */
34 va_start(args, formatString);
35 ret = _vscwprintf(formatString, args);
36 va_end(args);
37 ok(expected_ret == ret, "expected %i, got %i.\n", expected_ret, ret);
38}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define ok(value,...)
Definition: atltest.h:57
return ret
Definition: mutex.c:146
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
#define args
Definition: format.c:66
Definition: match.c:390

Referenced by START_TEST().

◆ Init()

static BOOL Init ( void  )
static

Definition at line 18 of file _vscwprintf.c.

19{
22 ok(p_vscwprintf != NULL, "Failed to load _vscwprintf from %s\n", TEST_DLL_NAME);
23 return (p_vscwprintf != NULL);
24}
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
int(__cdecl * PFN_vscwprintf)(const char *format, va_list argptr)
Definition: _vscwprintf.c:15
static PFN_vscwprintf p_vscwprintf
Definition: _vscwprintf.c:16
#define TEST_DLL_NAME
Definition: wsprintf.c:3
static PVOID hdll
Definition: shimdbg.c:126

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( _vscwprintf  )

Definition at line 40 of file _vscwprintf.c.

41{
42#ifndef TEST_STATIC_CRT
43 if (!Init())
44 {
45 skip("Skipping tests, because _vscwprintf is not available\n");
46 return;
47 }
48#endif
49
50 /* Lesson of the day: don't mix wide and ansi char */
51 /* Lesson of the week: don't ignore the lesson of the day */
52 call_varargs(12, L"%hs world!", "hello");
53 call_varargs(12, L"%s world!", L"hello");
54 call_varargs(17, L"Jack ate %u pies", 100);
55 /* Do not test NULL argument. That is verified to SEGV on a */
56 /* release-build with VC10 and MS' msvcrt. */
57}
#define skip(...)
Definition: atltest.h:64
#define L(x)
Definition: resources.c:13
static BOOL Init(void)
Definition: _vscwprintf.c:18
static void call_varargs(int expected_ret, LPCWSTR formatString,...)
Definition: _vscwprintf.c:29

Variable Documentation

◆ p_vscwprintf

PFN_vscwprintf p_vscwprintf
static

Definition at line 16 of file _vscwprintf.c.

Referenced by Init().