summaryrefslogtreecommitdiffstats
path: root/test/ctype_internal_test.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-08-24 10:46:31 +1000
committerPauli <paul.dale@oracle.com>2017-08-25 06:42:17 +1000
commit678c462e213c3bf479bc93e4df5899ecfd914f91 (patch)
treedebe6087b1bc4e34e59073e0430216c72d16be58 /test/ctype_internal_test.c
parentf7d1d2a479adaaae222d88710c6ceb85706ebb0f (diff)
Check for EOF in ASCII conversions.
The C standard defines EOF as: ... an integer constant expression, with type int and a negative value... This means a conforming implemenetation could define this as a one of the printable characters. This won't be a problem for ASCII. A specific test case has been added for EOF. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4240)
Diffstat (limited to 'test/ctype_internal_test.c')
-rw-r--r--test/ctype_internal_test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ctype_internal_test.c b/test/ctype_internal_test.c
index 6b66cfbaa0..04ab14d73f 100644
--- a/test/ctype_internal_test.c
+++ b/test/ctype_internal_test.c
@@ -68,10 +68,16 @@ static int test_ctype_tolower(int n)
&& TEST_int_eq(ossl_tolower(case_change[n].l), case_change[n].l);
}
+static int test_ctype_eof(void)
+{
+ return test_ctype_chars(EOF);
+}
+
int setup_tests(void)
{
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));
+ ADD_TEST(test_ctype_eof);
return 1;
}