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