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: Test #7 for the vswprintf function. |
10 | ** |
11 | ** |
12 | **===================================================================*/ |
13 | |
14 | #include <palsuite.h> |
15 | #include "../vswprintf.h" |
16 | |
17 | /* memcmp is used to verify the results, so this test is dependent on it. */ |
18 | /* ditto with wcslen */ |
19 | |
20 | int __cdecl main(int argc, char *argv[]) |
21 | { |
22 | WCHAR wc = (WCHAR) 'c'; |
23 | |
24 | if (PAL_Initialize(argc, argv) != 0) |
25 | return(FAIL); |
26 | |
27 | DoCharTest(convert("foo %C" ), 'b', convert("foo b" )); |
28 | DoWCharTest(convert("foo %hC" ), wc, convert("foo c" )); |
29 | DoCharTest(convert("foo %lC" ), 'b', convert("foo b" )); |
30 | DoCharTest(convert("foo %LC" ), 'b', convert("foo b" )); |
31 | DoCharTest(convert("foo %I64C" ), 'b', convert("foo b" )); |
32 | DoCharTest(convert("foo %5C" ), 'b', convert("foo b" )); |
33 | DoCharTest(convert("foo %.0C" ), 'b', convert("foo b" )); |
34 | DoCharTest(convert("foo %-5C" ), 'b', convert("foo b " )); |
35 | DoCharTest(convert("foo %05C" ), 'b', convert("foo 0000b" )); |
36 | DoCharTest(convert("foo % C" ), 'b', convert("foo b" )); |
37 | DoCharTest(convert("foo %#C" ), 'b', convert("foo b" )); |
38 | |
39 | PAL_Terminate(); |
40 | return PASS; |
41 | } |
42 | |