From: Daniel Richard G Date: Wed, 17 Aug 2016 22:58:01 +0000 (-0700) Subject: c-strcase-tests, wcwidth-tests: port to EBCDIC X-Git-Tag: v1.0~6689 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b21115ee906ce7693fd0949e2c4345365cabca7a;p=gnulib.git c-strcase-tests, wcwidth-tests: port to EBCDIC * tests/test-c-strcasecmp.c: Include c-ctype.h. (main) [!C_CTYPE_ASCII]: Skip tests that assume ASCII. * tests/test-wcwidth.c: Likewise. --- diff --git a/ChangeLog b/ChangeLog index ddacf1ed18..2e322dd327 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-08-17 Daniel Richard G. + + c-strcase-tests, wcwidth-tests: port to EBCDIC + * tests/test-c-strcasecmp.c: Include c-ctype.h. + (main) [!C_CTYPE_ASCII]: Skip tests that assume ASCII. + * tests/test-wcwidth.c: Likewise. + 2016-08-17 Paul Eggert stdbool: don't require _Bool for C++ diff --git a/tests/test-c-strcasecmp.c b/tests/test-c-strcasecmp.c index 37f9431547..42e538fe24 100644 --- a/tests/test-c-strcasecmp.c +++ b/tests/test-c-strcasecmp.c @@ -19,6 +19,7 @@ #include #include "c-strcase.h" +#include "c-ctype.h" #include #include @@ -57,9 +58,11 @@ main (int argc, char *argv[]) ASSERT (c_strcasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R") > 0); /* özgür */ ASSERT (c_strcasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r") < 0); /* özgür */ +#if C_CTYPE_ASCII /* This test shows how strings of different size cannot compare equal. */ ASSERT (c_strcasecmp ("turkish", "TURK\304\260SH") < 0); ASSERT (c_strcasecmp ("TURK\304\260SH", "turkish") > 0); +#endif return 0; } diff --git a/tests/test-wcwidth.c b/tests/test-wcwidth.c index 5a0d853802..db53abf3f4 100644 --- a/tests/test-wcwidth.c +++ b/tests/test-wcwidth.c @@ -26,6 +26,7 @@ SIGNATURE_CHECK (wcwidth, int, (wchar_t)); #include #include +#include "c-ctype.h" #include "localcharset.h" #include "macros.h" @@ -34,9 +35,11 @@ main () { wchar_t wc; +#ifdef C_CTYPE_ASCII /* Test width of ASCII characters. */ for (wc = 0x20; wc < 0x7F; wc++) ASSERT (wcwidth (wc) == 1); +#endif /* Switch to an UTF-8 locale. */ if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL