1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2026-10-24 00:48:56 +03:00

4344 Commits

Author SHA1 Message Date
Pádraig Brady
19cfe39541 cpu-supports: align more closely with GLIBC_TUNABLES parsing
* lib/cpu-supports.c (hwcap_allowed): Be more restrictive
in matching as per the cases listed at:
https://github.com/coreutils/coreutils/issues/385
* tests/test-cpu-supports.c: Add test cases.
2026-10-21 15:03:37 +01:00
Bruno Haible
75a70e9416 tests: Fix some compilation errors with recent MSVC.
* tests/test-call_once2.c (thrd_current_pointer): Define differently for
MSVC with <threads.h>.
* tests/test-mtx.c (thrd_current_pointer): Likewise.
* tests/test-thread_local.c (thrd_current_pointer): Likewise.
* tests/test-tss.c (thrd_current_pointer): Likewise.
2026-10-17 20:34:14 +02:00
Bruno Haible
e0b61efe46 tests: Fix some compilation errors with optimizing MSVC.
* tests/signature.h (DISABLE_INTRINSIC): New macro.
(SIGNATURE_CHECK2): Invoke it.
2026-10-17 20:12:52 +02:00
Bruno Haible
2fa81975b4 Update to Unicode 18.0.0.
* lib/gen-uni-tables.c (is_property_alphabetic): Add more CUNEIFORM
NUMERIC SIGNs.
(UC_JOINING_GROUP_CROWN_*): New enum items.
(fill_arabicshaping, joining_group_as_c_identifier): Handle
UC_JOINING_GROUP_CROWN_*.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.
(output_lbrk_rules_as_tables): Update rule LBP12a as specified by
https://www.unicode.org/reports/tr14/tr14-57.html.
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.
(output_casing_rules): Allow codes up to 0xFFFFF. Allow all 32-bit
mapping values.

* lib/unictype.in.h (UC_JOINING_GROUP_CROWN_*): New enum items.
* lib/unictype/joininggroup_byname.gperf: Handle them.
* lib/unictype/joininggroup_name.h: Likewise.

* lib/unicase/special-casing.in.h (struct special_casing_rule): Change
element type of upper, lower, title, casefold to 'unsigned int'.
* lib/unicase/u-casemap.h (FUNC): Implement lookup for 20-bit code
values. Update for changed element type.
* lib/unicase/u-ct-totitle.h (FUNC): Likewise.

* lib/unigbrk/u-grapheme-breaks.h (FUNC): Update for changed rule GB9c.
* lib/unigbrk/u-grapheme-next.h (FUNC): Likewise.
* lib/unigbrk/u-grapheme-prev.h (ends_with_incb_linker_extended):
Renamed from ends_with_incb_consonant_extended_linker_extended. Update
for changed rule GB9c.
(FUNC): Update.
* tests/unigbrk/test-uc-is-grapheme-break.c (main): Update for changed
rule GB9c.

* 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.
* tests/unilbrk/LineBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.
2026-10-16 01:42:37 +02:00
Paul Eggert
685bfe8e61 regex-tests: pacify -Wformat-overflow
Problem and fix reported by Pádraig Brady in:
https://lists.gnu.org/r/bug-gnulib/2026-10/msg00072.html
* tests/test-regex-el.c (main): Use %c not %s.
2026-10-13 22:45:19 -07:00
Paul Eggert
cb6cb332a9 regex: fix REG_ICASE for single-byte chars
Problem reported by Arno Onken in:
https://lists.gnu.org/r/bug-gnulib/2026-10/msg00029.html
* lib/regcomp.c (re_compile_fastmap_iter): For SIMPLE_BRACKET,
also set fastmap for leading bytes of case folded counterparts
of each character.
* tests/test-regex-el.c (main): Test [C] as well as C,
for each problematic character C.
2026-10-11 12:21:16 -07:00
Bruno Haible
58021cbbb0 all: Update URLs to msdn.microsoft.com or docs.microsoft.com.
* lib/stat-w32.c et al.: Update URLs after docs.microsoft.com was moved
to learn.microsoft.com.
2026-10-07 17:05:11 +02:00
Bruno Haible
92b7adbcea mktime tests: Simplify.
* tests/test-mktime-w32.c (main): Do a single mktime() invocation
instead of two.
2026-10-01 22:56:34 +02:00
Bruno Haible
8381dafd56 mktime: Add tests.
* tests/test-mktime-w32.c: New file.
* modules/mktime-tests: New file.
2026-10-01 18:04:38 +02:00
Bruno Haible
904543d2f5 time_r tests: Add more tests.
* tests/test-localtime_r-w32.c: New file.
* modules/time_r-tests (Files): Add it.
(Depends-on): Add test-xfail.
(Makefile.am): Arrange to build and run test-localtime_r-w32.
2026-10-01 17:24:38 +02:00
Bruno Haible
21eabef694 localtime: Add tests.
* tests/test-localtime-w32.c: New file.
* modules/localtime-tests: New file.
2026-10-01 17:24:34 +02:00
Collin Funk
b18879b9ed canonicalize: Fix a missing check for symlink loops.
Reported by Brian Foster in:
<https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2161155>

