tests


Log

Author Commit Date CI Message
Bruno Haible 2f2a5bb2 2024-11-24T19:06:32 gettext-h: Add tests. Suggested by Ben Pfaff <blp@cs.stanford.edu> in <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00186.html>. * tests/test-gettext-h.c: New file. * modules/gettext-h-tests: New file.
Paul Eggert e931bc78 2024-11-20T17:19:45 tests: omit MEMCHR etc as no longer needed * tests/test-memchr.c (MEMCHR): * tests/test-memchr2.c (MEMCHR2): * tests/test-memrchr.c (MEMRCHR): * tests/test-rawmemchr.c (RAWMEMCHR): Remove these macros, as the code never adds to their results. All uses replaced by original functions. * tests/test-memchr.c (lib_memchr, volatile_memchr, memchr)
Paul Eggert 15efa15b 2024-11-20T14:55:32 tests: dissuade unwanted clang optimization Pacify Apple clang 14.0.0 (clang-1400.0.29.202) for arm64-apple-darwin21.6.0 on test-memset_explicit.c, which otherwise complains “warning: null passed to a callee that requires a non-null argument [-Wnonnull]” and presumably could do an unwanted optimization based on this analysis. Do other tests consistently. * tests/test-bsearch.c (lib_bsearch, volatile_bsearch, bsearch): * tests/test-memccpy.c (lib_memccpy, volatile_memccpy, memccpy): * tests/test-memchr.c (lib_memchr, volatile_memchr, memchr): * tests/test-memcmp.c (lib_memcmp, volatile_memcmp, memcmp): * tests/test-memcpy.c (lib_memcpy, volatile_memcpy, memcpy): * tests/test-memmove.c (lib_memmove, volatile_memmove, memmove): * tests/test-memset.c (lib_memset, volatile_memset, memset): * tests/test-memset_explicit.c (lib_memset_explicit) (volatile_memset_explicit, memset_explicit): * tests/test-qsort.c (lib_qsort, volatile_qsort, qsort): * tests/test-strncat.c (lib_strncat, volatile_strncat, strncat): * tests/test-strncmp.c (lib_strncmp, volatile_strncmp, strncmp): * tests/test-strncpy.c (lib_strncpy, volatile_strncpy, strncpy): * tests/test-strndup.c (lib_strndup, volatile_strndup, strndup): * tests/test-wcsncat.c (lib_wcsncat, volatile_wcsncat, wcsncat): * tests/test-wcsncmp.c (lib_wcsncmp, volatile_wcsncmp, wcsncmp): * tests/test-wcsncpy.c (lib_wcsncpy, volatile_wcsncpy, wcsncpy): * tests/test-wmemchr.c (lib_wmemchr, volatile_wmemchr, wmemchr): * tests/test-wmemcmp.c (lib_wmemcmp, volatile_wmemcmp, wmemcmp): * tests/test-wmemcpy.c (lib_wmemcpy, volatile_wmemcpy, wmemcpy): * tests/test-wmemmove.c (lib_wmemmove, volatile_wmemmove, wmemmove): * tests/test-wmemset.c (lib_wmemset, volatile_wmemset, wmemset) Convince the compiler to not optimize based on what it thinks about the function. Callers changed to not use volatile locals, since they should no longer be needed.
Bruno Haible 94f9a1e3 2024-11-20T08:24:31 tests: Silence some more -Wdeprecated-declarations warnings. * tests/test-execute-child.c: Silence warning about sprintf. * tests/test-fstatat.c: Silence warnings about statat and lstatat. * tests/test-statat.c: Add comment.
Collin Funk 2d08d875 2024-11-17T13:05:55 doc: Prefer https urls where possible. * doc/gnulib.texi (POSIXURL): Use https url. * doc/multithread.texi: Use https instead of http where possible. * doc/glibc-functions/*.texi: Likewise. * doc/posix-functions/*.texi: Likewise. * lib/glthread/lock.c: Likewise. * lib/hamt.h: Likewise. * lib/localcharset.c: Likewise. * lib/pipe2.c: Likewise. * lib/pipe.c: Likewise. * lib/sigsegv.c: Likewise. * lib/sigsegv.in.h: Likewise. * lib/sm3.c: Likewise. * lib/sm3.h: Likewise. * lib/sm3-stream.c: Likewise. * lib/stackvma.c: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdnoreturn.in.h: Likewise. * m4/getopt.m4: Likewise. * m4/largefile.m4: Likewise. * m4/stdalign.m4: Likewise. * STATUS-libposix: Likewise. * tests/test-float.c: Likewise. * tests/test-getopt.h: Likewise. * tests/test-setenv.c: Likewise. * tests/test-spawn-pipe-child.c: Likewise. * tests/test-strerror.c: Likewise. * tests/test-strerror_r.c: Likewise. * tests/test-unsetenv.c: Likewise. * users.txt: Likewise.
Bruno Haible f3d96537 2024-11-14T15:56:50 Eliminate gcc -Wzero-as-null-pointer-constant warnings. * lib/argp-help.c: Use NULL, not 0, to denote a null pointer. * lib/argp-parse.c: Likewise. * lib/backup-find.c (get_version): Likewise. * lib/bitset/list.c: Likewise. * lib/bitset/stats.c (bitset_stats_init): Likewise. * lib/bitset/table.c: Likewise. * lib/bitsetv.c (bitsetv_alloc): Likewise. * lib/error.c (print_errno_message): Likewise. * lib/exclude.c (new_exclude_segment): Likewise. * lib/getopt.c (GETOPT_ENTRY): Likewise. * lib/human.c (block_size_args): Likewise. * lib/obstack.c (_obstack_begin_worker, _obstack_newchunk, _obstack_allocated_p, _obstack_free, _obstack_memory_used): Likewise. * lib/quotearg.c (quoting_style_args, quotearg_buffer_restyled, quotearg_alloc_mem): Likewise. * lib/readutmp.c (read_utmp_from_file): Likewise. * lib/savedir.c (comparison_function_table): Likewise. * lib/settime.c (settime): Likewise. * tests/nap.h (nap_works): Likewise. * tests/test-fts.c (argv, fts_dealloc, remove_tree, main): Likewise. * tests/test-getaddrinfo.c (simple): Likewise. * tests/test-nstrftime.h (posixtm_test, TZ, quarter_test, errno_test, locales_test): Likewise. * tests/test-parse-datetime.c (main): Likewise. * tests/test-regex.c (main): Likewise.
Bruno Haible addffe3e 2024-11-14T07:06:25 pthread-rwlock tests: Fix compilation error on AIX with xlc. * m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Cast the NULL pointer. * tests/test-pthread-rwlock-waitqueue.c (do_test): Likewise.
Bruno Haible 21c9d397 2024-11-14T05:22:06 ftello: Add tests for large files. * tests/test-ftello-largefile.c: New file. * modules/ftello-extra-tests: New file. * modules/ftello-tests (Depends-on): Add ftello-extra-tests.
Bruno Haible b18f628d 2024-11-14T05:20:33 fseeko: Add tests for large files. * tests/test-fseeko-largefile.c: New file. * modules/fseeko-extra-tests: New file. * modules/fseeko-tests (Depends-on): Add fseeko-extra-tests.
Bruno Haible b8b070c3 2024-11-06T12:34:18 strncat, wcsncat tests: Fix test. * tests/test-strncat.c (main): Change y to a valid string. * tests/test-wcsncat.c (main): Change y to a valid wide string.
Bruno Haible b3400985 2024-11-06T05:23:51 aligned_alloc tests: Fix compilation error on mingw (regr. 2024-11-04). * tests/test-aligned_alloc.c (aligned_alloc): Don't redefine if aligned_alloc does not exist.
Bruno Haible 4bb67e4e 2024-11-05T21:12:14 wmemset tests: Verify N3322 functionality. * tests/test-wmemset.c: New file. * modules/wmemset-tests: New file.
Bruno Haible f00b47ec 2024-11-05T21:12:11 wmemchr tests: Verify N3322 functionality. * tests/test-wmemchr.c: New file. * modules/wmemchr-tests: New file.
Bruno Haible 9a885197 2024-11-05T21:12:08 wmemcmp tests: Verify N3322 functionality. * tests/test-wmemcmp.c (main): Add zero-size tests.
Bruno Haible 3ee8ce23 2024-11-05T21:12:06 wcsncmp tests: Verify N3322 functionality. * tests/test-wcsncmp.c (main): Add zero-size tests.
Bruno Haible a366348b 2024-11-05T21:11:39 wcsncat tests: Verify N3322 functionality. * tests/test-wcsncat.c: New file. * modules/wcsncat-tests: New file.
Bruno Haible c28fc400 2024-11-05T21:11:29 wmemmove tests: Verify N3322 functionality. * tests/test-wmemmove.c: New file. * modules/wmemmove-tests: New file.
Bruno Haible 184e2c51 2024-11-05T21:11:25 wmemcpy tests: Verify N3322 functionality. * tests/test-wmemcpy.c: New file. * modules/wmemcpy-tests: New file.
Bruno Haible 4e556e28 2024-11-05T21:11:22 wcsncpy tests: Verify N3322 functionality. * tests/test-wcsncpy.c: New file. * modules/wcsncpy-tests: New file.
Bruno Haible a8fccc67 2024-11-05T21:11:20 memset_explicit tests: Verify N3322 functionality. * tests/test-memset_explicit.c (main): Add a zero-size test.
Bruno Haible ce762a90 2024-11-05T21:11:17 memset tests: Verify N3322 functionality. * tests/test-memset.c: New file. * modules/memset-tests: New file.
Bruno Haible 140aff1b 2024-11-05T21:11:14 memchr tests: Verify N3322 functionality. * tests/test-memchr.c (main): Add a zero-size test.
Bruno Haible 5e713ecd 2024-11-05T21:11:12 strncmp tests: Verify N3322 functionality. * modules/strncmp: New file. * doc/posix-functions/strncmp.texi: Mention the new module. * tests/test-strncmp.c: New file. * modules/strncmp-tests: New file.
Bruno Haible 62aeb940 2024-11-05T21:11:10 memcmp tests: Verify N3322 functionality. * tests/test-memcmp.c (main): Add zero-size tests.
Bruno Haible a9309034 2024-11-05T21:11:02 strncat tests: Verify N3322 functionality. * tests/test-strncat.c (main): Add a zero-size test.
Bruno Haible f9da9cbb 2024-11-05T21:10:23 strndup tests: Verify N3322 functionality. * tests/test-strndup.c: New file. * modules/strndup-tests: New file.
Bruno Haible 2590ea7f 2024-11-05T21:10:13 strncpy tests: Verify N3322 functionality. * modules/strncpy: New file. * doc/posix-functions/strncpy.texi: Mention the new module. * tests/test-strncpy.c: New file. * modules/strncpy-tests: New file.
Bruno Haible df58cd94 2024-11-05T21:10:11 memmove tests: Verify N3322 functionality. * tests/test-memmove.c: New file. * modules/memmove-tests: New file.
Bruno Haible bda6e6a0 2024-11-05T21:10:08 memccpy tests: Verify N3322 functionality. * modules/memccpy: New file. * doc/posix-functions/memccpy.texi: Mention the new module. * tests/test-memccpy.c: New file. * modules/memccpy-tests: New file.
Bruno Haible bec31056 2024-11-05T21:10:05 memcpy tests: Verify N3322 functionality. * tests/test-memcpy.c: New file. * modules/memcpy-tests: New file.
Bruno Haible d3c9d629 2024-11-05T21:10:02 qsort tests: Verify N3322 functionality. * modules/qsort: New file. * doc/posix-functions/qsort.texi: Mention the new module. * tests/test-qsort.c: New file. * modules/qsort-tests: New file.
Bruno Haible bc91828e 2024-11-05T21:09:07 bsearch tests: Verify N3322 functionality. * modules/bsearch: New file. * doc/posix-functions/bsearch.texi: Mention the new module. * tests/test-bsearch.c: New file. * modules/bsearch-tests: New file.
Paul Eggert 41be6842 2024-11-04T09:38:03 malloc etc. tests: use volatile more consistently Typically it’s ineffective to use ‘void *volatile p’ when testing malloc and similar functions, as the compiler can optimize the call to malloc before assigning the result to the volatile pointer variable. Instead, be more systematic about calling malloc through a volatile function pointer so that the compiler cannot infer that it is a malloc call. This fix can’t be done for alloca-like functions which may not have a function address, so continue to trust to luck there. * tests/test-aligned-malloc.c (aligned4_malloc, aligned4_free) (aligned8_malloc, aligned8_free, aligned16_malloc) (aligned16_free, aligned32_malloc, aligned32_free): * tests/test-aligned_alloc.c (aligned_alloc): * tests/test-calloc-gnu.c (calloc): * tests/test-free.c (free): * tests/test-malloc-gnu.c (malloc): * tests/test-reallocarray.c (reallocarray): Test indirectly, by calling through a volatile pointer. * tests/test-aligned-malloc.c, tests/test-aligned_alloc.c: * tests/test-calloc-gnu.c, tests/test-calloc-posix.c: * tests/test-free.c, tests/test-malloc-gnu.c: * tests/test-malloc-posix.c, tests/test-realloc-posix.c: * tests/test-reallocarray.c: (main) Don’t bother making data pointers olatile, as it’s ineffective. * tests/test-calloc-gnu.c (identity): * tests/test-free.c (get_errno, get_errno_func): Remove; all uses removed.
Bruno Haible 3d5f0e47 2024-11-04T13:49:22 tests: Add comments. * tests/test-aligned_alloc.c (main): Clarify that we test a zero size. * tests/test-posix_memalign.c (main): Likewise.
Bruno Haible 5c8290b0 2024-11-04T11:47:23 malloc, calloc, realloc tests: Work around clang optimization bug. * tests/test-malloc-posix.c (my_malloc): New variable. * tests/test-calloc-posix.c (my_calloc): New variable. * tests/test-realloc-posix.c (my_realloc): New variable.
Bruno Haible cf3ce55d 2024-10-31T20:54:45 realloc-posix tests: Enhance tests. * tests/test-realloc-posix.c (main): Check errno also after normal failing realloc calls.
Bruno Haible e4424a2c 2024-10-31T20:54:41 realloc-posix tests: Fix memory leak. * tests/test-realloc-posix.c (main): Don't clobber variable 'p' in failing call.
Bruno Haible 2f63858f 2024-10-31T20:54:36 calloc-posix: Add tests. * tests/test-calloc-posix.c: New file. * modules/calloc-posix-tests: New file.
Bruno Haible 7a80523e 2024-10-31T20:54:15 malloc-posix: Add tests. * tests/test-malloc-posix.c: New file. * modules/malloc-posix-tests: New file.
Paul Eggert 99bbb61c 2024-10-30T12:47:02 posix_memalign: check for GNU behavior with size 0 * lib/posix_memalign.c: Include stdckdint.h. (posix_memalign): Test for overflow more straightforwardly, and more portably to unlikely platforms where SIZE_MAX <= INT_MAX. Treat a zero size as if it were alignment. * m4/posix_memalign.m4 (gl_FUNC_POSIX_MEMALIGN): * tests/test-posix_memalign.c (main): Test zero size too. Use volatile to avoid compiler optimizations. * modules/posix_memalign (Depends-on): Add stdckdint.
Paul Eggert e6108a3b 2024-10-30T11:54:57 aligned_alloc: check for GNU behavior with size 0 If someone ever needs to distinguish between GNU and merely POSIX behavior we can split this into two modules, but for now just make this module act like GNU. * lib/aligned_alloc.c (aligned_alloc): Treat zero size like GNU. * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): * tests/test-aligned_alloc.c (main): Test zero size too.
Bruno Haible 6659e016 2024-10-28T00:18:35 realloc-gnu: Replace module with an alias to realloc-posix. * tests/test-realloc-posix.c: Renamed from tests/test-realloc-gnu.c. Add more tests, not yet activated. * modules/realloc-posix-tests: Renamed from modules/realloc-gnu-tests. Test test-realloc-posix instead of test-realloc-gnu. * modules/realloc-gnu: Mark as a deprecated alias of 'realloc-posix'. * lib/stdlib.in.h (realloc): Ignore GNULIB_REALLOC_GNU. * modules/stdlib (Makefile.am): Don't substitute GNULIB_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_GNU. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Don't initialize GNULIB_REALLOC_GNU. (gl_STDLIB_H_DEFAULTS): Don't initialize REPLACE_REALLOC_FOR_REALLOC_GNU. * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Remove macro. * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Update comment. * doc/posix-functions/realloc.texi: Remove description of module 'realloc-gnu'. * MODULES.html.sh (Memory management functions <stdlib.h>): Remove realloc-gnu. Add realloc-posix.
Paul Eggert 11d48307 2024-10-26T10:07:53 posix_memalign-tests: fix message typo * tests/test-posix_memalign.c (main): Fix diagnostic typo.
Sam Russell 8af18a60 2024-10-22T22:16:01 crc: New tests for non-byte-aligned data. * tests/test-crc.c: New tests. * modules/crc-tests (Files): Add dependency on randomb.c Signed-off-by: Simon Josefsson <simon@josefsson.org>
Bruno Haible 427249c6 2024-10-22T22:08:24 execute, spawn-pipe: Support DLL dependencies of Windows executables. Reported by Michele Locati <michele@locati.it>. * lib/windows-path.h: New file. * lib/windows-path.c: New file. * lib/windows-spawn.h (compose_envblock): Add new_PATH parameter. (spawnpvech): Add dll_dirs parameter. Call extended_PATH. * lib/windows-spawn.c: Include windows-path.h. (compose_envblock): Add new_PATH parameter. * modules/windows-spawn (Description): Now applies to Cygwin as well. (Files): Add lib/windows-path.h, lib/windows-path.c. (configure.ac): Define GL_COND_OBJ_WINDOWS_PATH. (Makefile.am): Conditionally compile windows-path.c. (Include): Add windows-path.h. * lib/spawni.c (__spawni): Update compose_envblock call. * lib/execute.h (execute): Add dll_dirs parameter. * lib/execute.c: Include windows-path.h. (execute): Add dll_dirs parameter. Pass it down to spawnpvech. Call extended_environ. * lib/spawn-pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): Add dll_dirs parameter. * lib/spawn-pipe.c: Include windows-path.h. (create_pipe): Add dll_dirs parameter. Pass it down to spawnpvech. Call extended_environ. (create_pipe_bidi, create_pipe_in, create_pipe_out): Add dll_dirs parameter. * lib/javaexec.c (execute_java_class): Update execute invocations. * lib/cygpath.c (execute_and_read_line): Update create_pipe_in invocation. * lib/javaversion.c (execute_and_read_line): Likewise. * lib/csharpcomp.c (compile_csharp_using_mono, compile_csharp_using_dotnet, compile_csharp_using_sscli): Update execute, create_pipe_in invocations. * lib/csharpexec.c (execute_csharp_using_mono, execute_csharp_using_dotnet, execute_csharp_using_sscli): Likewise. * lib/javacomp.c (compile_using_envjavac, compile_using_javac, execute_and_read_line, is_javac_present): Likewise. * lib/pipe-filter-gi.c (pipe_filter_gi_create): Update create_pipe_bidi invocation. * lib/pipe-filter-ii.c (pipe_filter_ii_execute): Likewise. * tests/test-execute-main.c (main): Update execute invocations. * tests/test-execute-script.c (main): Likewise. * tests/test-spawn-pipe-main.c (main): Update create_pipe_bidi invocation. * tests/test-spawn-pipe-script.c (main): Update create_pipe_in invocations. * NEWS: Mention the changes.
Bruno Haible 5e72d251 2024-10-16T22:06:11 crc tests: Add a benchmark program. * tests/macros.h (randomb): New declaration. * tests/randomb.c: New file. * tests/bench-crc.c: New file. * modules/crc-tests (Files): Add them. Add tests/macros.h, tests/bench.h. (Depends-on): Add getrusage, gettimeofday. (Makefile.am): Arrange to compile bench-crc.
Bruno Haible 6aae11ee 2024-10-16T12:46:26 pthread-h tests: Fix a compilation error on MacOS X 10.4. Reported by Sevan Janiyan <venture37@geeklan.co.uk> in <https://lists.gnu.org/archive/html/bug-gnulib/2023-11/msg00183.html>. * tests/test-pthread.c: Omit the PTHREAD_RWLOCK_INITIALIZER test if module 'pthread-rwlock' is not in use.
Bruno Haible dd07b748 2024-10-13T12:01:08 string-desc: New function string_desc_c_casecmp. * lib/string-desc.h: New declaration. * lib/string-desc.c: Include <limits.h>, c-ctype.h. (string_desc_c_casecmp): New function. * modules/string-desc (Depends-on): Add c-ctype. * tests/test-string-desc.c (main): Add tests of string_desc_c_casecmp.
Bruno Haible 588b8d0c 2024-10-03T20:45:59 bcp47: Add tests. * tests/test-bcp47.c: New file. * modules/bcp47-tests: New file.
Paul Eggert 8682f4d3 2024-10-02T17:40:34 file-has-acl: no need for struct stat Change the API of the new file_has_aclinfo function so that it no longer needs a struct stat *. In some cases this can help GNU ls avoid an unnecessary ‘stat’ call for each file it lists, which can be a significant win. * lib/acl.h (ACL_SYMLINK_NOFOLLOW): Change from 1 to UCHAR_MAX+1 so that it can be ORed with any d_type value. * lib/file-has-acl.c: Include dirent.h, for the DT_* macros. Check that ACL_SYMLINK_NOFOLLOW is outside unsigned char range. (file_has_aclinfo): Change API so that struct stat is no longer needed. Instead, the file type (if known) is passed as part of the flags. All callers changed. Simplify NFSv4 code. * modules/file-has-acl (Depends-on): Add assert-h for static_assert, and dirent for DT_* macros. * tests/test-file-has-acl.c: Include dirent.h. (main): Adjust to file_has_aclinfo API change. Briefly test ACL_SYMLINK_FOLLOW.
Paul Eggert fc6d90e0 2024-10-01T19:56:18 file-has-acl-tests: omit string.h include Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2024-10/msg00001.html * tests/test-file-has-acl.c: Don’t include string.h.
Paul Eggert ccc26add 2024-09-29T16:13:53 file-has-acl: new function file_has_aclinfo This is for GNU coreutils, whose ‘ls’ can be made faster with the new function because it means (for example) that ‘ls’ needn’t call both listxattr and lgetxattr in the common case where the file has no extended attributes. * lib/acl.h (ACL_SYMLINK_FOLLOW): New constant. (struct aclinfo): New type. * lib/file-has-acl.c (UNKNOWN_SECURITY_CONTEXT): New constant. (USE_LINUX_XATTR): New macro. When set: Include stdint.h (for uint32_t). If also USE_SELINUX_SELINUX_H, include selinux/selinux.h (for getfilecon). If HAVE_SMACK, include <sys/smack.h>, otherwise provide substitutes for smack_smackfs_path and smack_new_label_from_path. (is_smack_enabled): New function. (aclinfo_has_xattr): Rename from have_xattr and make it extern. Use struct aclinfo const * arg instead of char const * and ssize_t. Work even if ai->size < 0. Supply a no-op macro on platforms lacking xattr. (get_aclinfo): New static function, much of it taken from coreutils/src/ls.c. (file_has_aclinfo): New function, which generalizes file_has_acl to provide more info. Its body is taken from the old file_has_acl with new stuff from ls.c. (file_has_acl): Use it. (aclinfo_scontext_free, aclinfo_free): Nwew functions, if not already no-op macros. * m4/acl.m4 (gl_FUNC_ACL_ARG): Add --without-libsmack option. (gl_FILE_HAS_ACL): Check for libsmack, selinux. * m4/selinux-selinux-h.m4 (gl_CHECK_HEADER_SELINUX_SELINUX_H): New macro, for use by file-has-acl. Rename HAVE_SELINUX_SELINUX_H to USE_SELINUX_SELINUX_H to avoid confusion as to whether we have <selinux/selinux.h>; all uses changed. (gl_HEADERS_SELINUX_SELINUX_H): Use the new macro. * modules/file-has-acl (Files): Add m4/selinux-selinux-h.m4. (Depends-on): Add errno, ssize_t. * tests/test-file-has-acl.c (main): Add a little test for file_has_aclinfo.
Bruno Haible 81fb1f33 2024-09-26T17:01:36 string-buffer tests: Avoid test failure on native Windows. Reported by Michele Locati <mlocati@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00135.html>. * tests/test-string-buffer.c (main): Skip a wchar_t test on native Windows.
Bruno Haible db23a7ea 2024-09-25T17:19:41 string-buffer: Add more API. * lib/string-buffer.h: Include string-desc.h. (sb_append1, sb_append_desc): New declarations. (sb_append_c): Renamed from sb_append. (sb_contents, sb_contents_c, sb_dupfree): New declarations. (sb_dupfree_c): Renamed from sb_dupfree. * lib/string-buffer.c (sb_append1, sb_append_desc): New functions. (sb_append_c): Renamed from sb_append. (sb_contents, sb_contents_c, sb_dupfree): New functions. (sb_dupfree_c): Renamed from sb_dupfree. Optimize. * modules/string-buffer (Depends-on): Add string-desc. * tests/test-string-buffer.c (main): Use sb_append_c instead of sb_append. Use sb_dupfree_c instead of sb_dupfree. Test also sb_append1, sb_append_desc, sb_contents. * NEWS: Mention the changes.
Bruno Haible 778a55c4 2024-09-24T18:31:49 string-buffer: Remove INT_MAX limitation. * lib/string-buffer.h (sb_appendvf, sb_appendf): Document that errno is set upon failure. * lib/string-buffer-printf.c: Include <errno.h>. (sb_appendvf): Call vsnzprintf instead of vsnprintf. Ensure errno is set upon failure. (sb_appendf): Likewise. * modules/string-buffer (Depends-on): Add vsnzprintf-posix. Remove vsnprintf-posix. * tests/test-string-buffer.c (main): Test error code from sb_appendf.
Bruno Haible 5a7754d1 2024-09-24T12:31:07 sfl-istream: Add tests. * tests/test-sfl-istream.c: New file, based on tests/test-sf-istream.c. * modules/sfl-istream-tests: New file.
Bruno Haible 357c5d52 2024-09-24T12:30:58 sf-istream: Add tests. * tests/test-sf-istream.c: New file. * modules/sf-istream-tests: New file.
Bruno Haible 2db45a0f 2024-09-23T16:03:07 utimens: Fix test failure on NetBSD 10 (regression 2024-09-16). * lib/utimens.h (utimens): Declare as an override if utimens exists in libc. (lutimens): Declare as an override if lutimens exists in libc. * lib/utimens.c (is_valid_timespec, is_valid_timespecs): New functions, extracted from validate_timespec. (validate_timespec): Call is_valid_timespecs. (utimens, lutimens): On NetBSD, validate the argument before calling NetBSD's libc function. * tests/test-utimens-common.h (check_ctime): Set to -1 on NetBSD.
Paul Eggert c6942e47 2024-09-20T19:24:39 sigsegv-tests: port to GCC 14 GCC 14 on x86-64 with -O2 apparently outsmarts our test for null pointer dereference, and this is something the C standard allows. Fix the test by putting ‘volatile’ at the right place. * tests/test-sigsegv-catch-stackoverflow2.c (null_pointer): Make it a volatile pointer, not a pointer to volatile. Also, rename from null_pointer_to_volatile_int; use changed.
Bruno Haible 5eee46d1 2024-09-20T17:17:36 jit/cache tests: Fix crash with clang's UBSAN + ASAN. * tests/jit/test-cache.c (clang_ubsan_workaround): New variable. (CODE, SET_CODE): Use it. (main): Initialize it.
Bruno Haible 9fee05f0 2024-09-16T22:40:40 unilbrk tests: Avoid two gcc -Wparentheses warnings. * tests/unilbrk/test-uc-possible-linebreaks.c (main): Add redundant parentheses.
Bruno Haible 1aee1fe7 2024-09-15T15:27:34 unilbrk: Strengthen tests. * lib/gen-uni-tables.c: Add shell commands for creating tests/unilbrk/LineBreakTest.txt. * tests/unilbrk/LineBreakTest.txt: New file, from unicode.org. * tests/unilbrk/test-uc-possible-linebreaks.c: New file, based on tests/uniwbrk/test-uc-wordbreaks.c. * tests/unilbrk/test-uc-possible-linebreaks.sh: New file, based on tests/uniwbrk/test-uc-wordbreaks.sh. * modules/unilbrk/u32-possible-linebreaks-tests (Files): Add them. (Makefile.am): Arrange to compile test-uc-possible-linebreaks.c and test test-uc-possible-linebreaks.sh.
Bruno Haible 54d66d91 2024-09-15T15:20:08 uniwbrk tests: Modernize code. * tests/uniwbrk/test-uc-wordbreaks.c (main): Reduce the scope of local variables. Remove memset() calls. Align expected and actial output lines. Add comments.
Bruno Haible 60748cab 2024-09-15T15:16:52 unigbrk tests: Modernize code. * tests/unigbrk/test-uc-grapheme-breaks.c (main): Reduce the scope of local variables. Add comments. * tests/unigbrk/test-uc-is-grapheme-break.c (main): Likewise.
Bruno Haible 8fc19467 2024-09-13T15:25:05 Implement a new property, added by Unicode 16.0.0. * lib/gen-uni-tables.c (is_property_modifier_combining_mark): New function. (output_properties): Output also the property modifier_combining_mark. * lib/unictype.in.h (UC_PROPERTY_MODIFIER_COMBINING_MARK, uc_is_property_modifier_combining_mark): New declarations. * m4/unictype_h.m4 (gl_UNICTYPE_H_REQUIRE_DEFAULTS): Initialize GNULIB_UNICTYPE_PROPERTY_MODIFIER_COMBINING_MARK. * modules/unictype/base (Makefile.am): Substitute GNULIB_UNICTYPE_PROPERTY_MODIFIER_COMBINING_MARK. * lib/unictype/pr_modifier_combining_mark.c: New file. * lib/unictype/pr_modifier_combining_mark.h: New generated file. * modules/unictype/property-modifier-combining-mark: New file. * tests/unictype/test-pr_modifier_combining_mark.c: New generated file. * modules/unictype/property-modifier-combining-mark-tests: New file. * lib/unictype/pr_byname.gperf: Add modifier_combining_mark. * lib/unictype/pr_byname.c (UC_PROPERTY_INDEX_MODIFIER_COMBINING_MARK): New enum item. (uc_property_byname): Handle it. * modules/unictype/property-byname (Depends-on): Add unictype/property-modifier-combining-mark. * modules/unictype/property-all (Depends-on): Likewise. * MODULES.html.sh (func_all_modules): Add unictype/property-modifier-combining-mark.
Bruno Haible 02a0e123 2024-09-13T15:17:49 Update to Unicode 16.0.0. * lib/gen-uni-tables.c (PROP_MODIFIER_COMBINING_MARK): New enum item. (fill_properties): Recognize property Modifier_Combining_Mark. (UC_JOINING_GROUP_KASHMIRI_YEH): New enum item. (fill_arabicshaping, joining_group_as_c_identifier): Handle UC_JOINING_GROUP_KASHMIRI_YEH. (LBP_*): Split LBP_AL into LBP_AL1 and LBP_AL2. (LBP_AL): New enum item. (get_lbea): New function. (get_lbp): Use it. Update such that unilbrk/lbrkprop.txt comes out as expected. Map U+25CC to LBP_AL2. (PROP_EA, PROP, EA): New macros. (debug_output_lbp): Print either LBP_AL1, LBP_AL2 as LBP_AL. (lbp_value_to_string): Handle LBP_AL1, LBP_AL2 instead of LBP_AL. (struct lbpea_table): Renamed from struct lbp_table. (output_lbpea): Renamed from output_lbp. Store both the line break property and the line break EastAsian bit in the same table entry. (output_lbrk_tables): Update. (output_lbrk_rules_as_tables): Update for LBP_AL change. Implement rules LB28a, LB25, LB19, LB15d, LB13 as specified by https://www.unicode.org/reports/tr14/tr14-53.html. (get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected. * lib/unictype.in.h (UC_JOINING_GROUP_KASHMIRI_YEH): New enum item. * lib/unictype/joininggroup_byname.gperf: Handle it. * lib/unictype/joininggroup_name.h: Likewise. * lib/unilbrk/lbrktables.h: Split LBP_AL into LBP_AL1 and LBP_AL2. (LBP_AKLS_VI): New enum item, for rule LB28a. (PROP, EA, PROP_EA): New macros. (unilbrk_table): Update bounds. * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop): Use LBP_AL1 instead of LBP_AL. Use 2 characters of lookahead, for rules LB15c, LB19a, LB25, LB28a. New variables prev_ea, prev2_ea, for rule LB19a. New variable prev_initial_hyphen, for rule LB20a. New variable prev_nus, for rule LB25. Implement rules LB15c, LB19a, LB20a, LB21a, LB25, LB28a, as specified by https://www.unicode.org/reports/tr14/tr14-53.html. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop): Likewise. * modules/unilbrk/base (Depends-on): Add stdbool. * tests/uninorm/test-u32-normalize-big.h (struct normalization_test_file): Now 6 parts. * tests/uninorm/test-u32-normalize-big.c (read_normalization_test_file): Fill in 6 parts. (test_specific, free_normalization_test_file): Now handle 6 parts. * tests/uniwidth/test-uc_width2.sh: Update expected test result. * 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. * All the affected modules: Bump required libunistring version.
Bruno Haible 30cfcf6f 2024-09-03T23:00:28 tests: Strenghten tests with invalid file descriptor. * tests/test-close.c: Include <fcntl.h>. (main): Check that AT_FDCWD is recognized as an invalid file descriptor. * tests/test-dup.c: Include <fcntl.h>. (main): Check that AT_FDCWD is recognized as an invalid file descriptor. * tests/test-unlockpt.c: Include <fcntl.h>. (main): Check that AT_FDCWD is recognized as an invalid file descriptor. * tests/test-fchdir.c (main): Likewise. * tests/test-fdatasync.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-fsync.c (main): Likewise. * tests/test-isatty.c (main): Likewise.
Bruno Haible 9654cddd 2024-09-03T13:32:40 unlockpt tests: Avoid test failure on Haiku. * tests/test-unlockpt.c (main): Skip the test on Haiku. * doc/posix-functions/unlockpt.texi: Update platforms list.
Bruno Haible 63107d97 2024-09-02T13:49:05 vma-prot tests: Strengthen test. Found by Coverity. * tests/test-vma-prot.c (main): Fix typo.
Bruno Haible 66c0b5d1 2024-09-02T09:27:04 utime, futimens tests: Avoid test failure on Haiku. * tests/test-utimens-common.h (checkable_atime): On Haiku, return false.
Simon Josefsson bf31b26b 2024-09-01T15:05:24 Avoid using postal address in license * lib/dfa.h, lib/dfa.c: Update license header. * lib/localeinfo.h, lib/localeinfo.c: Likewise. * tests/test-dfa-match-aux.c: Likewise.
Bruno Haible b9927fb5 2024-09-01T13:09:59 Fix mbscasestr test failure on native Windows with MSVC. * lib/c32to-impl.h (FUNC): On native Windows, ignore the system's towlower/towupper function entirely. * tests/test-c32tolower.c (main): On native Windows, reenable test that previously failed. * tests/test-c32toupper.c (main): Likewise. Disable two other tests on native Windows. * doc/posix-functions/towlower.texi: Mention bug in the native Windows UTF-8 locale. * doc/posix-functions/towupper.texi: Likewise.
Bruno Haible a1ef769e 2024-09-01T00:13:49 tests: Avoid some test failures on Android. * tests/test-c32isalpha.c (main): Disable tests that fail on Android. * tests/test-c32iscntrl.c (main): Likewise. * tests/test-c32isgraph.c (main): Likewise. * tests/test-c32islower.c (main): Likewise. * tests/test-c32isprint.c (main): Likewise. * tests/test-c32ispunct.c (main): Likewise. * tests/test-c32toupper.c (main): Likewise.
Bruno Haible a8e4f8fb 2024-09-01T00:13:39 tests: Avoid some test failures on OpenBSD 7.5. * tests/test-c32isalpha.c (main): Disable tests that fail on OpenBSD 7.5. * tests/test-c32iscntrl.c (main): Likewise. * tests/test-c32isgraph.c (main): Likewise. * tests/test-c32islower.c (main): Likewise. * tests/test-c32isprint.c (main): Likewise. * tests/test-c32ispunct.c (main): Likewise. * tests/test-c32toupper.c (main): Likewise.
Bruno Haible c4bc471b 2024-08-31T19:22:37 tests: Strengthen LC_CTYPE tests on OpenBSD, Android, Haiku. * m4/locale-en.m4: New file, based on m4/locale-fr.m4. * m4/locale-ar.m4 (gt_LOCALE_AR): Update comments. * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise. * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise. * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise. * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise. * modules/btoc32-tests (Files): Add m4/locale-en.m4. (configure.ac): Invoke gt_LOCALE_EN_UTF8. (Makefile.am): Set LOCALE_EN_UTF8 in TESTS_ENVIRONMENT. * modules/btowc-tests: Likewise. * modules/c32isalnum-tests: Likewise. * modules/c32isalpha-tests: Likewise. * modules/c32isblank-tests: Likewise. * modules/c32iscntrl-tests: Likewise. * modules/c32isdigit-tests: Likewise. * modules/c32isgraph-tests: Likewise. * modules/c32islower-tests: Likewise. * modules/c32isprint-tests: Likewise. * modules/c32ispunct-tests: Likewise. * modules/c32isspace-tests: Likewise. * modules/c32isupper-tests: Likewise. * modules/c32isxdigit-tests: Likewise. * modules/c32rtomb-tests: Likewise. * modules/c32snrtombs-tests: Likewise. * modules/c32srtombs-tests: Likewise. * modules/c32stombs-tests: Likewise. * modules/c32tolower-tests: Likewise. * modules/c32toupper-tests: Likewise. * modules/fnmatch-tests: Likewise. * modules/iswdigit-tests: Likewise. * modules/iswxdigit-tests: Likewise. * modules/mbmemcasecmp-tests: Likewise. * modules/mbmemcasecoll-tests: Likewise. * modules/mbrlen-tests: Likewise. * modules/mbrtoc16-tests: Likewise. * modules/mbrtoc32-tests: Likewise. * modules/mbrtowc-tests: Likewise. * modules/mbscasestr-tests: Likewise. * modules/mbscspn-tests: Likewise. * modules/mbsinit-tests: Likewise. * modules/mbslen-tests: Likewise. * modules/mbsnlen-tests: Likewise. * modules/mbsnrtoc32s-tests: Likewise. * modules/mbsnrtowcs-tests: Likewise. * modules/mbspbrk-tests: Likewise. * modules/mbsrtoc32s-tests: Likewise. * modules/mbsrtowcs-tests: Likewise. * modules/mbsspn-tests: Likewise. * modules/mbsstr-tests: Likewise. * modules/mbstoc32s-tests: Likewise. * modules/mbstowcs-tests: Likewise. * modules/mcel-tests: Likewise. * modules/trim-tests: Likewise. * modules/unicodeio-tests: Likewise. * modules/wcrtomb-tests: Likewise. * modules/wcsnrtombs-tests: Likewise. * modules/wcsrtombs-tests: Likewise. * tests/test-btoc32-3.sh: If LOCALE_FR_UTF8 is 'none', try LOCALE_EN_UTF8 instead. * tests/test-btowc-3.sh: Likewise. * tests/test-c32isalnum.sh: Likewise. * tests/test-c32isalpha.sh: Likewise. * tests/test-c32isblank.sh: Likewise. * tests/test-c32iscntrl.sh: Likewise. * tests/test-c32isdigit.sh: Likewise. * tests/test-c32isgraph.sh: Likewise. * tests/test-c32islower.sh: Likewise. * tests/test-c32isprint.sh: Likewise. * tests/test-c32ispunct.sh: Likewise. * tests/test-c32isspace.sh: Likewise. * tests/test-c32isupper.sh: Likewise. * tests/test-c32isxdigit.sh: Likewise. * tests/test-c32rtomb.sh: Likewise. * tests/test-c32snrtombs-3.sh: Likewise. * tests/test-c32srtombs-3.sh: Likewise. * tests/test-c32stombs-3.sh: Likewise. * tests/test-c32tolower.sh: Likewise. * tests/test-c32toupper.sh: Likewise. * tests/test-fnmatch-3.sh: Likewise. * tests/test-iswdigit.sh: Likewise. * tests/test-iswxdigit.sh: Likewise. * tests/test-mbmemcasecmp-3.sh: Likewise. * tests/test-mbmemcasecoll-3.sh: Likewise. * tests/test-mbrlen-3.sh: Likewise. * tests/test-mbrtoc16-3.sh: Likewise. * tests/test-mbrtoc32-3.sh: Likewise. * tests/test-mbrtowc-3.sh: Likewise. * tests/test-mbscasestr2.sh: Likewise. * tests/test-mbscspn.sh: Likewise. * tests/test-mbsinit.sh: Likewise. * tests/test-mbslen.sh: Likewise. * tests/test-mbsnlen.sh: Likewise. * tests/test-mbsnrtoc32s-3.sh: Likewise. * tests/test-mbsnrtowcs-3.sh: Likewise. * tests/test-mbspbrk.sh: Likewise. * tests/test-mbsrtoc32s-3.sh: Likewise. * tests/test-mbsrtowcs-3.sh: Likewise. * tests/test-mbsspn.sh: Likewise. * tests/test-mbsstr2.sh: Likewise. * tests/test-mbstoc32s-3.sh: Likewise. * tests/test-mbstowcs-3.sh: Likewise. * tests/test-mcel-3.sh: Likewise. * tests/test-trim2.sh: Likewise. * tests/test-unicodeio2.sh: Likewise. * tests/test-wcrtomb.sh: Likewise. * tests/test-wcsnrtombs-3.sh: Likewise. * tests/test-wcsrtombs-3.sh: Likewise.
Bruno Haible ac6fb528 2024-08-30T23:48:44 posix_openpt tests: Fix test failure on Haiku. * tests/test-posix_openpt.c (main): On Haiku, create a child process and call setsid().
Bruno Haible 389788a7 2024-08-29T22:52:02 vma-prot: Add tests. * tests/test-vma-prot.c: New file. * modules/vma-prot-tests: New file.
Marc Nieper-Wißkirchen fb59a67f 2024-08-29T11:15:11 libgmp-mpq: Add tests. * modules/libgmp-mpq-tests: New file. * tests/test-libgmp-mpq.c: New file.
Bruno Haible 9f961994 2024-08-28T14:16:08 libgmp-mpz: New module, renamed from libgmp. * modules/libgmp-mpz: Renamed from modules/libgmp. * modules/libgmp: New file. * modules/libgmp-mpz-tests: Renamed from modules/libgmp-tests. * tests/test-libgmp-mpz.c: Renamed from tests/test-libgmp.c.
Bruno Haible 61720eb1 2024-08-27T16:20:16 Explicitly exclude clang when we test for a GCC version >= 4.3. Rationale: clang can disguise as any possible GCC version. * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__, exclude clang. * lib/_Noreturn.h (_Noreturn): Likewise. * lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise. * lib/base32.h: Likewise. * lib/base64.h: Likewise. * lib/dfa.c (FALLTHROUGH): Likewise. * lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise. * lib/intprops-internal.h: Likewise. * lib/jit/cache.h (clear_cache): Likewise. * lib/malloc.in.h (memalign): Likewise. * lib/mcel.h: Likewise. * lib/regex.h: Likewise. * lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise. * lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile): Likewise. * lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc, canonicalize_file_name, malloc, realloc): Likewise. * lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise. * lib/verify.h: Likewise. * lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise. * lib/xalloc-oversized.h (xalloc_oversized): Likewise. * lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR, _FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different builtins for clang. * lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude clang. Enable for clang >= 4. * lib/astrxfrm.c: Use _GL_GNUC_PREREQ. * lib/readutmp.c: Likewise. * lib/strftime.c: Likewise. * tests/test-asyncsafe-linked_list-strong.c: Likewise. * tests/test-asyncsafe-linked_list-weak.c: Likewise. * tests/test-c-strtod-mt.c: Likewise. * tests/test-c-strtof-mt.c: Likewise. * tests/test-c-strtold-mt.c: Likewise. * tests/test-gmtime_r-mt.c: Likewise. * tests/test-intprops.c: Likewise. * tests/test-limits-h.c: Likewise. * tests/test-localtime_r-mt.c: Likewise. * tests/test-memrchr.c: Likewise. * tests/test-nl_langinfo-mt.c: Likewise. * tests/test-setlocale_null-mt-all.c: Likewise. * tests/test-setlocale_null-mt-one.c: Likewise. * tests/test-statat.c: Likewise. * tests/test-xvasprintf.c: Likewise.
Bruno Haible 3ca40667 2024-08-27T00:49:07 Fix a test failure from a clang that masquerades as gcc 13. * tests/test-fenv-except-trapping-2.c (main): Skip the '4' test on clang, since clang 17 still generates buggy comparisons, like gcc versions < 8.
Bruno Haible e9508205 2024-08-27T00:19:14 Fix some of the warnings from a clang that masquerades as gcc 13. * lib/c-stack.c: Use _GL_GNUC_PREREQ to test for the gcc version. * lib/canonicalize.c: Likewise. * lib/diffseq.h: Likewise. * lib/file-has-acl.c: Likewise. * lib/freopen-safer.c: Likewise. * lib/getndelim2.c: Likewise. * lib/mini-gmp-gnulib.c: Likewise. * lib/propername.c: Likewise. * lib/quotearg.c: Likewise. * lib/savedir.c: Likewise. * lib/vasnprintf.c: Likewise. * tests/test-argmatch.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-explicit_bzero.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-fopen.h: Likewise. * tests/test-getdtablesize.c: Likewise. * tests/test-getgroups.c: Likewise. * tests/test-listen.c: Likewise. * tests/test-localename.c: Likewise. * tests/test-memset_explicit.c: Likewise. * tests/test-open.h: Likewise. * tests/test-perror2.c: Likewise. * tests/test-select.h: Likewise. * lib/stdio.in.h (_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD): Don't use gnu_printf with clang. * lib/string-buffer.h: Likewise. * lib/textstyle.in.h: Likewise.
Bruno Haible e9655b05 2024-08-24T17:59:26 copy-file: First step towards more consistent function names. * lib/copy-file.h (xcopy_file_preserving): New declaration. (copy_file_preserving): Mark deprecated. * lib/copy-file.c (xcopy_file_preserving): Renamed from copy_file_preserving. (copy_file_preserving): New function. * tests/test-copy-file.c (main): Test xcopy_file_preserving instead of copy_file_preserving.
Bruno Haible 8a718331 2024-08-24T17:58:48 acl: First step towards more consistent function names. * lib/acl.h (xset_acl): New declaration. (set_acl): Mark deprecated. (xcopy_acl): New declaration. (copy_acl): Mark deprecated. * lib/set-acl.c (xset_acl): Renamed from set_acl. (set_acl): New function. * lib/copy-acl.c (xcopy_acl): Renamed from copy_acl. (copy_acl): New function. * tests/test-set-mode-acl.c (main): Test xset_acl instead of set_acl. * tests/test-copy-acl.c (main): Test xcopy_acl instead of copy_acl.
Bruno Haible b63008c3 2024-08-19T16:21:27 hasmntopt: Add tests. * tests/test-hasmntopt.c: New file. * modules/hasmntopt-tests: New file.
Collin Funk 3f206a33 2024-08-16T21:22:31 pty tests: Add C tests. * modules/pty-tests (Files): Add tests/test-pty.c. (Makefile.am): Add the new program. * tests/test-pty.c: New file.
Paul Eggert 959152ba 2024-08-14T18:03:54 error: merge from glibc and with verror * lib/error.c: Merge changes since 2018 from glibc. ----- The following changes are taken from glibc: (__error_internal, __error_at_line_internal): New functions, with most of the old error and error_at_line_internal but with va_list and with a new trailing mode_args, for wide character mode. (error_tail): Add trailing arg. (error_tail, __error_internal, __error_at_line_internal): Redo _LIBC implementation with respect to cancelation. [_LIBC]: Include <libc-lock.h>, not <bits/libc-lock.h>. ----- The following changes are specific to Gnulib: (__error_internal, __error_at_line_internal, error_tail) [!_LIBC]: Use macros to define away the new trailing arg, and to name the internal functions to verror and verror_at_line. (verror, verror_at_line) [!_LIBC]: Undef so that we omit the __gl_error_call business when defining these functions. * lib/error.in.h: Include stdarg.h. (verror, verror_at_line): New decls and macros. * m4/error_h.m4 ([gl_ERROR_H]): Always compile error.c if the verror module is also present. * modules/verror (Files, lib_SOURCES): Remove lib/verror.h, lib/verror.c. (Depends-on): Remove stdio, xvasprintf. (configure.ac-early): Define gl_HAVE_MODULE_VERROR so that the error module compiles error.c. Not sure if this is the standard way to do this, but it seems to work. * modules/verror (Include), tests/test-verror.c: Include error.h, not verror.h.
Bruno Haible a66864d7 2024-08-14T16:43:34 pthread-rwlock-extra-tests: Exclude this test from packages by default. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Add comment. * modules/pthread-rwlock-extra-tests (Status): Mark as longrunning-test.
Collin Funk 79216cc1 2024-08-12T20:11:19 termios tests: Check for struct winsize. * tests/test-termios.c (t2): Make sure inclusion of termios.h allows use of struct winsize.
Bruno Haible 616a1dad 2024-08-12T17:15:10 errno tests: Avoid test failure on Haiku. * doc/posix-headers/errno.texi: Mention the Haiku problem. * tests/test-errno.c: On Haiku, don't check that the error numbers are positive.
Bruno Haible f59ff6be 2024-08-12T16:15:50 fdutimensat, utimensat tests: Fix test failures on Cygwin. * tests/nap.h: Include concat-filename.h, xgetcwd.h. (nap_file): New variable. (nap_get_stat, clear_temp_file): Use nap_file, not TEMPFILE. (nap): Initialize nap_file. * modules/chown-tests (Depends-on): Add xconcat-filename, xgetcwd. * modules/fchownat-tests (Depends-on): Likewise. * modules/fdutimensat-tests (Depends-on): Likewise. * modules/futimens-tests (Depends-on): Likewise. * modules/lchown-tests (Depends-on): Likewise. * modules/stat-time-tests (Depends-on): Likewise. * modules/utime-tests (Depends-on): Likewise. * modules/utimens-tests (Depends-on): Likewise. * modules/utimensat-tests (Depends-on): Likewise.
Bruno Haible 34d57605 2024-08-12T14:56:46 pthread-rwlock: Attempt harder to avoid test failure on macOS. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Bump the minimum interval to 200 ms on macOS.
Bruno Haible e85cc595 2024-08-12T14:18:02 pthread-rwlock: Attempt harder to avoid test failure on macOS. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Bump the minimum interval to 100 ms on macOS.
Bruno Haible 9bf0d8e5 2024-08-12T13:15:42 pthread-rwlock: Attempt harder to avoid test failure on macOS. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Bump the minimum interval to 50 ms on macOS.
Bruno Haible ef4c430e 2024-08-12T11:15:37 pthread-rwlock: Attempt to avoid test failure on some more machines. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Bump the minimum interval to 20 ms on macOS.
Paul Eggert 8fa1fba5 2024-08-10T21:47:07 test-fdutimensat: fix newly-added test Problem reported by Bruno Haible and Collin Funk in: https://lists.gnu.org/r/bug-gnulib/2024-08/msg00061.html https://lists.gnu.org/r/bug-gnulib/2024-08/msg00064.html * tests/test-utimens.h (test_utimens): Fix typo in new test, which causes the test to break on file systems that are not noatime.
Collin Funk c341a871 2024-08-10T17:16:45 htonl: Add tests. * modules/htonl-tests: New file. * tests/test-htonl.c: New file.
Paul Eggert 720ddf92 2024-08-09T14:03:44 test-utime: port to noatime file systems Problem encountered on Ubuntu 24.04 zfs mounted noatime. * tests/test-fdutimensat.c (main): * tests/test-futimens.h (test_futimens): * tests/test-lutimens.h (test_lutimens): * tests/test-utime.c (test_utime): * tests/test-utimens-common.h (checkable_atime): New function. * tests/test-utimens.h (test_utimens): * tests/test-utimensat.c (main): Do not check atime on file systems mounted noatime.
Bruno Haible b12e697b 2024-08-09T11:59:10 pthread-rwlock: Attempt to avoid test failure on some machines. Reported by Pádraig Brady <P@draigBrady.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00050.html>. * tests/test-pthread-rwlock-waitqueue.c (STEP_INTERVAL): Bump the minimum interval to 10 ms. * m4/pthread-rwlock.m4 (gl_PTHREAD_RWLOCK): Likewise.
Bruno Haible d6cd315d 2024-08-07T19:53:41 pthread-rwlock tests: Strengthen tests. * tests/test-pthread-rwlock-waitqueue.c: New file. * modules/pthread-rwlock-tests (Files): Add it. (Depends-on): Add extensions, nanosleep, stdbool. (Makefile.am): Arrange to test test-pthread-rwlock-waitqueue.