| 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: test9.c |
| 8 | ** |
| 9 | ** Purpose: Tests swscanf with characters |
| 10 | ** |
| 11 | ** |
| 12 | **==========================================================================*/ |
| 13 | |
| 14 | |
| 15 | |
| 16 | #include <palsuite.h> |
| 17 | #include "../swscanf.h" |
| 18 | |
| 19 | int __cdecl main(int argc, char *argv[]) |
| 20 | { |
| 21 | if (PAL_Initialize(argc, argv)) |
| 22 | { |
| 23 | return FAIL; |
| 24 | } |
| 25 | |
| 26 | DoWCharTest(convert("1234" ), convert("%c" ), convert("1" ), 1); |
| 27 | DoWCharTest(convert("1234" ), convert("%c" ), convert("1" ), 1); |
| 28 | DoWCharTest(convert("abc" ), convert("%2c" ), convert("ab" ), 2); |
| 29 | DoWCharTest(convert(" ab" ), convert("%c" ), convert(" " ), 1); |
| 30 | DoCharTest(convert("ab" ), convert("%hc" ), "a" , 1); |
| 31 | DoWCharTest(convert("ab" ), convert("%lc" ), convert("a" ), 1); |
| 32 | DoWCharTest(convert("ab" ), convert("%Lc" ), convert("a" ), 1); |
| 33 | DoWCharTest(convert("ab" ), convert("%I64c" ), convert("a" ), 1); |
| 34 | |
| 35 | PAL_Terminate(); |
| 36 | return PASS; |
| 37 | } |
| 38 | |