* lib/canonicalize.c: Include min-eloop-threshold.h.
(canonicalize_filename_mode_stk): Set errno to ELOOP and exit if we see
MIN_ELOOP_THRESHOLD links.
* modules/canonicalize (Depends-on): Add eloop-threshold.
* tests/test-canonicalize.c (main): Add a test case that would
previously loop until the system ran out of memory. Clean up the created
sylink.
2026-09-25 18:41:41 -07:00
Paul Eggert
689a146283 tests: prefer GCC sanitization macros
* tests/test-c-stack.c, tests/test-calloc-posix.c:
* tests/test-dprintf-posix2.c, tests/test-explicit_bzero.c:
* tests/test-fprintf-posix3.c, tests/test-free.c:
* tests/test-malloc-posix.c, tests/test-memset_explicit.c:
* tests/test-reallocarray.c, tests/test-sigsegv-catch-stackoverflow1.c:
* tests/test-sigsegv-catch-stackoverflow2.c:
Simplify now that gnulib-common.m4 supports GCC-like macros.
2026-09-23 17:49:21 -07:00
Bruno Haible
05e4f87c16 tests: Avoid test failures with -fsanitize=address.
* tests/test-malloc-posix.c (__has_feature): New macro.
(main): Skip the test if an address sanitizer is in use.
* tests/test-calloc-posix.c (__has_feature): New macro.
(main): Skip the test if an address sanitizer is in use.
* tests/test-reallocarray.c (__has_feature): New macro.
(main): Skip the test if an address sanitizer is in use.
2026-09-23 23:34:03 +02:00
Bruno Haible
eb72eb6f75 c32tob: Add tests.
* tests/test-c32tob.c: New file.
* tests/test-c32tob.sh: New file.
* modules/c32tob-tests: New file.
2026-09-20 21:55:23 +02:00
Bruno Haible
1052c15fa3 wctob: Add tests.
* tests/test-wctob.c: New file.
* tests/test-wctob.sh: New file.
* modules/wctob-tests: New file.
2026-09-20 17:23:31 +02:00
Bruno Haible
159d00520e btowc: Enhance tests.
* tests/test-btowc.c (main): Check that btowc is consistent with
mbrtowc.
* modules/btowc-tests (Depends-on): Add mbrtowc.
2026-09-20 16:50:14 +02:00
Bruno Haible
e2c3ad85ed wcrtomb: Make consistent with mbrtowc (regression 2016-04-09).
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Require gl_MBRTOWC_C_LOCALE and, if
needed, set REPLACE_WCRTOMB and define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ.
* lib/mbrtowc.c (rpl_mbrtowc) [MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ]: In the
C locale, map 0x80..0xFF to 0xDF80..0xDFFF instead of 0x0080..0x00FF.
* lib/wcrtomb.c: Include hard-locale.h, <locale.h>.
(wcrtomb) [MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ]: In the C locale, map
0xDF80..0xDFFF to 0x80..0xFF.
* modules/wcrtomb (Depends-on): Add hard-locale.
* tests/test-wcrtomb.c (main): Check that wcrtomb does the inverse of
mbrtowc in the C locale.
2026-09-20 16:27:54 +02:00
Bruno Haible
8396458e22 btoc32 tests: Enhance tests.
* tests/test-btoc32.c (main): Verify that btoc32 is consistent with
mbrtoc32.
* modules/btoc32-tests (Depends-on): Add mbszero, mbrtoc32.
2026-09-18 17:43:26 +02:00
Bruno Haible
bc4c32a353 c32rtomb: Make consistent with mbrtoc32 in the C locale.
Suggested by Paul Eggert.

