ReactOS 0.4.15-dev-5666-gc548b97
_sntprintf.h File Reference
#include <wine/test.h>
#include <stdio.h>
#include <tchar.h>
#include <pseh/pseh2.h>
#include <ndk/mmfuncs.h>
#include <ndk/rtlfuncs.h>
Include dependency graph for _sntprintf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define StartSeh()   ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {
 
#define EndSeh(ExpectedStatus)   } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)
 
#define broken(x)   0
 

Functions

 START_TEST (_sntprintf)
 

Macro Definition Documentation

◆ broken

#define broken (   x)    0

Definition at line 21 of file _sntprintf.h.

◆ EndSeh

#define EndSeh (   ExpectedStatus)    } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus)

Definition at line 17 of file _sntprintf.h.

◆ StartSeh

#define StartSeh ( )    ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY {

Definition at line 16 of file _sntprintf.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file _sntprintf.h.

Function Documentation

◆ START_TEST()

START_TEST ( _sntprintf  )

Definition at line 23 of file _sntprintf.h.

24{
25 NTSTATUS ExceptionStatus;
26 _TCHAR Buffer[128];
27 size_t BufferSize = sizeof(Buffer) / sizeof(Buffer[0]);
28 int Result;
29
30 StartSeh()
31 Result = _sntprintf(NULL, 0, _T("Hello"));
32#ifdef TEST_CRTDLL
33 ok_int(Result, -1);
34#else
35 ok_int(Result, 5);
36#endif
38
39 StartSeh()
40 Result = _sntprintf(NULL, 1, _T("Hello"));
41 ok(Result == 5 ||
42 broken(Result == -1) /* Win7 */, "Result = %d\n", Result);
43#if defined(_UNICODE) || defined(TEST_CRTDLL)
45#else
47#endif
48
49 StartSeh()
51 Result = _sntprintf(Buffer, BufferSize, _T("Hello"));
52 ok_int(Result, 5);
53 ok(Buffer[0] == _T('H'), "\n");
54 ok(Buffer[1] == _T('e'), "\n");
55 ok(Buffer[2] == _T('l'), "\n");
56 ok(Buffer[3] == _T('l'), "\n");
57 ok(Buffer[4] == _T('o'), "\n");
58 ok(Buffer[5] == _T('\0'), "\n");
59 ok(Buffer[6] == (_TCHAR)0x5555, "\n");
61
62 StartSeh()
64 Result = _sntprintf(Buffer, 5, _T("Hello"));
65 ok_int(Result, 5);
66 ok(Buffer[0] == _T('H'), "\n");
67 ok(Buffer[1] == _T('e'), "\n");
68 ok(Buffer[2] == _T('l'), "\n");
69 ok(Buffer[3] == _T('l'), "\n");
70 ok(Buffer[4] == _T('o'), "\n");
71 ok(Buffer[5] == (_TCHAR)0x5555, "\n");
73
74 StartSeh()
76 Result = _sntprintf(Buffer, 1, _T("Hello"));
77 ok_int(Result, -1);
78 ok(Buffer[0] == _T('H'), "\n");
79 ok(Buffer[1] == (_TCHAR)0x5555, "\n");
81
82 StartSeh()
84 Result = _sntprintf(Buffer, 0, _T("Hello"));
85 ok_int(Result, -1);
86 ok(Buffer[0] == (_TCHAR)0x5555, "\n");
88}
#define broken(x)
Definition: _sntprintf.h:21
#define StartSeh()
Definition: _sntprintf.h:16
#define EndSeh(ExpectedStatus)
Definition: _sntprintf.h:17
#define ok(value,...)
Definition: atltest.h:57
#define ok_int(expression, result)
Definition: atltest.h:134
LONG NTSTATUS
Definition: precomp.h:26
r l[0]
Definition: byte_order.h:167
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define FillMemory(BUF, SIZ, MASK)
Definition: strucsup.c:31
GLdouble n
Definition: glext.h:7729
char _TCHAR
Definition: tchar.h:1392
#define d
Definition: ke_i.h:81
#define e
Definition: ke_i.h:82
#define H
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _T(x)
Definition: vfdio.h:22
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define _sntprintf
Definition: xmlstorage.h:201