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