* m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Require gl_MBRTOC32_C_LOCALE,
gl_MBRTOC32_C_LOCALE_LIKE_ISO_8859. When mbrtoc32 gets overridden due to
the C locale, set also REPLACE_C32RTOMB to 1.
* lib/c32rtomb.c: Include hard-locale.h, <locale.h>.
(c32rtomb): On OpenBSD, NetBSD ≥ 11, glibc, Cygwin, mingw, MSVC, do
special handling of non-ASCII characters in the C locale.
* modules/c32rtomb (Depends-on): Add hard-locale.
* tests/test-c32rtomb.c (main): Check that c32rtomb does the inverse of
mbrtoc32 in the C locale.
2026-09-17 01:47:44 +02:00
Bruno Haible
ddf22bd4da strerrorname_np: Ensure it handles EFTYPE.
Suggested by Pádraig Brady.

* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test whether
strerrorname_np handles EFTYPE.
* lib/strerrorname_np.c: Update comment.
* lib/errno-iter.c: Likewise.
* tests/test-strerrorname_np.c: Likewise.
2026-09-16 22:46:06 +02:00
Paul Eggert
17fe0d9e0a mbrtoc32: revert most of previous change
Keep only change to comments and documentation.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-09/msg00058.html
2026-09-14 10:54:59 -07:00
Paul Eggert
3df54a5c85 mbrtoc32: also protect high-bit bytes when EILSEQ
I ran into some problems with GNU sed on NetBSD and
endeavored to fix some of them by altering the mbrtoc32 replacement,
so that in the C locale it always converts bytes with the top
bit set to 0xDFxx, instead of doing it only sometimes.
This patch also updates commentary to match current POSIX standards
and some newer OS releases.
* lib/mbrtoc32.c (mbrtoc32): Also convert (e.g.) 0xED to 0xDFED
when !GNULIB_defined_mbstate_t && HAVE_WORKING_MBRTOC32 &&
HAVE_WORKING_C32RTOMB && !MBRTOC32_MULTIBYTE_LOCALE_BUG &&
MBRTOC32_IN_C_LOCALE_MAYBE_EILSEQ.
* tests/test-mbrtoc16.c (main):
* tests/test-mbrtoc32.c (main):
Simplify, now that we always do that conversion.
2026-09-13 23:30:56 -07:00
Bruno Haible
c506dd5974 stddef-h C++ tests: Avoid compilation error with clang+mingw toolchain.
* tests/test-stddef-h.c: Skip the 'sizeof NULL' test with clang on
Windows.
* tests/test-stddef-h-c++2.cc: Likewise.
2026-09-02 19:22:05 +02:00
Pádraig Brady
6753261200 tests: avoid confusing failures with warn_ on NetBSD
On NetBSD 10.0 at least, since commit e4c911bb4, warn_() would
issue a warning like "local: set-up: bad variable name".
This is due to how its shell handles "local" with initialization.

* tests/init.sh: Avoid initializing on the same line as "local".
2026-09-01 19:06:08 +01:00
Bruno Haible
2b771f8a79 fenv-exceptions-tracking-c99 tests: Fix test on Solaris 11 OpenIndiana.
* tests/test-fenv-except-tracking-3.c (a, b, al, bl): New variables.
(main): Do a harmless floating-point operation after feraiseexcept.
2026-08-31 20:05:35 +02:00
Pádraig Brady
91c129e9db strftime: more consistent flag handling in compound date formats
$ date-before -d '1-2-3' "+[%_D]"
  [02/03/ 1]
  $ date-after -d '1-2-3' "+[%_D]"
  [02/03/01]

