summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* wcsncmp: Add tests.Bruno Haible2023-04-191-0/+182
| | | | | | * tests/test-wcsncmp.c: New file, based on tests/unistr/test-strncmp.h and tests/test-wcscmp.c. * modules/wcsncmp-tests: New file.
* wcscmp: Add tests.Bruno Haible2023-04-191-0/+122
| | | | | * tests/test-wcscmp.c: New file, based on tests/unistr/test-strcmp.h. * modules/wcscmp-tests: New file.
* wmemcmp: Add tests.Bruno Haible2023-04-191-1/+5
| | | | * tests/test-wmemcmp.c (main): Add comment.
* wmemcmp: Add tests.Bruno Haible2023-04-191-0/+91
| | | | | * tests/test-wmemcmp.c: New file, based on tests/unistr/test-cmp.h. * modules/wmemcmp-tests: New file.
* Go back to dynamic largefile, year2038 testsPaul Eggert2023-04-182-12/+22
| | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2023-04/msg00134.html * modules/largefile-tests, modules/year2038-tests (Depends-on): Remove assert-h. * tests/test-largefile.c, tests/test-year2038.c: Test dynamically, not via static_assert.
* file-has-acl tests: Avoid test failures on Cygwin 3.4.6.Bruno Haible2023-04-181-1/+1
| | | | | * tests/test-file-has-acl.sh: Fix distinction between Linux setfacl and Cygwin setfacl.
* c32isgraph: Avoid test failure on Cygwin 3.4.6.Bruno Haible2023-04-181-2/+2
| | | | * tests/test-c32isgraph.c (main): Skip U+00A0 test on Cygwin.
* Slightly nicer largefile, year2038 testsPaul Eggert2023-04-172-21/+15
| | | | | | | | * modules/largefile-tests, modules/year2038-tests (Depends-on): Add assert-h, intprops. * tests/test-largefile.c, tests/test-year2038.c: Prefer compile-time to run-time tests. Don’t assume CHAR_BIT == 8.
* year2038: Add tests.Bruno Haible2023-04-161-0/+39
| | | | | * tests/test-year2038.c: New file. * modules/year2038-tests: New file.
* largefile: Add tests.Bruno Haible2023-04-161-0/+47
| | | | | * tests/test-largefile.c: New file. * modules/largefile-tests: New file.
* posix_spawn_file_actions_addclose tests: Avoid test failure on Cygwin.Bruno Haible2023-04-161-2/+2
| | | | | * tests/test-posix_spawn_file_actions_addclose.c (main): Skip an unportable test also on Cygwin.
* Fix some "make sc_prohibit_leading_TABs" findings.Bruno Haible2023-04-112-19/+19
| | | | | * tests/test-calloc-gnu.c: Expand tabs. * tests/test-regex.c: Likewise.
* c32toupper: Add tests.Bruno Haible2023-04-102-0/+490
| | | | | | * tests/test-c32toupper.sh: New file. * tests/test-c32toupper.c: New file, based on tests/test-c32islower.c. * modules/c32toupper-tests: New file.
* c32tolower: Add tests.Bruno Haible2023-04-102-0/+478
| | | | | | * tests/test-c32tolower.sh: New file. * tests/test-c32tolower.c: New file, based on tests/test-c32isupper.c. * modules/c32tolower-tests: New file.
* striconveh tests: Avoid test failure on glibc 2.15.Bruno Haible2023-04-081-6/+12
| | | | | * tests/test-striconveh.c (main): Skip some of the GB18030 tests on glibc < 2.16.
* vasnwprintf-posix tests: Avoid test failure on mingw.Bruno Haible2023-04-071-2/+2
| | | | | * tests/test-vasnwprintf-posix.c (test_function): For mingw, change two expected test results.
* string-desc-quotearg tests: Avoid a test failure on Haiku.Bruno Haible2023-04-061-2/+6
| | | | | | * tests/test-string-desc-quotearg.c (main): For the clocale_quoting_style, accept also the U+2018 and U+2019 characters in UTF-8 encoding.
* strerrorname_np: Fix compilation error on Haiku.Bruno Haible2023-04-051-1/+1
| | | | | | * lib/strerrorname_np.c (strerrorname_np): Avoid conflict between EDOOFUS and EINVAL. * tests/test-strerrorname_np.c (main): Likewise.
* localename tests: Work around a Haiku bug.Bruno Haible2023-04-051-0/+5
| | | | * tests/test-localename.c (freelocale): New macro.
* uchar: Rename _GL_LARGE_CHAR32_T to _GL_SMALL_WCHAR_T.Bruno Haible2023-04-041-4/+4
| | | | | | | | | | | | | * lib/uchar.in.h (_GL_SMALL_WCHAR_T): Renamed from _GL_LARGE_CHAR32_T. * lib/mbrtoc32.c: Update. * lib/mbsrtoc32s.c: Update. * lib/mbsnrtoc32s.c: Update. * lib/c32tob.c: Update. * lib/c32rtomb.c: Update. * lib/c32srtombs.c: Update. * lib/c32snrtombs.c: Update. * lib/c32is-impl.h: Update. * tests/test-uchar.c: Update.
* tests: Set executable bit on more tests.Bruno Haible2023-04-034-0/+0
| | | | | | | * tests/test-c-dtoastr.sh: Make executable. * tests/test-c-ldtoastr.sh: Likewise. * tests/test-immutable.sh: Likewise. * tests/test-vasnwprintf-posix2.sh: Likewise.
* fix harmless ChangeLog typoJim Meyering2023-04-031-0/+0
|
* tests: set executable bit in test-trim[1-3].shJim Meyering2023-04-032-0/+0
| | | | | | | This avoids a test failure for each new file. * tests/test-trim1.sh: Make this file executable. * tests/test-trim2.sh: Likewise. * tests/test-trim1.sh: Likewise.
* mbstoc32s tests: Check behaviour in the C locale.Bruno Haible2023-04-032-0/+75
| | | | | | | | | * tests/test-mbstoc32s.c (main): Test behaviour in the C locale. Based on tests/test-mbstowcs.c. * tests/test-mbstoc32s-5.sh: New file, based on tests/test-mbstowcs5.sh. * modules/mbstoc32s-tests (Files): Add it. (Depends-on): Add btoc32. (Makefile.am): Run test-mbstoc32s-5.sh.
* mbsnrtoc32s tests: Check behaviour in the C locale.Bruno Haible2023-04-032-0/+86
| | | | | | | | | | * tests/test-mbsnrtoc32s.c (main): Test behaviour in the C locale. Based on tests/test-mbsnrtowcs.c. * tests/test-mbsnrtoc32s-5.sh: New file, based on tests/test-mbsrtowcs5.sh. * modules/mbsnrtoc32s-tests (Files): Add it. (Depends-on): Add btoc32. (Makefile.am): Run test-mbsnrtoc32s-5.sh.
* mbsrtoc32s tests: Check behaviour in the C locale.Bruno Haible2023-04-032-0/+86
| | | | | | | | | | * tests/test-mbsrtoc32s.c (main): Test behaviour in the C locale. Based on tests/test-mbsrtowcs.c. * tests/test-mbsrtoc32s-5.sh: New file, based on tests/test-mbsrtowcs5.sh. * modules/mbsrtoc32s-tests (Files): Add it. (Depends-on): Add btoc32. (Makefile.am): Run test-mbsrtoc32s-5.sh.
* btoc32 tests: Check behaviour in the C locale.Bruno Haible2023-04-032-0/+39
| | | | | | | | * tests/test-btoc32.c (main): Test behaviour in the C locale. Based on tests/test-btowc.c. * tests/test-btoc32-3.sh: New file, based on tests/test-btowc3.sh. * modules/btoc32-tests (Files): Add it. (Makefile.am): Test it.
* mbrtoc32 tests: Prefer *c32* functions.Bruno Haible2023-04-031-1/+1
| | | | | * tests/test-mbrtoc32.c (main): Use btoc32 instead of btowc. * modules/mbrtoc32-tests (Depends-on): Add btoc32.
* mbrtoc32 tests: Add comment.Bruno Haible2023-04-032-2/+9
| | | | | | | | * m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Add comment. * m4/mbrtoc32.m4 (gl_MBRTOC32_C_LOCALE): Add comment. * tests/test-mbrtoc32.c: Add comment. * tests/test-mbrtoc32-5.sh: Use symmetric coding style. * doc/posix-functions/mbrtoc32.texi: Update.
* trim: Add tests.Bruno Haible2023-04-024-0/+193
| | | | | | | | * tests/test-trim.c: New file. * tests/test-trim1.sh: New file. * tests/test-trim2.sh: New file. * tests/test-trim3.sh: New file. * modules/trim-tests: New file.
* 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.
* vasnwprintf-posix: Fix behaviour in the C locale.Bruno Haible2023-04-011-0/+42
| | | | | | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_C is set, implement the 'c' directive here. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, define NEED_WPRINTF_DIRECTIVE_C. * modules/vasnwprintf (Files): Add m4/mbrtowc.m4. * tests/test-vasnwprintf-posix.c (test_function): Add tests of %s and %c in the C locale. * doc/posix-functions/fwprintf.texi: Mention the C locale behaviour bug. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* vasnprintf-posix: Fix crash in narrow %lc directive (regr. 2023-03-21).Bruno Haible2023-04-015-0/+101
| | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): Negative results of local_wcrtomb can now occur; handle them. * tests/test-vasnprintf-posix.c (test_function): Test %lc directive with a wint_t argument that is not a valid wide character. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise.
* Avoid test failures on Android.Bruno Haible2023-03-314-0/+36
| | | | | | | | * tests/test-btowc.c (main): Treat C locale like in tests/test-mbrtowc.c. * tests/test-mbsrtowcs.c (main): Likewise. * tests/test-mbsnrtowcs.c (main): Likewise. * tests/test-mbstowcs.c (main): Likewise.
* mbstowcs: Add tests.Bruno Haible2023-03-316-0/+323
| | | | | | | | | | * tests/test-mbstowcs1.sh: New file, based on tests/test-mbsrtowcs1.sh. * tests/test-mbstowcs2.sh: New file, based on tests/test-mbsrtowcs2.sh. * tests/test-mbstowcs3.sh: New file, based on tests/test-mbsrtowcs3.sh. * tests/test-mbstowcs4.sh: New file, based on tests/test-mbsrtowcs4.sh. * tests/test-mbstowcs5.sh: New file, based on tests/test-mbsrtowcs5.sh. * tests/test-mbstowcs.c: New file, based on tests/test-mbsrtowcs.c. * modules/mbstowcs-tests: New file, based on modules/mbsrtowcs-tests.
* mbstowcs: New module.Bruno Haible2023-03-311-0/+5
| | | | | | | | | | | | | | | * lib/stdlib.in.h (mbstowcs): New declaration. * lib/mbstowcs.c: New file, based on lib/mbstoc32s.c. * m4/mbstowcs.m4: New file. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether mbstowcs is declared. (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize GNULIB_MBSTOWCS. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_MBSTOWCS. * modules/stdlib (Makefile.am): Substitute GNULIB_MBSTOWCS, REPLACE_MBSTOWCS. * modules/mbstowcs: New file. * tests/test-stdlib-c++.cc (mbstowcs): Check signature. * doc/posix-functions/mbstowcs.texi: Mention the C locale behaviour bug and the new module.
* mbsnrtowcs: Fix behaviour in the C locale.Bruno Haible2023-03-302-0/+75
| | | | | | | | | | | | | * m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also mbsnrtowcs. * modules/mbsnrtowcs (Files): Add m4/mbrtowc.m4. * tests/test-mbsnrtowcs.c (main): Add a test of the C locale, based on tests/test-mbsrtowcs.c. * tests/test-mbsnrtowcs5.sh: New file, based on tests/test-mbrtowc5.sh. * modules/mbsnrtowcs-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/mbsnrtowcs.texi: Mention the C locale behaviour bug.
* mbsrtowcs: Fix behaviour in the C locale.Bruno Haible2023-03-302-0/+75
| | | | | | | | | | | | | * m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also mbsrtowcs. * modules/mbsrtowcs (Files): Add m4/mbrtowc.m4. * tests/test-mbsrtowcs.c (main): Add a test of the C locale, based on tests/test-mbrtowc.c. * tests/test-mbsrtowcs5.sh: New file, based on tests/test-mbrtowc5.sh. * modules/mbsrtowcs-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/mbsrtowcs.texi: Mention the C locale behaviour bug.
* mbrlen: Add tests.Bruno Haible2023-03-3014-0/+959
| | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-mbrlen1.sh: New file, based on tests/test-mbrtowc1.sh. * tests/test-mbrlen2.sh: New file, based on tests/test-mbrtowc2.sh. * tests/test-mbrlen3.sh: New file, based on tests/test-mbrtowc3.sh. * tests/test-mbrlen4.sh: New file, based on tests/test-mbrtowc4.sh. * tests/test-mbrlen5.sh: New file, based on tests/test-mbrtowc5.sh. * tests/test-mbrlen.c: New file, based on tests/test-mbrtowc.c. * tests/test-mbrlen-w32-1.sh: New file, based on tests/test-mbrtowc-w32-1.sh. * tests/test-mbrlen-w32-2.sh: New file, based on tests/test-mbrtowc-w32-2.sh. * tests/test-mbrlen-w32-3.sh: New file, based on tests/test-mbrtowc-w32-3.sh. * tests/test-mbrlen-w32-4.sh: New file, based on tests/test-mbrtowc-w32-4.sh. * tests/test-mbrlen-w32-5.sh: New file, based on tests/test-mbrtowc-w32-5.sh. * tests/test-mbrlen-w32-6.sh: New file, based on tests/test-mbrtowc-w32-6.sh. * tests/test-mbrlen-w32-7.sh: New file, based on tests/test-mbrtowc-w32-7.sh. * tests/test-mbrlen-w32.c: New file, based on tests/test-mbrtowc-w32.c. * modules/mbrlen-tests: New file, based on modules/mbrtowc-tests. * doc/posix-functions/mbrlen.texi: Update.
* btowc: Fix behaviour in the C locale.Bruno Haible2023-03-302-0/+28
| | | | | | | | | | | | | | | | | | * lib/btowc.c: Include <string.h> (btowc): Use mbrtowc instead of mbtowc when possible. * m4/btowc.m4 (gl_FUNC_BTOWC): Test for the mingw bug in the C locale. Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also btowc. (gl_PREREQ_BTOWC): Test whether mbrtowc exists. * modules/btowc (Files): Add m4/mbrtowc.m4. (Depends-on): Add mbrtowc. * tests/test-btowc.c (main): Add a test of the C locale, based on tests/test-mbrtowc.c. * tests/test-btowc3.sh: New file, based on tests/test-mbrtowc5.sh. * modules/btowc-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/btowc.texi: Mention the two C locale behaviour bugs and that they are worked around.
* mbrtowc tests: Add comment.Bruno Haible2023-03-302-2/+7
| | | | | | * tests/test-mbrtowc.c: Add comment. * tests/test-mbrtowc5.sh: Use symmetric coding style. * doc/posix-functions/mbrtowc.texi: Update.
* stdlib tests: Check behaviour of C locale.Bruno Haible2023-03-301-1/+12
| | | | * tests/test-stdlib.c (main): Check MB_CUR_MAX.
* string-desc tests: Fix "make distcheck" failure.Bruno Haible2023-03-301-6/+5
| | | | * tests/test-string-desc.sh: Run the test in a subdir.
* string-desc-quotearg: Add tests.Bruno Haible2023-03-291-0/+100
| | | | | * tests/test-string-desc-quotearg.c: New file. * modules/string-desc-quotearg-tests: New file.
* xstring-desc: Add tests.Bruno Haible2023-03-291-0/+84
| | | | | * tests/test-xstring-desc.c: New file. * modules/xstring-desc-tests: New file.
* string-desc: Add tests.Bruno Haible2023-03-292-0/+199
| | | | | | * tests/test-string-desc.sh: New file. * tests/test-string-desc.c: New file. * modules/string-desc-tests: New file.
* wcsstr: Ensure worst-case linear execution time.Bruno Haible2023-03-271-0/+274
| | | | | | | | | | | | | | | | | | | | | | | | | * lib/wchar.in.h (wcsstr): Consider REPLACE_WCSSTR. * lib/wcs-two-way.h: New file, based on lib/str-two-way.h. * lib/wcsstr-impl.h: If requested, use the two-way algorithm. New code based on lib/strstr.c. * m4/wcsstr.m4 (gl_FUNC_WCSSTR_SIMPLE): Renamed from gl_FUNC_WCSSTR. (gl_FUNC_WCSSTR): New macro, based on gl_FUNC_STRSTR in m4/strstr.m4. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSSTR. * modules/wchar (Makefile.am): Substitute REPLACE_WCSSTR. * modules/wcsstr-simple: New file, based on modules/wcsstr. * modules/wcsstr (Description): Document that this module now provides an efficient implementation. (Files): Add lib/wcs-two-way.h. (Depends-on): Depend on wcsstr-simple and the dependencies of the two-way implementation. (configure.ac): Use AC_LIBOBJ instead of a conditional. Don't invoke gl_WCHAR_MODULE_INDICATOR. (Makefile.am): Don't augment lib_SOURCES. * tests/test-wcsstr.c: New file, based on tests/test-strstr.c. * modules/wcsstr-tests: New file, based on modules/strstr-tests. * doc/posix-functions/wcsstr.texi: Mention the worst-case complexity. Mention the new 'wcsstr-simple' module. * doc/posix-functions/strstr.texi: Fix typo.
* Add test case from a past musl libc bug.Bruno Haible2023-03-275-0/+40
| | | | | | | | * tests/test-strstr.c (main): Add test of periodic needle. * tests/test-strcasestr.c (main): Likewise. * tests/test-c-strstr.c (main): Likewise. * tests/test-c-strcasestr.c (main): Likewise. * tests/test-memmem.c (main): Likewise.
* uchar: ISO C 23: Define char8_t.Bruno Haible2023-03-271-3/+11
| | | | | | | | | * lib/uchar.in.h (char8_t): New type or macro. * m4/uchar_h.m4 (gl_TYPE_CHAR8_T): New macro. (gl_UCHAR_H): Invoke it. Set CXX_HAS_CHAR8_TYPE. * modules/uchar (Makefile.am): Substitute CXX_HAS_CHAR8_TYPE, GNULIBHEADERS_OVERRIDE_CHAR8_T. * tests/test-uchar.c: Add tests for char8_t.
* call_once: New module, separate from mtx.Bruno Haible2023-03-251-0/+3
| | | | | | | | | | | | | | | | | | | * lib/threads.in.h (call_once): Declare as part of module 'call_once', not module 'mtx'. * lib/call_once.c: New file, extracted from lib/mtx.c. * lib/mtx.c (call_once): Remove function. * m4/threads_h.m4 (gl_THREADS_H_REQUIRE_DEFAULTS): Inititalize GNULIB_CALL_ONCE. * modules/threads-h (Makefile.am): Substitute GNULIB_CALL_ONCE. * modules/call_once: New file, based on modules/mtx. * modules/threads (Depends-on): Add call_once. * tests/test-threads-c++.cc: Update accordingly. * modules/call_once-tests: New file, based on modules/mtx-tests. * modules/mtx-tests (Files): Remove tests/test-call_once.c. (Makefile.am): Don't compile test-call_once. * doc/posix-functions/call_once.texi: Document that the relevant module is now 'call_once'. * NEWS: Mention the change.