From 196f5c4b0dc3c640dfed67b007192db81d616a92 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 22 Aug 2017 15:51:35 +0200 Subject: [PATCH] Don't try to test ctype functions for values < 0 or > 255 Values that aren't representable as unsigned give undefined results. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/4219) --- test/ctype_internal_test.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/ctype_internal_test.c b/test/ctype_internal_test.c index 514db6be23..15d01e76bb 100644 --- a/test/ctype_internal_test.c +++ b/test/ctype_internal_test.c @@ -42,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; @@ -58,10 +53,7 @@ static struct { { '%', '%' }, { '~', '~' }, { 0, 0 }, - { EOF, EOF }, - { 333, 333 }, - { -333, -333 }, - { -128, -128 } + { EOF, EOF } }; static int test_ctype_toupper(int n) @@ -79,7 +71,6 @@ 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_toupper, OSSL_NELEM(case_change)); ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change)); return 1; -- 2.25.1