* lib/strftime.c: Only propagate flags to %F as that has the
year at the start so our current "yearish" based flag propagation
produces consistent results.  Specifically this avoids glibc
'_' and '-' flags propagating to year sub specifiers of %D,
producing inconsistent year and month/date formatting.
* tests/test-nstrftime.h: Add test cases.
2026-08-31 12:05:05 +01:00
Bruno Haible
de054f5dc8 tests: Check that c32isprint is consistent with isprint in the C locale.
* tests/test-c32isprint.c: Include <ctype.h>.
(main): In the C locale, check that c32isprint is consistent with
isprint.
2026-08-28 01:42:50 +02:00
Luca Boccassi
f99cf04a5b sd-dlopen: Add tests.
* tests/test-sd-dlopen.c: New file.
* tests/test-sd-dlopen-disabled.c: New file.
* tests/test-sd-dlopen.sh: New file.
* modules/sd-dlopen-tests: New file.
2026-08-27 12:45:18 +02:00
Paul Eggert
a9fa600521 gettext-h: always define textdomain
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-08/msg00288.html
* lib/gettext.h (textdomain, bindtextdomain, bind_textdomain_codeset)
[!ENABLE_NLS && __GNUC__ && !__clang__ && !__cplusplus]:
Define to no-ops in this case too.
Move the definition of _LIBGETTEXT_FUNCAST up one level of
ifdeffery so that it is defined for this case.
* tests/test-gettext-h.c (main) [!ENABLE_NLS]: Call textdomain,
reverting the previous change to this file.
2026-08-25 13:27:28 -07:00
Paul Eggert
983e052b06 gettext-h-tests: don’t assume ENABLE_NLS
* tests/test-gettext-h.c (main) [!ENABLE_NLS]:
Do not call textdomain, as it is not in scope.
2026-08-25 10:04:22 -07:00
Lasse Collin
c4fa2006ac tests: Avoid undefined behavior on mingw-w64
* tests/test-wmemcpy.c (null_wmemcpy, main): Move the #if and comment
from null_wmemcpy to main to avoid invoking undefined behavior.
* tests/test-wmemmove.c (null_wmemmove, main): Likewise.
2026-08-18 19:23:14 +02:00
Lasse Collin
67ee70e8e0 tests: Remove redundant #ifs from N3322 tests
* tests/test-bsearch.c (null_bsearch, main): Remove the #if from
null_bsearch because having the same condition in main is enough.
Move the comment explaining the #if from null_bsearch to main.
* tests/test-memccpy.c (null_memccpy, main): Likewise.
* tests/test-memchr.c (null_memchr, main): Likewise.
* tests/test-memcmp.c (null_memcmp, main): Likewise.
* tests/test-memcpy.c (null_memcpy, main): Likewise.
* tests/test-memmove.c (null_memmove, main): Likewise.
* tests/test-memset.c (null_memset, main): Likewise.
* tests/test-memset_explicit.c (null_memset_explicit, main): Likewise.
* tests/test-qsort.c (null_qsort, main): Likewise.
* tests/test-strncat.c (null_strncat, main): Likewise.
* tests/test-strncmp.c (null_strncmp, main): Likewise.
* tests/test-strncpy.c (null_strncpy, main): Likewise.
* tests/test-strndup.c (null_strndup, main): Likewise.
* tests/test-wcsncat.c (null_wcsncat, main): Likewise.
* tests/test-wcsncmp.c (null_wcsncmp, main): Likewise.
* tests/test-wcsncpy.c (null_wcsncpy, main): Likewise.
2026-08-18 19:22:12 +02:00
Paul Eggert
a507265982 exclude: new function excluded_file_name_status
From a suggestion by Sergey Poznyakoff in:
https://lists.gnu.org/r/bug-gnulib/2026-08/msg00217.html
* lib/exclude.c (EXCLUDE_INLINE): New macro.
(excluded_file_name_status): New function, extending
excluded_file_name which is now in exclude.h.
* lib/exclude.h (EXCLUDE_INLINE, EXCLUDED_EXCLUDED, EXCLUDED_MATCHED):
New macros.
(excluded_file_name): New function.
* tests/test-exclude.c (main): Test new function too.
All test scripts changed.
2026-08-18 01:21:15 -07:00
Bruno Haible
a89f650618 tests: Avoid some test failures with the clang UBSAN.
* tests/test-bsearch.c (main): Disable the N3322 test on glibc systems.
* tests/test-memccpy.c (main): Likewise.
* tests/test-memchr.c (main): Likewise.
* tests/test-memcmp.c (main): Likewise.
* tests/test-memcpy.c (main): Likewise.
* tests/test-memmove.c (main): Likewise.
* tests/test-memset.c (main): Likewise.
* tests/test-memset_explicit.c (main): Likewise.
* tests/test-qsort.c (main): Likewise.
* tests/test-strncat.c (main): Likewise.
* tests/test-strncmp.c (main): Likewise.
* tests/test-strncpy.c (main): Likewise.
* tests/test-strndup.c (main): Likewise.
* tests/test-wcsncat.c (main): Likewise.
* tests/test-wcsncmp.c (main): Likewise.
* tests/test-wcsncpy.c (main): Likewise.
2026-08-17 00:37:13 +02:00
Bruno Haible
23ca35b567 striconveh: Ensure that none of the offsets[] are out-of-range.
Reported by AISLE via Mike Fabian <mfabian@redhat.com>.

