| 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: test1.c |
| 8 | ** |
| 9 | ** Purpose: Tests IsValidCodePage with a collection of valid and invalid |
| 10 | ** code pages. |
| 11 | ** |
| 12 | ** |
| 13 | **==========================================================================*/ |
| 14 | |
| 15 | |
| 16 | #include <palsuite.h> |
| 17 | |
| 18 | |
| 19 | UINT InvalidCodePages[] = |
| 20 | { |
| 21 | 0, 0x1, 0x2, 0x3, 0xfff |
| 22 | }; |
| 23 | |
| 24 | int NumInvalidPages = sizeof(InvalidCodePages) / sizeof(InvalidCodePages[0]); |
| 25 | |
| 26 | int __cdecl main(int argc, char *argv[]) |
| 27 | { |
| 28 | int i; |
| 29 | |
| 30 | if (PAL_Initialize(argc, argv)) |
| 31 | { |
| 32 | return FAIL; |
| 33 | } |
| 34 | |
| 35 | |
| 36 | |
| 37 | for (i=0; i<NumInvalidPages; i++) |
| 38 | { |
| 39 | if (IsValidCodePage(InvalidCodePages[i])) |
| 40 | { |
| 41 | Fail("IsValidCodePage() found code page %#x valid!\n" , |
| 42 | InvalidCodePages[i]); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | PAL_Terminate(); |
| 47 | |
| 48 | return PASS; |
| 49 | } |
| 50 | |
| 51 | |