| 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 the 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 | |
| 22 | int __cdecl main(int argc, char *argv[]) |
| 23 | { |
| 24 | WCHAR wb = (WCHAR) 'b'; |
| 25 | |
| 26 | if (PAL_Initialize(argc, argv) != 0) |
| 27 | { |
| 28 | return(FAIL); |
| 29 | } |
| 30 | |
| 31 | DoWCharTest(convert("foo %c" ), wb, "foo b" ); |
| 32 | DoCharTest(convert("foo %hc" ), 'c', "foo c" ); |
| 33 | DoWCharTest(convert("foo %lc" ), wb, "foo b" ); |
| 34 | DoWCharTest(convert("foo %Lc" ), wb, "foo b" ); |
| 35 | DoWCharTest(convert("foo %I64c" ), wb, "foo b" ); |
| 36 | DoWCharTest(convert("foo %5c" ), wb, "foo b" ); |
| 37 | DoWCharTest(convert("foo %.0c" ), wb, "foo b" ); |
| 38 | DoWCharTest(convert("foo %-5c" ), wb, "foo b " ); |
| 39 | DoWCharTest(convert("foo %05c" ), wb, "foo 0000b" ); |
| 40 | DoWCharTest(convert("foo % c" ), wb, "foo b" ); |
| 41 | DoWCharTest(convert("foo %#c" ), wb, "foo b" ); |
| 42 | |
| 43 | PAL_Terminate(); |
| 44 | return PASS; |
| 45 | } |
| 46 | |
| 47 | |
| 48 | |
| 49 | |