* lib/striconveh.c (mem_cd_iconveh_internal): Ensure that no offsets[i]
is == length.
* tests/test-striconveh.c (main): Adjust expected contents of the
offsets[] array.
* lib/striconveh.c (main): Likewise.
* tests/test-striconveh.c (main): Likewise.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-conv-to-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-to-enc.c (main): Likewise.
2026-08-16 16:59:26 +02:00
Bruno Haible
36ab4b958e striconveh tests: Add some more test cases.
* tests/test-striconveh.c (main): Add some more test cases for
mem_iconveh() with offsets.
2026-08-16 16:59:22 +02:00
Paul Eggert
36d362443f acl-tests: fix AIX 7.3 aclx_* constness
* tests/test-sameacls.c (main): AIX 7.3’s aclx_* APIs want char *
parameters, not char const *.  Change arguments accordingly.  This
pacifies IBM Open XL C/C++ for AIX 17.1.1 (5725-C72, 5765-J18),
version 17.1.1.2, clang version 15.0.0 (build 3948f09) with
-Wincompatible-pointer-types-discards-qualifiers.
2026-08-15 23:16:01 -07:00
Bruno Haible
9388edc18a tests: Support CC="clang -flto -fsanitize=cfi -fvisibility=hidden".
Reported by Lasse Collin in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-08/msg00190.html>.

