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: Tests swprintf with character
10**
11**
12**==========================================================================*/
13
14
15
16#include <palsuite.h>
17#include "../swprintf.h"
18
19/*
20 * Uses memcmp & wcslen
21 */
22
23int __cdecl main(int argc, char *argv[])
24{
25 WCHAR wb = (WCHAR) 'b';
26
27 if (PAL_Initialize(argc, argv) != 0)
28 {
29 return FAIL;
30 }
31
32
33 DoWCharTest(convert("foo %c"), wb, convert("foo b"));
34 DoCharTest(convert("foo %hc"), 'c', convert("foo c"));
35 DoWCharTest(convert("foo %lc"), wb, convert("foo b"));
36 DoWCharTest(convert("foo %Lc"), wb, convert("foo b"));
37 DoWCharTest(convert("foo %I64c"), wb, convert("foo b"));
38 DoWCharTest(convert("foo %5c"), wb, convert("foo b"));
39 DoWCharTest(convert("foo %.0c"), wb, convert("foo b"));
40 DoWCharTest(convert("foo %-5c"), wb, convert("foo b "));
41 DoWCharTest(convert("foo %05c"), wb, convert("foo 0000b"));
42 DoWCharTest(convert("foo % c"), wb, convert("foo b"));
43 DoWCharTest(convert("foo %#c"), wb, convert("foo b"));
44
45 PAL_Terminate();
46 return PASS;
47}
48