1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5/*=====================================================================
6**
7** Source: test6.c
8**
9** Purpose: Test #6 for the vswprintf function.
10**
11**
12**===================================================================*/
13
14#include <palsuite.h>
15#include "../vswprintf.h"
16
17/* memcmp is used to verify the results, so this test is dependent on it. */
18/* ditto with wcslen */
19
20int __cdecl main(int argc, char *argv[])
21{
22 WCHAR wc = (WCHAR) 'c';
23
24 if (PAL_Initialize(argc, argv) != 0)
25 return(FAIL);
26
27 DoWCharTest(convert("foo %c"), wc, convert("foo c"));
28 DoCharTest(convert("foo %hc"), 'b', convert("foo b"));
29 DoWCharTest(convert("foo %lc"), wc, convert("foo c"));
30 DoWCharTest(convert("foo %Lc"), wc, convert("foo c"));
31 DoWCharTest(convert("foo %I64c"), wc, convert("foo c"));
32 DoWCharTest(convert("foo %5c"), wc, convert("foo c"));
33 DoWCharTest(convert("foo %.0c"), wc, convert("foo c"));
34 DoWCharTest(convert("foo %-5c"), wc, convert("foo c "));
35 DoWCharTest(convert("foo %05c"), wc, convert("foo 0000c"));
36 DoWCharTest(convert("foo % c"), wc, convert("foo c"));
37 DoWCharTest(convert("foo %#c"), wc, convert("foo c"));
38
39 PAL_Terminate();
40 return PASS;
41}
42