* tests/test-array_map.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-array_omap.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-avltree_omap.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-rbtree_omap.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-array_set.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-array_oset.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-avltree_oset.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-rbtree_oset.c (string_compare): New function.
(main): Use instead of casting strcmp to a different function prototype.
* tests/test-oset-update.h (test_update): Likewise.
2026-08-15 17:46:48 +02:00
Bruno Haible
78a859110f Add unit tests and doc for the %Lf large precision issue on Solaris.
* tests/test-vasnprintf-posix.c (test_function): Add a testcase for
"%.5119Lf".
* 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-vasnwprintf-posix.c (test_function): Likewise.
* doc/posix-functions/*printf.texi: Document the Solaris 11.4 bug.
2026-08-14 19:57:39 +02:00
Pádraig Brady
9491b2cbf7 tests: avoid -Wformat= warning re unsigned mismatch
* tests/test-printf-posix2.c: Specify unsigned int.
* tests/test-fprintf-posix2.c: Likewise.
2026-08-14 18:47:06 +01:00
Lasse Collin
66d15d31f4 tests: Fix test-wmemcpy and test-wmemmove on mingw-w64 + GCC < 15.
* tests/test-wmemcpy.c (null_wmemcpy): Exclude the N3322 test on
mingw-w64 && GCC < 15.
* tests/test-wmemmove.c (null_wmemmove): Likewise.
2026-08-13 23:44:02 +02:00
Collin Funk
79ee7bb214 stdc_rotate_{left,right}-tests: adjust to share with glibc
* tests/from-glibc/tst-stdc_rotate_left.c: New file, based on
tests/test-stdc_rotate_left.c with changes to also work with the glibc
test framework. Relicense to LGPLv2.1+.
* tests/from-glibc/tst-stdc_rotate_right.c: New file, based on
tests/test-stdc_rotate_right.c with changes to also work with the glibc
test framework. Relicense to LGPLv2.1+.
* modules/stdc_rotate_left-tests (Files): List the new file.
(Depends-on): Add the new file as a source for the test program. Define
GNULIB_TEST_STDBIT when compiling.
* modules/stdc_rotate_right-tests (Files): List the new file.
(Depends-on): Add the new file as a source for the test program. Define
GNULIB_TEST_STDBIT when compiling.
2026-08-12 23:16:25 -07:00
Paul Eggert
4a9026eb79 stdc_rotate_left-tests: pacify -Woverflow
Problem found with gcc 16.1.1 20260515 (Red Hat 16.1.1-2) on i686.
* tests/test-stdc_rotate_left.c (test_stdc_rotate_left_ul):
* tests/test-stdc_rotate_right.c (test_stdc_rotate_right_ul): Use
preprocessor-time check, not a potentially runtime check, to see
whether to use 32- or 64-bit tests.  This pacifies gcc -Woverflow.
Include <limits.h> to get ULONG_MAX.
2026-08-12 17:35:51 -07:00
Bruno Haible
8db2020368 tests: Make last patch side-effect free.
* tests/test-bsearch.c: Use another volatile function pointer variable.
* tests/test-memccpy.c: Likewise.
* tests/test-memchr.c: Likewise.
* tests/test-memcmp.c: Likewise.
* tests/test-memcpy.c: Likewise.
* tests/test-memmove.c: Likewise.
* tests/test-memset.c: Likewise.
* tests/test-memset_explicit.c: Likewise.
* tests/test-qsort.c: Likewise.
* tests/test-strncat.c: Likewise.
* tests/test-strncmp.c: Likewise.
* tests/test-strncpy.c: Likewise.
* tests/test-strndup.c: Likewise.
* tests/test-wcsncat.c: Likewise.
* tests/test-wcsncmp.c: Likewise.
* tests/test-wcsncpy.c: Likewise.
* tests/test-wmemchr.c: Likewise.
* tests/test-wmemcmp.c: Likewise.
* tests/test-wmemcpy.c: Likewise.
* tests/test-wmemmove.c: Likewise.
* tests/test-wmemset.c: Likewise.
2026-08-11 22:35:08 +02:00
Lasse Collin
2f12022435 tests: Verify N3322 compatibility of the function prototypes
Test that the compiler doesn't optimize a NULL check away when it sees
the prototypes in the headers <string.h>, <wchar.h>, and <stdlib.h>.
The existing tests explicitly avoided the effects of the attributes
in the function prototypes.

Exclude GCC < 15 and glibc which are known to be problematic.
Use 2.99 as a placeholder for a fixed glibc version. It should
be updated once the glibc headers have been changed.

* tests/test-bsearch.c: Add the test null_bsearch.
* tests/test-memccpy.c: Add the test null_memccpy.
* tests/test-memchr.c: Add the test null_memchr.
* tests/test-memcmp.c: Add the test null_memcmp.
* tests/test-memcpy.c: Add the test null_memcpy.
* tests/test-memmove.c: Add the test null_memmove.
* tests/test-memset.c: Add the test null_memset.
* tests/test-memset_explicit.c: Add the test null_memset_explicit.
* tests/test-qsort.c: Add the test null_qsort.
* tests/test-strncat.c: Add the test null_strncat.
* tests/test-strncmp.c: Add the test null_strncmp.
* tests/test-strncpy.c: Add the test null_strncpy.
* tests/test-strndup.c: Add the test null_strndup.
* tests/test-wcsncat.c: Add the test null_wcsncat.
* tests/test-wcsncmp.c: Add the test null_wcsncmp.
* tests/test-wcsncpy.c: Add the test null_wcsncpy.
* tests/test-wmemchr.c: Add the test null_wmemchr.
* tests/test-wmemcmp.c: Add the test null_wmemcmp.
* tests/test-wmemcpy.c: Add the test null_wmemcpy.
* tests/test-wmemmove.c: Add the test null_wmemmove.
* tests/test-wmemset.c: Add the test null_wmemset.
2026-08-11 22:09:17 +02:00
Lasse Collin
5371b76775 mbsncasecmp-tests: Test mbsncasecmp with NULL arguments
* tests/test-mbsncasecmp.c (test_ascii): Add the tests.
2026-08-11 21:49:25 +02:00
Lasse Collin
4d763cc192 mbsnlen-tests: Test mbsnlen(NULL, 0).
* tests/test-mbsnlen.c (main): Add the test.
2026-08-11 21:49:02 +02:00
Bruno Haible
9748dc45ec free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28).
* tests/test-free.c (main): Restore previous code for !__FILC__.
2026-08-01 09:07:35 +02:00
Bruno Haible
6b21556dbf tests: Avoid some more runtime errors with Fil-C.
* tests/test-vma-prot.c (main): Skip assertions that fail on Fil-C.
2026-07-29 22:24:14 +02:00