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