summaryrefslogtreecommitdiff
path: root/tests/unistr
Commit message (Collapse)AuthorAgeFilesLines
* unistr/u*strstr tests: Add more tests.Bruno Haible2023-04-024-0/+41
| | | | | | | | | | | * tests/unistr/test-u-strstr.h (test_u_strstr): Add the two latest tests from tests/test-strstr.c. * tests/unistr/test-u8-strstr.c (U_SET): New macro. * tests/unistr/test-u16-strstr.c (U_SET): New macro. * tests/unistr/test-u32-strstr.c (U_SET): New macro. * modules/unistr/u8-strstr-tests (Depends-on): Add unistr/u8-set. * modules/unistr/u16-strstr-tests (Depends-on): Add unistr/u16-set. * modules/unistr/u32-strstr-tests (Depends-on): Add unistr/u32-set.
* maint: run 'make update-copyright'Simon Josefsson2023-01-01131-131/+131
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-05131-131/+131
| | | | | | | | | 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-01131-131/+131
|
* maint: run 'make update-copyright'Paul Eggert2020-12-31131-131/+131
|
* tests: pacify gcc -fanalyzer on zerosize_ptrPaul Eggert2020-07-012-2/+7
| | | | | | | | | | | | | | * tests/test-memcasecmp.c (main): * tests/test-memchr.c (main): * tests/test-memchr2.c (main): * tests/test-memcmp.c (main): * tests/test-memmem.c (main): * tests/test-memrchr.c (main): * tests/unistr/test-chr.h (main): * tests/unistr/test-cmp.h (test_cmp): Check whether zerosize_ptr returns NULL before using it. This pacifies GCC 10.1’s new fanalyzer option, and matches other uses of zerosize_ptr.
* maint: Run 'make update-copyright'Paul Eggert2019-12-31131-131/+131
|
* tests: Free allocated memory.Bruno Haible2019-03-102-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by <deltatau@protonmail.com> via Assaf Gordon. * tests/test-astrxfrm.c (main): Free allocated memory. * tests/test-bitset.c (compare, check_attributes): Free allocated bitsets. * tests/test-filenamecat.c (main): Free allocated memory. * tests/test-freadahead.c (main): Free allocated memory and close stdin. * tests/test-freadptr.c (main): Likewise. * tests/test-freadptr2.c (main): Free allocated memory. * tests/test-freadseek.c (main): Likewise. * tests/test-gc-arcfour.c (main): Close allocated context. * tests/test-gc-arctwo.c (main): Likewise. * tests/test-gc-des.c (main): Close all allocated contexts. * tests/test-pipe-filter-gi1.c (main): Free allocated memory. * tests/test-pipe-filter-ii1.c (main): Likewise. * tests/test-posix_spawn_file_actions_addchdir.c (main): Destroy the allocated file actions. * tests/test-posix_spawn_file_actions_addclose.c (main): Likewise. * tests/test-posix_spawn_file_actions_adddup2.c (main): Likewise. * tests/test-posix_spawn_file_actions_addopen.c (main): Likewise. * tests/test-sameacls.c (main): Free allocated memory and ACLs. * tests/test-strfmon_l.c (main): Free allocated locales. * tests/test-striconveh.c (main): Free allocated iconv_t objects. * tests/uniconv/test-u8-conv-to-enc.c (main): Free allocated memory. * tests/uniconv/test-u16-conv-to-enc.c (main): Likewise. * tests/uniconv/test-u32-conv-to-enc.c (main): Likewise. * tests/unistr/test-chr.h (main): Free input32. * tests/unistr/test-strchr.h (test_strchr): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-01-01131-131/+131
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-01131-131/+131
|
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-142-4/+4
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-13131-131/+131
|
* version-etc: new yearPaul Eggert2017-01-01131-131/+131
| | | | | | | | | | * 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'.
* Enable Unicode decoder safety unconditionally.Bruno Haible2016-11-198-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unistr.in.h (u32_mbtouc_unsafe): Assume CONFIG_UNICODE_SAFETY. * lib/unistr/u8-mblen.c (u8_mblen): Likewise. * lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise. * lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise. * lib/unistr/u8-prev.c (u8_prev): Likewise. * lib/unistr/u8-strmblen.c (u8_strmblen): Likewise. * lib/unistr/u8-strmbtouc.c (u8_strmbtouc): Likewise. * lib/unistr/u16-mblen.c (u16_mblen): Likewise. * lib/unistr/u16-mbtouc-unsafe.c (u16_mbtouc_unsafe): Likewise. * lib/unistr/u16-mbtouc-unsafe-aux.c (u16_mbtouc_unsafe_aux): Likewise. * lib/unistr/u16-prev.c (u16_prev): Likewise. * lib/unistr/u16-strmblen.c (u16_strmblen): Likewise. * lib/unistr/u16-strmbtouc.c (u16_strmbtouc): Likewise. * lib/unistr/u32-mblen.c (u32_mblen): Likewise. * lib/unistr/u32-mbtouc-unsafe.c (u32_mbtouc_unsafe): Likewise. * lib/unistr/u32-prev.c (u32_prev): Likewise. * lib/unistr/u32-next.c (u32_next): Likewise. * lib/unistr/u32-strmblen.c (u32_strmblen): Likewise. * lib/unistr/u32-strmbtouc.c (u32_strmbtouc): Likewise. * lib/uniconv/u8-conv-to-enc.c (u8_conv_to_encoding): Likewise. * lib/uniconv/u8-strconv-to-enc.c (u8_strconv_to_encoding): Likewise. * tests/unistr/test-u16-prev.c (check_invalid): Enable the CONFIG_UNICODE_SAFETY tests unconditionally. * tests/unistr/test-u32-mblen.c (main): Likewise. * tests/unistr/test-u32-mbtouc.h (test_function): Likewise. * tests/unistr/test-u32-prev.c (check_invalid): Likewise. * tests/unistr/test-u32-next.c (main): Likewise. * tests/unistr/test-u32-strmblen.c (main): Likewise. * tests/unistr/test-u32-strmbtouc.c (main): Likewise. * tests/unistr/test-u32-mbtouc.c (FULL_SAFETY): Remove macro. * lib/unistr/u8-check.c (u8_check): Remove old dead code. * lib/unistr/u8-mbtouc.c (u8_mbtouc): Likewise. * lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise. * lib/unistr/u8-mbtoucr.c (u8_mbtoucr): Likewise. * lib/unistr/u8-uctomb.c (u8_uctomb): Likewise. * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise. * lib/unistr/u16-check.c (u16_check): Update comment. * NEWS: Mention the changes that callers should be aware of.
* version-etc: new yearPaul Eggert2016-01-01131-131/+131
| | | | | | | | | | * 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'.
* unistr/uN-strtok-tests: avoid a trivial leakDaiki Ueno2015-07-071-10/+12
| | | | | * tests/unistr/test-u-strtok.h (test_u_strtok): Untabify. Free input and delim after the multibyte delimiter tests.
* unistr/uN-strtok: handle multibyte delimitersSeiya Kawashima2015-07-034-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, uN_strtok moved PTR to the next unit to the token end. When DELIM contained a multibyte character, the new position could be a middle of a multibyte character. * lib/unistr/u-strtok.h (FUNC): Place PTR at the next character after the token. * lib/unistr/u8-strtok.c (U_STRMBLEN): New macro. * lib/unistr/u16-strtok.c (U_STRMBLEN): New macro. * lib/unistr/u32-strtok.c (U_STRMBLEN): New macro. * modules/unistr/u8-strtok (Depends-on): Depend on unistr/u8-strmblen. * modules/unistr/u16-strtok (Depends-on): Depend on unistr/u16-strmblen. * modules/unistr/u32-strtok (Depends-on): Depend on unistr/u32-strmblen. * tests/unistr/test-u-strtok.h: New file. * tests/unistr/test-u8-strtok.c: New file. * tests/unistr/test-u16-strtok.c: New file. * tests/unistr/test-u32-strtok.c: New file. * modules/unistr/u8-strtok-tests: New file. * modules/unistr/u32-strtok-tests: New file. * modules/unistr/u16-strtok-tests: New file. Copyright-paperwork-exempt: yes Co-authored-by: Daiki Ueno <ueno@gnu.org>
* u{16,32}-strstr-tests: relax timeout conditionDaiki Ueno2015-07-022-2/+2
| | | | | | | | | | On slower platforms (e.g., Solaris 10/SPARC), u{16,32}-strstr tests can take longer than 5 seconds to complete. Reported by Dagobert Michelsen in: https://lists.gnu.org/archive/html/bug-libunistring/2015-06/msg00006.html * tests/unistr/test-u16-strstr.c (main): Increase timeout from 5 seconds to 10 seconds. * tests/unistr/test-u32-strstr.c (main): Likewise.
* version-etc: new yearPaul Eggert2014-12-31127-127/+127
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-01127-127/+127
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-01127-127/+127
| | | | | | 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-01127-127/+127
| | | | Run "make update-copyright".
* uN_strstr: New unit tests.Bruno Haible2011-01-214-0/+354
| | | | | | | | | | * modules/unistr/u8-strstr-tests: New file. * modules/unistr/u16-strstr-tests: New file. * modules/unistr/u32-strstr-tests: New file. * tests/unistr/test-u-strstr.h: New file, based on tests/test-strstr.c. * tests/unistr/test-u8-strstr.c: New file. * tests/unistr/test-u16-strstr.c: New file. * tests/unistr/test-u32-strstr.c: New file.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-01123-123/+123
| | | | Run the new "make update-copyright" rule.
* unistr/u8-mbtouc: Improve handling of ill-formed UTF-8 input.Bruno Haible2010-11-133-2/+220
| | | | | | | | | | | | | | | | | | | | * lib/unistr/u8-mbtouc.c (u8_mbtouc): For an invalid multibyte character, return the number of bytes that belong together, not always 1. * lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise. * lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise. * lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise. * lib/unistr/u8-mbsnlen.c (u8_mbsnlen): Use u8_mbtouc to determine the number of bytes of an invalid character. * tests/unistr/test-u8-mbtouc.c (test_safe_function): New function. (main): Invoke it. * tests/unistr/test-u8-mbtouc.h (test_function): Update two test results. * tests/unistr/test-u8-mbsnlen.c (main): Test various kinds of malformed byte sequences. * modules/unistr/u8-mbtouc (configure.ac): Bump version number. * modules/unistr/u8-mbtouc-unsafe (configure.ac): Likewise. * modules/unistr/u8-mbsnlen (configure.ac): Likewise. Reported by Ben Pfaff and Paolo Bonzini.
* unistr/u8-strchr: Fix a test failure on i586 glibc systems.Bruno Haible2010-09-241-0/+7
| | | | * tests/unistr/test-strchr.h (test_strchr): Disable an invalid check.
* More tests for unistr/u8-strchr.Bruno Haible2010-07-314-7/+164
|
* unistr/u*-chr, unistr/u*-strchr: Fix link errors and warnings.Bruno Haible2010-07-286-0/+6
|
* unistr/u*-strchr: add testsPaolo Bonzini2010-07-234-0/+227
| | | | | | | * modules/unistr/u16-strchr-tests, modules/unistr/u32-strchr-tests, modules/unistr/u8-strchr-tests, tests/unistr/test-strchr.h, tests/unistr/test-u16-strchr.c, tests/unistr/test-u32-strchr.c, tests/unistr/test-u8-strchr.c: New files.
* unistr/u*-chr: test multibyte sequences morePaolo Bonzini2010-07-234-7/+30
| | | | | | | * tests/unistr/test-chr.h: Do complete testing of the characters in the test vector. * tests/unistr/test-u8-chr.c, tests/unistr/test-u32-chr.c, tests/unistr/test-u16-chr.c (U_UCTOMB): Define.
* unistr/u*-chr: test multibyte sequencesPaolo Bonzini2010-07-231-10/+19
| | | | * tests/unistr/test-chr.h: Put characters above 0-127 in the test input.
* unistr/u*-chr: prepare for multibyte testsPaolo Bonzini2010-07-234-8/+16
| | | | | | | | * modules/unistr/u16-chr-tests: Depend on u32-to-u16. * modules/unistr/u8-chr-tests: Depend on u32-to-u8. * tests/unistr/test-chr.h: Build initial version as UCS-4 then convert. * tests/unistr/test-u16-chr.c, tests/unistr/test-u32-chr.c, tests/unistr/test-u8-chr.c: Define U32_TO_U.
* Tests for module 'unistr/u32-strdup'.Bruno Haible2010-01-101-0/+27
|
* Tests for module 'unistr/u16-strdup'.Bruno Haible2010-01-101-0/+27
|
* Tests for module 'unistr/u8-strdup'.Bruno Haible2010-01-102-0/+68
|
* Tests for module 'unistr/u32-strncmp'.Bruno Haible2010-01-101-0/+47
|
* Tests for module 'unistr/u16-strncmp'.Bruno Haible2010-01-101-0/+47
|
* Tests for module 'unistr/u8-strncmp'.Bruno Haible2010-01-102-0/+145
|
* Tests for module 'unistr/u32-strcoll'.Bruno Haible2010-01-101-0/+41
|
* Tests for module 'unistr/u16-strcoll'.Bruno Haible2010-01-101-0/+41
|
* Tests for module 'unistr/u8-strcoll'.Bruno Haible2010-01-101-0/+41
|
* Tests for module 'unistr/u32-strcmp'.Bruno Haible2010-01-102-0/+76
|
* Tests for module 'unistr/u16-strcmp'.Bruno Haible2010-01-102-0/+76
|
* Tests for module 'unistr/u8-strcmp'.Bruno Haible2010-01-103-0/+132
|
* Tests for module 'unistr/u32-strncat'.Bruno Haible2010-01-101-0/+59
|
* Tests for module 'unistr/u16-strncat'.Bruno Haible2010-01-101-0/+59
|
* Tests for module 'unistr/u8-strncat'.Bruno Haible2010-01-102-0/+142
|
* Tests for module 'unistr/u32-strcat'.Bruno Haible2010-01-101-0/+28
|
* Tests for module 'unistr/u16-strcat'.Bruno Haible2010-01-101-0/+28
|
* Tests for module 'unistr/u8-strcat'.Bruno Haible2010-01-102-0/+84
|