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 the wide char specifier (%C).
10** This test is modeled after the sprintf series.
11**
12**
13**==========================================================================*/
14
15#include <palsuite.h>
16#include "../fwprintf.h"
17
18/*
19 * Depends on memcmp, strlen, fopen, fseek and fgets.
20 */
21
22int __cdecl main(int argc, char *argv[])
23{
24 WCHAR wb = (WCHAR) 'b';
25
26 if (PAL_Initialize(argc, argv))
27 {
28 return FAIL;
29 }
30
31
32 DoCharTest(convert("foo %C"), 'c', "foo c");
33 DoWCharTest(convert("foo %hc"), wb, "foo b");
34 DoCharTest(convert("foo %lC"), 'c', "foo c");
35 DoCharTest(convert("foo %LC"), 'c', "foo c");
36 DoCharTest(convert("foo %I64C"), 'c', "foo c");
37 DoCharTest(convert("foo %5C"), 'c', "foo c");
38 DoCharTest(convert("foo %.0C"), 'c', "foo c");
39 DoCharTest(convert("foo %-5C"), 'c', "foo c ");
40 DoCharTest(convert("foo %05C"), 'c', "foo 0000c");
41 DoCharTest(convert("foo % C"), 'c', "foo c");
42 DoCharTest(convert("foo %#C"), 'c', "foo c");
43
44 PAL_Terminate();
45 return PASS;
46}
47
48