2017-10-21 23:40:19 +00:00
|
|
|
/* Conformance Test 14.5.0.1: Verification of islower, isupper */
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
2022-10-17 22:50:42 +00:00
|
|
|
int printf(const char *, ...);
|
|
|
|
|
|
|
|
int main (void)
|
2017-10-21 23:40:19 +00:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
char ch;
|
|
|
|
unsigned char uc;
|
|
|
|
|
|
|
|
|
|
|
|
/* islower: returns 0 if char is not in ['a'..'z'] */
|
|
|
|
/* isupper: returns 0 if char is not in ['A'..'Z'] */
|
|
|
|
|
|
|
|
for (uc = 'a'; uc <= 'z'; uc++)
|
|
|
|
{
|
|
|
|
j = islower (uc);
|
|
|
|
if (j == 0)
|
|
|
|
goto Fail;
|
|
|
|
j = isupper (uc);
|
|
|
|
if (j != 0)
|
|
|
|
goto Fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (ch = 'A'; ch <= 'Z'; ch++)
|
|
|
|
{
|
|
|
|
j = islower (ch);
|
|
|
|
if (j != 0)
|
|
|
|
goto Fail;
|
|
|
|
j = isupper (ch);
|
|
|
|
if (j == 0)
|
|
|
|
goto Fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
printf ("Passed Conformance Test 14.5.0.1\n");
|
2022-10-17 22:50:42 +00:00
|
|
|
return 0;
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Conformance Test 14.5.0.1\n");
|
|
|
|
}
|