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: Checks every character against the known range of digits.
10**
11**
12**==========================================================================*/
13
14
15#include <palsuite.h>
16
17int __cdecl main(int argc, char *argv[])
18{
19 int i;
20
21 if (PAL_Initialize(argc, argv))
22 {
23 return FAIL;
24 }
25
26
27 for (i=0; i<256; i++)
28 {
29 if (isdigit(i))
30 {
31 if (i < '0' || i > '9')
32 {
33 Fail("ERROR: isdigit returned true for '%c' (%d)!\n", i, i);
34 }
35 }
36 else
37 {
38 if (i >= '0' && i <= '9')
39 {
40 Fail("ERROR: isdigit returned false for '%c' (%d)!\n", i, i);
41 }
42 }
43 }
44
45 PAL_Terminate();
46 return PASS;
47}
48