summaryrefslogtreecommitdiff
path: root/tests/test-c-ctype.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* c-ctype: do not worry about EBCDIC + char signedPaul Eggert2015-09-261-97/+40
| | | | | | | | | | | | | | | Drop support for EBCDIC with char being signed, as this breaks too many programs. Problem reported by Ben Pfaff in: http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00053.html * lib/c-ctype.h: Verify that we are not using EBCDIC with char being signed. (_C_CTYPE_LOWER_A_THRU_F_N): New macro. (_C_CTYPE_LOWER_N, _C_CTYPE_A_THRU_F): Use it. (_C_CTYPE_DIGIT, _C_CTYPE_LOWER, _C_CTYPE_PUNCT, _C_CTYPE_UPPER): (c_isascii, c_isgraph, c_isprint, c_ispunct, c_tolower, c_toupper): * tests/test-c-ctype.c (test_all): Simplify by assuming standard char values cannot be negative. * tests/test-c-ctype.c (NCHARS, to_char): Remove; all uses removed.
* c-ctype: port better to z/OS EBCDICPaul Eggert2015-09-251-1/+1
| | | | | | | | | | | | Problems reported by Daniel Richard G. in: http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00050.html * lib/c-ctype.h (_C_CTYPE_CNTRL): Rewrite in terms of the C standard escapes and _C_CTYPE_OTHER_CNTRL. (_C_CTYPE_OTHER_CNTRL): New macro. * tests/test-c-ctype.c (test_all): Test from CHAR_MIN, not from SCHAR_MIN, as the functions are defined only from values promoted from char or from unsigned char, not necessarily from signed char.
* c-ctype: rewrite to use inline functionsPaul Eggert2015-09-251-212/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies maintenance, since it makes for just one implementation of each function, letting the compiler have the fun of optimization. In practice this works well nowadays with GCC. E.g., c_isascii might need only three instructions even though the source code lists every ASCII character individually in a large switch statement. Also, fix some z/OS porting bugs reported by Daniel Richard G. in: http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00037.html * NEWS: Document the API change. * lib/c-ctype.c: Drastically simplify, since this now just expands inline functions. * lib/c-ctype.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. (C_CTYPE_INLINE): New macro. (C_CTYPE_CONSECUTIVE_DIGITS, C_CTYPE_CONSECUTIVE_LOWERCASE) (C_CTYPE_CONSECUTIVE_UPPERCASE): Remove. Verify that either ASCII or EBCDIC is being used. (_C_CTYPE_SIGNED_EBCDIC, _C_CTYPE_CNTRL, _C_CTYPE_A_THRU_F_N) (_C_CTYPE_DIGIT_N, _C_CTYPE_LOWER_N, _C_CTYPE_UPPER_N) (_C_CTYPE_CASES, _C_CTYPE_A_THRU_F, _C_CTYPE_DIGIT, _C_CTYPE_LOWER) (_C_CTYPE_UPPER, _C_CTYPE_PUNCT_PLAIN): New private macros. (_C_CTYPE_CNTRL): In EBCDIC, '\x07' is a control, not '\xff'. (c_isalnum, c_isalpha, c_isascii, c_isblank, c_iscntrl, c_isdigit) (c_isgraph, c_islower, c_isprint, c_ispunct, c_isspace, c_isupper) (c_isxdigit, c_tolower, c_toupper): Now inline functions. (c_tolower, c_toupper): When converting, return the unsigned char, as that is what z/OS does. * lib/c-strcaseeq.h (CASEEQ): Simplify in the light of the removal of some c-ctype.h macros. * modules/c-ctype (Depends-on): Add extern-inline; remove verify. * tests/test-c-ctype.c (test_all): Fix test for c_toupper and c_tolower promotion to be compatible with z/OS.
* Test that c_iscntrl agrees with iscntrl, etc.Paul Eggert2015-09-231-16/+49
| | | | | | | | | | | Suggested by Daniel Richard G. in: http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00034.html * modules/c-ctype-tests (Depends-on): Add ctype. * tests/test-c-ctype.c: Include <ctype.h>. (NCHARS): New constant. (test_agree_with_C_locale): New function. (main): Use it. (test_all): Use named constants.
* c-ctype: improve c_isascii testingPaul Eggert2015-09-231-1/+7
| | | | | * tests/test-c-ctype.c (test_all): Port c_isascii test to EBCDIC. Add a test to count the number of ASCII characters.
* c-ctype: port better to EBCDICPaul Eggert2015-09-221-46/+60
| | | | | | | | | | | | | | | | | | | | | | | | | Problems reported by Daniel Richard G. in http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00020.html * lib/c-ctype.c: Include <limits.h>, for CHAR_MIN and CHAR_MAX. Include "verify.h". (C_CTYPE_ASCII, C_CTYPE_CONSECUTIVE_DIGITS) (C_CTYPE_CONSECUTIVE_LOWERCASE, C_CTYPE_CONSECUTIVE_UPPERCASE): Define as enum constants with value false, if not defined, so that code can use 'if' instead of 'ifdef'. Using 'if' helps make the code more portable, as both branches of the 'if' are compiled on all platforms. (C_CTYPE_EBCDIC): New constant. (to_char): New static function. (c_isalnum, c_isalpha, c_isdigit, c_islower, c_isgraph, c_isprint) (c_ispunct, c_isupper, c_isxdigit, c_tolower, c_toupper): Rewrite to use 'if' instead of 'ifdef'. Use to_char if non-ASCII. Prefer <= to >=. Prefer true and false to 1 and 0, for booleans. (c_iscntrl): Use 'if', not 'ifdef'. Special case for EBCDIC. Verify that the character set is either ASCII or EBCDIC. * tests/test-c-ctype.c: Include <limits.h>, for CHAR_MIN (to_char): New function. (test_all): Port to EBCDIC. Add some more tests, e.g., for c_ispunct.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Refactor common macros used in tests.Bruno Haible2009-12-241-14/+2
|
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-318/+318
|
* Flush the standard error stream before aborting.Bruno Haible2008-04-111-1/+2
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Unconditionally include <config.h> in unit tests.Eric Blake2007-05-281-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-alloca-opt.c: Remove #ifdef HAVE_CONFIG_H. * tests/test-allocsa.c, tests/test-arcfour.c, tests/test-arctwo.c, tests/test-argmatch.c, tests/test-argp.c, tests/test-array_list.c, tests/test-array_oset.c, tests/test-atexit.c, test-avltree_list.c, test-avltree_oset.c, test-avltreehash_list.c, test-base64.c, test-binary-io.c, test-c-ctype.c, test-c-strcasecmp.c, test-c-strcasestr.c, test-c-strncasecmp.c, test-c-strstr.c, test-canonicalize-lgpl.c, test-carray_list.c, test-crc.c, test-des.c, test-dirname.c, test-fflush.c, test-fprintf-posix.c, test-gc-arcfour.c, test-gc-arctwo.c, test-gc-des.c, test-gc-hmac-md5.c, test-gc-hmac-sha1.c, test-gc-md2.c, test-gc-md4.c, test-gc-md5.c, test-gc-pbkdf2-sha1.c, test-gc-rijndael.c, test-gc-sha1.c, test-gc.c, test-getpass.c, test-hmac-md5.c, test-hmac-sha1.c, test-iconv.c, test-linked_list.c, test-linkedhash_list.c, test-lock.c, test-mbscasecmp.c, test-mbscasestr1.c, test-mbscasestr2.c, test-mbscasestr3.c, test-mbscasestr4.c, test-mbschr.c, test-mbscspn.c, test-mbsncasecmp.c, test-mbspbrk.c, test-mbspcasecmp.c, test-mbsrchr.c, test-mbsspn.c, test-mbsstr1.c, test-mbsstr2.c, test-mbsstr3.c, test-md2.c, test-md4.c, test-md5.c, test-memmem.c, test-printf-posix.c, test-rbtree_list.c, test-rbtree_oset.c, test-rbtreehash_list.c, test-read-file.c, test-rijndael.c, test-snprintf-posix.c, test-snprintf.c, test-sprintf-posix.c, test-stdint.c, test-strcasestr.c, test-striconv.c, test-striconveh.c, test-striconveha.c, test-tls.c, test-vasnprintf-posix.c, test-vasnprintf-posix2.c, test-vasnprintf.c, test-vasprintf-posix.c, test-vasprintf.c, test-verify.c, test-vfprintf-posix.c, test-vprintf-posix.c, test-vsnprintf-posix.c, test-vsnprintf.c, test-vsprintf-posix.c, test-xvasprintf.c: Likewise.
* Better ASSERT macro.Bruno Haible2007-04-291-2/+12
|
* Test for the c-ctype module.Bruno Haible2007-01-141-0/+390