|
|
1.1 ! root 1: /* The Plum Hall Validation Suite for C ! 2: * Unpublished copyright (c) 1986-1991, Chiron Systems Inc and Plum Hall Inc. ! 3: * VERSION: 4 ! 4: * DATE: 1993-01-01 ! 5: * The "ANSI" mode of this suite corresponds to official ANSI C, X3.159-1989. ! 6: * As per your license agreement, your distribution is not to be moved or copied outside the Designated Site ! 7: * without specific permission from Plum Hall Inc. ! 8: */ ! 9: ! 10: int i; ! 11: static char *digits = "0123456789"; ! 12: static char *lower = "abcdefghijklmnopqrstuvwxyz"; ! 13: static char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ! 14: static char *graph = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; ! 15: static char *space = " \f\t\n\r\v"; ! 16: static char *xdigit = "abcdefABCDEF"; ! 17: char *p; ! 18: ! 19: Filename = "d43h.h"; ! 20: ! 21: ! 22: for (i = 0; i < (ANSI ? 256 : 128); ++i) ! 23: { ! 24: /* 4.3.1.1 isalnum ! 25: */ ! 26: if (isalpha(i) || isdigit(i)) ! 27: checkthat(__LINE__, isalnum(i)); ! 28: else ! 29: checkthat(__LINE__, !isalnum(i)); ! 30: ! 31: /* 4.3.1.2 isalpha ! 32: */ ! 33: if (islower(i) || isupper(i)) ! 34: checkthat(__LINE__, isalpha(i)); ! 35: else ! 36: checkthat(__LINE__, !isalpha(i)); ! 37: ! 38: /* 4.3.1.3 iscntrl ! 39: * implementation defined, but not printable ! 40: */ ! 41: if (isprint(i)) ! 42: checkthat(__LINE__, !iscntrl(i)); ! 43: ! 44: /* 4.3.1.4 isdigit ! 45: */ ! 46: if (in_set(i, digits)) ! 47: checkthat(__LINE__, isdigit(i)); ! 48: else ! 49: checkthat(__LINE__, !isdigit(i)); ! 50: ! 51: /* 4.3.1.5 isgraph ! 52: */ ! 53: if (isalnum(i) || in_set(i, graph)) ! 54: checkthat( - __LINE__, isgraph(i)); ! 55: else ! 56: checkthat( - __LINE__, !isgraph(i)); ! 57: ! 58: /* 4.3.1.6 islower ! 59: */ ! 60: if (in_set(i, lower)) ! 61: checkthat(__LINE__, islower(i)); ! 62: else ! 63: checkthat(__LINE__, !islower(i)); ! 64: ! 65: /* 4.3.1.7 isprint ! 66: */ ! 67: if (isgraph(i) || i == ' ') ! 68: checkthat(__LINE__, isprint(i)); ! 69: else ! 70: checkthat(__LINE__, !isprint(i)); ! 71: ! 72: /* 4.3.1.8 ispunct ! 73: */ ! 74: if (isgraph(i) && !isalnum(i)) ! 75: checkthat(__LINE__, ispunct(i)); ! 76: else ! 77: checkthat(__LINE__, !ispunct(i)); ! 78: ! 79: /* 4.3.1.9 isspace ! 80: */ ! 81: if (in_set(i, space)) ! 82: checkthat(__LINE__, isspace(i)); ! 83: else ! 84: checkthat(__LINE__, !isspace(i)); ! 85: ! 86: /* 4.3.1.10 isupper ! 87: */ ! 88: if (in_set(i, upper)) ! 89: checkthat(__LINE__, isupper(i)); ! 90: else ! 91: checkthat(__LINE__, !isupper(i)); ! 92: ! 93: /* 4.3.1.11 isxdigit ! 94: */ ! 95: if (isdigit(i) || in_set(i, xdigit)) ! 96: checkthat(__LINE__, isxdigit(i)); ! 97: else ! 98: checkthat(__LINE__, !isxdigit(i)); ! 99: ! 100: ! 101: /* 4.3.2.1 tolower ! 102: * does nothing for !isalpha ! 103: */ ! 104: /* 4.3.2.2 toupper ! 105: * does nothing for !isalpha ! 106: */ ! 107: if (islower(i)) ! 108: checkthat(__LINE__, toupper(i) != i); ! 109: else if (isupper(i)) ! 110: checkthat(__LINE__, tolower(i) != i); ! 111: else ! 112: { ! 113: iequals(__LINE__, toupper(i), i); ! 114: iequals(__LINE__, tolower(i), i); ! 115: } ! 116: } ! 117: ! 118: /* check case mapping */ ! 119: for (i = 0; i < strlen(upper); ++i) ! 120: { ! 121: iequals(__LINE__, tolower(upper[i]), lower[i]); ! 122: iequals(__LINE__, toupper(lower[i]), upper[i]); ! 123: } ! 124: ! 125: /* EOF is a legal argument to these functions */ ! 126: if (isalnum(EOF)) ! 127: complain(__LINE__); ! 128: if (isalpha(EOF)) ! 129: complain(__LINE__); ! 130: if (iscntrl(EOF)) ! 131: complain(__LINE__); ! 132: if (isdigit(EOF)) ! 133: complain(__LINE__); ! 134: if (isgraph(EOF)) ! 135: complain(__LINE__); ! 136: if (islower(EOF)) ! 137: complain(__LINE__); ! 138: if (isprint(EOF)) ! 139: complain(__LINE__); ! 140: if (ispunct(EOF)) ! 141: complain(__LINE__); ! 142: if (isspace(EOF)) ! 143: complain(__LINE__); ! 144: if (isupper(EOF)) ! 145: complain(__LINE__); ! 146: if (isxdigit(EOF)) ! 147: complain(__LINE__); ! 148: ! 149: checkthat(__LINE__, toupper(EOF) == EOF); ! 150: checkthat(__LINE__, tolower(EOF) == EOF);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.