Don't try to compare the ctype functions on values > 127
[openssl.git] / test / ctype_internal_test.c
index 0a30c3dd845d5251699bb3d4eb18e800ce9b5912..6b66cfbaa0a0e4d25324c002cb4ae164a696ce43 100644 (file)
 #include <ctype.h>
 #include <stdio.h>
 
+/*
+ * Even though the VMS C RTL claims to be C99 compatible, it's not entirely
+ * so far (C RTL version 8.4).  For the sake of these tests, we therefore
+ * define our own.
+ */
+#if defined(__VMS) && __CRTL_VER <= 80400000
+static int isblank(int c)
+{
+    return c == ' ' || c == '\t';
+}
+#endif
+
 static int test_ctype_chars(int n)
 {
     return TEST_int_eq(isalnum(n) != 0, ossl_isalnum(n) != 0)
@@ -30,11 +42,6 @@ static int test_ctype_chars(int n)
            && TEST_int_eq(isxdigit(n) != 0, ossl_isxdigit(n) != 0);
 }
 
-static int test_ctype_negative(int n)
-{
-    return test_ctype_chars(-n);
-}
-
 static struct {
     int u;
     int l;
@@ -46,10 +53,7 @@ static struct {
     { '%', '%' },
     { '~', '~' },
     {   0,   0 },
-    { EOF, EOF },
-    { 333, 333 },
-    { -333, -333 },
-    { -128, -128 }
+    { EOF, EOF }
 };
 
 static int test_ctype_toupper(int n)
@@ -66,8 +70,7 @@ static int test_ctype_tolower(int n)
 
 int setup_tests(void)
 {
-    ADD_ALL_TESTS(test_ctype_chars, 256);
-    ADD_ALL_TESTS(test_ctype_negative, 128);
+    ADD_ALL_TESTS(test_ctype_chars, 128);
     ADD_ALL_TESTS(test_ctype_toupper, OSSL_NELEM(case_change));
     ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change));
     return 1;