summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* gettimeofday tests: Enhance test.Bruno Haible2023-03-081-4/+44
| | | | | | | | * tests/test-gettimeofday.c: Include <stdlib.h> and macros.h. (test_clobber): New function, extracted from main. (test_consistency): New function, based on tests/test-timespec_get.c. (main): Invoke both functions. * modules/gettimeofday-tests (Files): Add macros.h.
* timespec_get tests: Add comment.Bruno Haible2023-03-051-0/+2
| | | | * tests/test-timespec_get.c: Add a comment regarding a glibc bug.
* nl_langinfo tests: Avoid test failure on Solaris 11.Bruno Haible2023-03-021-2/+2
| | | | | * tests/test-nl_langinfo2.c (main): Skip French T_FMT_AMPM test on Solaris.
* unilbrk tests: Fix compilation failures (regression 2023-02-11).Bruno Haible2023-02-188-8/+24
| | | | | | | | | | | | * tests/unilbrk/test-u8-possible-linebreaks.c (main): Outside of libunistring, don't test the backward compatibility function. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u8-width-linebreaks.c (main): Likewise. * tests/unilbrk/test-u16-width-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-width-linebreaks.c (main): Likewise. * tests/unilbrk/test-ulc-width-linebreaks.c (main): Likewise.
* chown, lchown, fchownat tests: Avoid test failure on macOS 12.Bruno Haible2023-02-102-7/+18
| | | | | | * tests/test-chown.h (test_chown): Skip some assertions if getgid() == (gid_t)-1. * tests/test-lchown.h (test_lchown): Likewise.
* nl_langinfo tests: Add another test.Bruno Haible2023-02-082-0/+148
| | | | | | | | | | | * tests/test-nl_langinfo2.c: New file. * tests/test-nl_langinfo2.sh: New file. * modules/nl_langinfo-tests (Files): Add them. Add intl-thread-locale.m4. (Depends-on): Add c-strcasestr, stdbool. (configure.ac): Invoke gt_FUNC_USELOCALE. (Makefile.am): Arrange to compile test-nl_langinfo2 and test it through test-nl_langinfo2.sh.
* nl_langinfo tests: Prepare for adding more tests.Bruno Haible2023-02-082-3/+3
| | | | | | | * tests/test-nl_langinfo1.c: Renamed from tests/test-nl_langinfo.c. * tests/test-nl_langinfo1.sh: Renamed from tests/test-nl_langinfo.sh. Update. * modules/nl_langinfo-tests (Files, Makefile.am): Update.
* setlocale-null: Don't use a lock in Cygwin >= 3.4.6.Bruno Haible2023-02-061-1/+1
| | | | | | | | | Road paved by Corinna Vinschen <vinschen@redhat.com>. * m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Assume that setlocale (LC_ALL, NULL) is multithread-safe in Cygwin >= 3.4.6. * lib/setlocale_null.c: Update comments. * tests/test-setlocale_null-mt-all.c: Likewise.
* c-nullptr: Add tests.Bruno Haible2023-02-062-0/+126
| | | | | | | * tests/test-nullptr.c: New file. * modules/c-nullptr-tests: New file. * tests/test-nullptr-c++.cc: New file. * modules/c-nullptr-c++-tests: New file.
* assert-h, verify: Fix compilation error in C++ mode with MSVC 14.Bruno Haible2023-02-052-0/+7
| | | | | | * lib/verify.h (static_assert): Define _ALLOW_KEYWORD_MACROS. * tests/test-assert-h-c++.cc: Strengthen test. * tests/test-assert-h-c++2.cc: Likewise.
* assert-h, verify: Fix conflict with standard C++ header files on macOS.Bruno Haible2023-02-042-0/+8
| | | | | | | | * lib/verify.h (_Static_assert): Don't redefine with clang ≥ 3.8.0 in C++ mode. * tests/test-assert-h-c++.cc: Also check against conflict with the standard C++ header files. * tests/test-assert-h-c++2.cc: Likewise.
* unistdio/*printf: Fix negative width handling for %U, %lU, %llU.Bruno Haible2023-01-284-0/+1218
| | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): In the code for %U, %lU, %llU, test for the FLAG_LEFT bit in the flags variable. * tests/unistdio/test-u8-printf1.h (test_xfunction): Add tests for width given as argument for the directives %U, %lU, %llU, %s, %a, %f, %e, %g. * tests/unistdio/test-u16-printf1.h (test_xfunction): Likewise. * tests/unistdio/test-u32-printf1.h (test_xfunction): Likewise. * tests/unistdio/test-ulc-printf1.h (test_xfunction): Likewise.
* vasnprintf-posix: Fix possible bug with negative width handling for %lc.Bruno Haible2023-01-282-0/+2
| | | | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): In the code for %lc in vasnprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %c, %lc. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-snprintf-posix.c: Include <wchar.h>, for wint_t. * tests/test-sprintf-posix.c: Likewise. * tests/test-vsnprintf-posix.c: Likewise. * tests/test-vsprintf-posix.c: Likewise.
* vasnprintf-posix: Fix possible bug with negative width handling for %lc.Bruno Haible2023-01-286-0/+308
| | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): In the code for %lc in vasnprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %c, %lc. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-snprintf-posix.c: Include <wchar.h>, for wint_t. * tests/test-sprintf-posix.c: Likewise.
* vasnprintf-posix: Fix negative width handling for %ls directive.Bruno Haible2023-01-284-0/+288
| | | | | | | | | | | | Reported by clang via Po Lu <luangruo@yahoo.com>. * lib/vasnprintf.c (VASNPRINTF): In the code for %ls in vasnprintf and for %s in vasnwprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %s, %ls. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise.
* vasnprintf-posix: Add more unit tests.Bruno Haible2023-01-284-0/+608
| | | | | | | | * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %a, %f, %e, %g. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise.
* login_tty: Ensure declaration in <utmp.h>.Bruno Haible2023-01-213-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-utmp-c++.cc: New file. * modules/utmp-c++-tests: New file. * tests/test-utmp.c: New file. * modules/utmp-tests: New file. * lib/login_tty.c: Include <utmp.h>. * m4/login_tty.m4: New file. (gl_FUNC_LOGIN_TTY): Moved here from m4/pty.m4. Set HAVE_LOGIN_TTY. * m4/pty.m4 (gl_FUNC_LOGIN_TTY): Moved to m4/login_tty.m4. * modules/login_tty (Files): Add m4/login_tty.m4. (Depends-on): Add utmp. Remove pty. Update condition. (configure.ac): Update condition. Invoke gl_UTMP_MODULE_INDICATOR instead of gl_PTY_MODULE_INDICATOR. (Include): List <utmp.h>. * doc/glibc-functions/login_tty.texi: Mark the include file diversity as fixed. * tests/test-login_tty.c: Include <utmp.h>. Don't declare login_tty here. * lib/utmp.in.h: New file. * m4/utmp_h.m4: New file. * modules/utmp: New file. * doc/glibc-headers/utmp.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it.
* alignasof tests: Rename test file.Bruno Haible2023-01-211-1/+1
| | | | | * tests/test-alignasof.c: Renamed from tests/test-stdalign.c. * modules/alignasof-tests (Files, Makefile.am): Update accordingly.
* alignasof tests: Fix GCC warning (regression 2023-01-15).Bruno Haible2023-01-211-0/+1
| | | | * tests/test-stdalign.c (alignas): Undefine before redefine.
* getprogname: Move declaration from "getprogname.h" to <stdlib.h>.Bruno Haible2023-01-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib/stdlib.in.h (getprogname): New declaration. * lib/getprogname.h: Add deprecation warning. (getprogname): Remove declaration. * lib/getprogname.c: Include <stdlib.h> instead of getprogname.h. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether getprogname is declared. (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETPROGNAME. (gl_STDLIB_H_DEFAULTS): Initialize HAVE_GETPROGNAME. * m4/getprogname.m4 (gl_PREREQ_GETPROGNAME): New macro, extracted from gl_FUNC_GETPROGNAME. Set HAVE_GETPROGNAME. (gl_FUNC_GETPROGNAME): Remove code that was moved to gl_PREREQ_GETPROGNAME. * modules/stdlib (Makefile.am): Substitute GNULIB_GETPROGNAME and HAVE_GETPROGNAME. * modules/getprogname (Depends-on): Add stdlib. (configure.ac): Define a module indicator. Invoke gl_PREREQ_GETPROGNAME. (Makefile.am): Don't compile getprogname.c if not needed. (Include): List <stdlib.h> instead of getprogname.h. * tests/test-getprogname.c: Include <stdlib.h> instead of getprogname.h. * NEWS: Mention the change. * lib/argmatch.c: Don't include getprogname.h. * lib/c-stack.c: Likewise. * lib/error.c: Likewise. * lib/git-merge-changelog.c: Likewise.
* execute tests: Avoid test failure with GNU make 4.4.Bruno Haible2023-01-171-6/+5
| | | | | | | | Reported by Eric Blake in <https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00157.html>. * tests/test-execute-main.c (main): Reset the SIGPIPE handler to default on all platforms.
* execute tests: Avoid test failure on Android.Bruno Haible2023-01-171-0/+12
| | | | | * tests/test-execute-main.c (main): Reset the SIGPIPE handler to default.
* hard-locale: Port to Android ≥ 5.0.Bruno Haible2023-01-171-5/+13
| | | | | | | | * lib/hard-locale.c: Include <stdlib.h>. (hard_locale): On Android, consider also MB_CUR_MAX, even if the locale's name is "C". * tests/test-hard-locale.c (test_one, main): Assume that on Android, even the "C" locale is hard.
* stddef tests: Fix compilation error (regression 2023-01-15).Bruno Haible2023-01-161-1/+0
| | | | * tests/test-stddef.c: Don't include <stdalign.h>.
* mbrtowc, mbrtoc32 tests: Avoid test failure on Android ≥ 5.0.Bruno Haible2023-01-162-0/+20
| | | | | | | * tests/test-mbrtowc.c (main): On Android 5.0 or newer, when testing the "C" locale, verify that the encoding is UTF-8. * tests/test-mbrtoc32.c (main): Likewise. * doc/posix-functions/setlocale.texi: Mention the Android problems.
* mbrtowc, mbrtoc32 tests: Refactor.Bruno Haible2023-01-162-32/+76
| | | | | * tests/test-mbrtowc.c (main): Straighten convoluted code. * tests/test-mbrtoc32.c (main): Likewise.
* Use ‘head -n1’ rather than ‘head -1’Paul Eggert2023-01-162-4/+4
| | | | POSIX no longer requires support for ‘head -1’.
* test-framework-sh: work around AIX 7.2 diff bugsPaul Eggert2023-01-141-3/+4
| | | | | | | * tests/init.sh (compare_dev_null_): Run diff in the C locale. AIX 7.2 diff messes up in UTF-8 locales; for example, ‘printf '\360\220\200\200\n' | diff - /dev/null’ incorrectly outputs nothing and exits with status 0 when LC_ALL=en_US.UTF-8.
* login_tty tests: Be more verbose when the test fails.Bruno Haible2023-01-131-4/+31
| | | | | * tests/test-login_tty.c (main): When the test fails, write a message into a file.
* error, verror tests: Add clarification.Bruno Haible2023-01-122-0/+8
| | | | | | | * tests/test-error.c (main): Clarify why we don't test error_at_line with a NULL filename. * tests/test-verror.c (main): Clarify why we don't test verror_at_line with a NULL filename.
* verror: Add tests.Bruno Haible2023-01-122-0/+163
| | | | | | * tests/test-verror.sh: New file, based on tests/test-error.sh. * tests/test-verror.c: New file, based on tests/test-error.c. * modules/verror-tests: New file.
* error: Add tests.Bruno Haible2023-01-122-0/+120
| | | | | | * tests/test-error.sh: New file. * tests/test-error.c: New file. * modules/error-tests: New file.
* spawn-pipe tests: Fix test failure on Android.Bruno Haible2023-01-111-3/+3
| | | | | * tests/test-spawn-pipe-child.c (main): Skip the is_open (STDERR_FILENO) check on Android.
* posix_spawn_file_actions_addfchdir tests: Fix test failure on Android.Bruno Haible2023-01-111-7/+25
| | | | | | | | | * tests/test-posix_spawn-fchdir.c: Include xvasprintf.h. (test): On Android, use "/proc" instead of "/". (main): Determine the relative location of the 'pwd' program accordingly. * modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Add xvasprintf.
* rename, renameat, renameatu: Fix test failures on Android/Termux.Bruno Haible2023-01-111-1/+6
| | | | | * tests/test-rename.h (test_rename): On Android, treat an EACCES failure like EPERM.
* link, linkat tests: Fix test failures on Android/Termux.Bruno Haible2023-01-112-1/+11
| | | | | | | * tests/test-link.h (test_link): On Android, treat an EACCES failure like EPERM. * tests/test-linkat.c (main): When test_link is marked skipped, skip the rest of the test as well.
* link tests: Correct indentation.Bruno Haible2023-01-111-10/+10
| | | | * tests/test-link.h (test_link): Correct indentation.
* update-copyright: also work with two or more updatable lines in a fileJim Meyering2023-01-101-0/+8
| | | | | | * build-aux/update-copyright: Replace every occurrence of the copyright line, not just the first one. * tests/test-update-copyright.sh: Add a test case for this.
* Fix some test failures on Android ≥ 11.Bruno Haible2023-01-109-1/+22
| | | | | | | | | | | | | * tests/test-fclose.c (main): On Android, avoid triggering the file-descriptor sanitizer (fdsan). * tests/test-fdopen.c (main): Likewise. * tests/test-fflush.c (main): Likewise. * tests/test-fgetc.c (main): Likewise. * tests/test-fputc.c (main): Likewise. * tests/test-fread.c (main): Likewise. * tests/test-fseeko4.c (main): Likewise. * tests/test-ftello4.c (main): Likewise. * tests/test-fwrite.c (main): Likewise.
* memset_explicit tests: Fix signature check.Bruno Haible2023-01-101-1/+1
| | | | * tests/test-memset_explicit.c: Fix return type in signature check.
* setlocale-null: Rename LIB_SETLOCALE_NULL to SETLOCALE_NULL_LIB.Bruno Haible2023-01-071-1/+1
| | | | | | * m4/setlocale_null.m4: Rename LIB_SETLOCALE_NULL to SETLOCALE_NULL_LIB. All uses changed. * NEWS: Mention the change
* maint: run 'make update-copyright'Simon Josefsson2023-01-011372-1372/+1372
|
* doc: C2x → C23Paul Eggert2022-12-241-2/+2
|
* posix_spawnp-tests: fix filename typoPaul Eggert2022-12-221-1/+1
| | | | | | | | Problem reported for GNU m4 by Mitchell Dorrell in: https://lists.gnu.org/r/bug-m4/2022-12/msg00000.html * tests/test-posix_spawnp-script.c (DATA_FILENAME): Fix typo in file name that caused race with test-posix_spawn-script.c.
* memset_explicit: new modulePaul Eggert2022-11-281-0/+204
| | | | | | | | | | | | * doc/posix-functions/memset_explicit.texi, lib/memset_explicit.c: * m4/memset_explicit.m4, modules/memset_explicit: * modules/memset_explicit-tests, tests/test-memset_explicit.c: New files. * lib/string.in.h (memset_explict): New decl. * m4/string_h.m4 (gl_STRING_H, gl_STRING_H_REQUIRE_DEFAULTS) (gl_STRING_H_DEFAULTS): * modules/string (string.h): Support memset_explicit.
* Prefer "kill -INT" to killing with a numberPaul Eggert2022-11-263-5/+13
| | | | | | | | | * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): * tests/test-login_tty.c (main): * tests/test-pthread_sigmask1.c (main): * tests/test-sigprocmask.c (main): Prefer "kill -INT" to "kill -N" where N is SIGINT’s value. Don’t assume pid_t fits in int.
* In 'trap' commands, prefer symbolic to numeric signal names.Bruno Haible2022-11-2624-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Mike Fulton <fultonm@ca.ibm.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00130.html>. * gnulib-tool: Use symbolic signal names. * posix-modules: Likewise. * MODULES.html.sh: Likewise. * build-aux/bootstrap (prepare_GNULIB_SRCDIR): Likewise. * build-aux/csharpcomp.sh.in: Likewise. * build-aux/gnu-web-doc-update: Likewise. * top/autogen.sh: Likewise. * top/bootstrap-funclib.sh: Likewise. * top/gitsub.sh: Likewise. * lib/t-idcache: Likewise. * tests/havelib/rpath-1: Likewise. * tests/havelib/rpath-2_a: Likewise. * tests/havelib/rpath-2_b: Likewise. * tests/havelib/rpath-3_a: Likewise. * tests/havelib/rpath-3_b: Likewise. * tests/init.sh: Likewise. * tests/test-binary-io.sh: Likewise. * tests/test-c-stack.sh: Likewise. * tests/test-c-stack2.sh: Likewise. * tests/test-dprintf-posix.sh: Likewise. * tests/test-fpending.sh: Likewise. * tests/test-fprintf-posix.sh: Likewise. * tests/test-lseek.sh: Likewise. * tests/test-printf-posix.sh: Likewise. * tests/test-select-in.sh: Likewise. * tests/test-select-out.sh: Likewise. * tests/test-sigpipe.sh: Likewise. * tests/test-tsearch.sh: Likewise. * tests/test-update-copyright.sh: Likewise. * tests/test-vdprintf-posix.sh: Likewise. * tests/test-vfprintf-posix.sh: Likewise. * tests/test-vprintf-posix.sh: Likewise. * tests/test-xprintf-posix.sh: Likewise. * tests/uniwidth/test-uc_width2.sh: Likewise.
* vc-list-files-tests: Avoid OpenPGP private key operations.Simon Josefsson2022-11-131-0/+7
| | | | * tests/test-vc-list-files-git.sh (GIT_CONFIG_GLOBAL): Set it to /dev/null.
* test-getlogin: pacify gcc -WshadowPaul Eggert2022-10-301-5/+5
| | | | * tests/test-getlogin.h (test_getlogin_result): Rename local.
* Update to Unicode 15.0.0.Bruno Haible2022-10-1673-337/+1137
| | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (is_property_default_ignorable_code_point): Exclude 0x13439..0x1343F. (get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x0ECE, 0x10EFD..0x10EFF, 0x11241, 0x11F00..0x11F01, 0x11F36..0x11F3A, 0x11F40, 0x11F42, 0x13439..0x13440, 0x13447..0x13455, 0x1E08F, 0x1E4EC..0x1E4EF. * All the affected modules: Bump required libunistring version.