summaryrefslogtreecommitdiff
path: root/tests/test-c-strncasecmp.c
diff options
context:
space:
mode:
authorDaniel Richard G <skunk@iSKUNK.ORG>2016-08-19 12:24:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-08-19 12:24:42 -0700
commit6e2966216e4e0605508c5f5abd27c8dc44ff6b73 (patch)
treeb6cbdf3243458e920f15b31fd3ba55cf75c09855 /tests/test-c-strncasecmp.c
parentd05a8869be5247dd4ae65822b4eed091ae00924f (diff)
downloadgnulib-6e2966216e4e0605508c5f5abd27c8dc44ff6b73.tar.gz
c-strcase-tests: port to EBCDIC
* tests/test-c-strncasecmp.c: Allow two c_strncasecmp calls which assume ASCII encoding semantics to run only in ASCII mode, as they fail in EBCDIC.
Diffstat (limited to 'tests/test-c-strncasecmp.c')
-rw-r--r--tests/test-c-strncasecmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test-c-strncasecmp.c b/tests/test-c-strncasecmp.c
index 1ca42d89d0..349f6b3098 100644
--- a/tests/test-c-strncasecmp.c
+++ b/tests/test-c-strncasecmp.c
@@ -19,6 +19,7 @@
#include <config.h>
#include "c-strcase.h"
+#include "c-ctype.h"
#include <locale.h>
#include <string.h>
@@ -71,9 +72,11 @@ main (int argc, char *argv[])
ASSERT (c_strncasecmp ("\303\266zg\303\274r", "\303\226ZG\303\234R", 99) > 0); /* özgür */
ASSERT (c_strncasecmp ("\303\226ZG\303\234R", "\303\266zg\303\274r", 99) < 0); /* özgür */
+#if C_CTYPE_ASCII
/* This test shows how strings of different size cannot compare equal. */
ASSERT (c_strncasecmp ("turkish", "TURK\304\260SH", 7) < 0);
ASSERT (c_strncasecmp ("TURK\304\260SH", "turkish", 7) > 0);
+#endif
return 0;
}