mirror of git://sourceware.org/git/glibc.git
Fri Jul 26 00:36:50 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* ctype/test_ctype.c: Test EOF too.
This commit is contained in:
parent
4627647c99
commit
4f2a1df0d2
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1994, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -45,6 +45,22 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
|
||||||
register unsigned short int c;
|
register unsigned short int c;
|
||||||
int lose = 0;
|
int lose = 0;
|
||||||
|
|
||||||
|
#define TRYEM do { \
|
||||||
|
TRY (isascii); \
|
||||||
|
TRY (isalnum); \
|
||||||
|
TRY (isalpha); \
|
||||||
|
TRY (iscntrl); \
|
||||||
|
TRY (isdigit); \
|
||||||
|
TRY (isgraph); \
|
||||||
|
TRY (islower); \
|
||||||
|
TRY (isprint); \
|
||||||
|
TRY (ispunct); \
|
||||||
|
TRY (isspace); \
|
||||||
|
TRY (isupper); \
|
||||||
|
TRY (isxdigit); \
|
||||||
|
TRY (isblank); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
for (c = 0; c <= UCHAR_MAX; ++c)
|
for (c = 0; c <= UCHAR_MAX; ++c)
|
||||||
{
|
{
|
||||||
print_char (c);
|
print_char (c);
|
||||||
|
@ -55,32 +71,10 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
|
||||||
++lose;
|
++lose;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isascii(c))
|
#define TRY(isfoo) if (isfoo (c)) fputs (" " #isfoo, stdout)
|
||||||
fputs(" isascii", stdout);
|
TRYEM;
|
||||||
if (isalnum(c))
|
#undef TRY
|
||||||
fputs(" isalnum", stdout);
|
|
||||||
if (isalpha(c))
|
|
||||||
fputs(" isalpha", stdout);
|
|
||||||
if (iscntrl(c))
|
|
||||||
fputs(" iscntrl", stdout);
|
|
||||||
if (isdigit(c))
|
|
||||||
fputs(" isdigit", stdout);
|
|
||||||
if (isgraph(c))
|
|
||||||
fputs(" isgraph", stdout);
|
|
||||||
if (islower(c))
|
|
||||||
fputs(" islower", stdout);
|
|
||||||
if (isprint(c))
|
|
||||||
fputs(" isprint", stdout);
|
|
||||||
if (ispunct(c))
|
|
||||||
fputs(" ispunct", stdout);
|
|
||||||
if (isspace(c))
|
|
||||||
fputs(" isspace", stdout);
|
|
||||||
if (isupper(c))
|
|
||||||
fputs(" isupper", stdout);
|
|
||||||
if (isxdigit(c))
|
|
||||||
fputs(" isxdigit", stdout);
|
|
||||||
if (isblank(c))
|
|
||||||
fputs(" isblank", stdout);
|
|
||||||
fputs("; lower = ", stdout);
|
fputs("; lower = ", stdout);
|
||||||
print_char(tolower(c));
|
print_char(tolower(c));
|
||||||
fputs("; upper = ", stdout);
|
fputs("; upper = ", stdout);
|
||||||
|
@ -88,5 +82,21 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fputs ("EOF", stdout);
|
||||||
|
if (tolower (EOF) != EOF)
|
||||||
|
{
|
||||||
|
++lose;
|
||||||
|
printf (" tolower BOGUS %d;", tolower (EOF));
|
||||||
|
}
|
||||||
|
if (toupper (EOF) != EOF)
|
||||||
|
{
|
||||||
|
++lose;
|
||||||
|
printf (" toupper BOGUS %d;", toupper (EOF));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TRY(isfoo) if (isfoo (EOF)) fputs (" " #isfoo, stdout), ++lose
|
||||||
|
TRYEM;
|
||||||
|
#undef TRY
|
||||||
|
|
||||||
exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
|
exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue