summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tls tests: Prevent that the test takes too long.Bruno Haible2019-04-281-0/+13
| | | | | | * tests/test-tls.c: Include <signal.h>, <unistd.h>. (main): Let the test fail if it takes more than 10 minutes. * modules/tls-tests (configure.ac): Test whether 'alarm' is declared.
* lock tests: Prevent that the test takes too long.Bruno Haible2019-04-281-0/+13
| | | | | | * tests/test-lock.c: Include <signal.h>, <unistd.h>. (main): Let the test fail if it takes more than 10 minutes. * modules/lock-tests (configure.ac): Test whether 'alarm' is declared.
* Fix gcc warnings on 64-bit mode mingw.Bruno Haible2019-04-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/clean-temp.c: Include <stdint.h> instead of defining uintptr_t. * lib/gl_array_list.c: Likewise. * lib/gl_array_map.c: Likewise. * lib/gl_array_set.c: Likewise. * lib/gl_carray_list.c: Likewise. * lib/gl_sublist.c: Likewise. * lib/gl_avltreehash_list.c (uintptr_t): Remove definition. * lib/gl_rbtreehash_list.c (uintptr_t): Likewise. * lib/gl_hash_map.c (uintptr_t): Likewise. * lib/gl_hash_set.c (uintptr_t): Likewise. * lib/gl_linkedhash_list.c (uintptr_t): Likewise. * lib/gl_linkedhash_map.c (uintptr_t): Likewise. * lib/gl_linkedhash_set.c (uintptr_t): Likewise. * lib/iconv.c (uintptr_t): Likewise. * lib/iconv_close.c (uintptr_t): Likewise. * tests/test-lock.c: Include <stdint.h>. (once_contender_thread, test_once): Cast through 'intptr_t' instead of 'long'. * modules/clean-temp (Depends-on): Add stdint. * modules/array-list (Depends-on): Likewise. * modules/array-map (Depends-on): Likewise. * modules/array-set (Depends-on): Likewise. * modules/carray-list (Depends-on): Likewise. * modules/sublist (Depends-on): Likewise. * modules/lock-tests (Depends-on): Likewise.
* di-set: allow free with 'ino_map' being NULLBernhard Voelker2019-04-181-0/+3
| | | | | | | * lib/di-set.c (di_set_free): Avoid ino_map_free() when dis->ino_map is NULL. Bug introduced in commit 3703dbbe88dd. * tests/test-di-set.c: Add di_set_free() right after di_set_alloc() as a test.
* term-style-control: Add tests.Bruno Haible2019-03-242-0/+298
| | | | | | * tests/test-term-style-control-hello.c: New file. * tests/test-term-style-control-yes.c: New file. * modules/term-style-control-tests: New file.
* bitset: expose bitset_resizeAkim Demaille2019-03-211-6/+19
| | | | | | * lib/bitset.h (bitset_resize): Bounce on the polymorphic implementation. * tests/test-bitset.c (check_attributes): Check bitset_resize. (main): Use a variable bitset as reference, since fixed does not support resize.
* libtextstyle-optional: Add tests.Bruno Haible2019-03-202-0/+108
| | | | | | | | * tests/test-libtextstyle.c: New file, based on libtextstyle's adhoc-tests/hello.c. * tests/test-libtextstyle-default.css: New file, copied from libtextstyle's adhoc-tests/hello-default.css. * modules/libtextstyle-optional-tests: New file.
* bitset: a bit (...) more testsAkim Demaille2019-03-171-0/+29
| | | | * tests/test-bitset.c (check_attributes): Check zero and ones.
* all: Update URLs to msdn.microsoft.com.Bruno Haible2019-03-142-2/+2
| | | | | * lib/stat-w32.c et al.: Update URLs after most of msdn.microsoft.com was moved to docs.microsoft.com.
* tests: Avoid havoc with "gcc -fcheck-pointer-bounds".Bruno Haible2019-03-102-2/+8
| | | | | | * tests/test-fprintf-posix2.c: Skip the test when -fcheck-pointer-bounds is in use. * tests/test-printf-posix2.c: Likewise.
* uninorm tests: Free allocated memory.Bruno Haible2019-03-106-1/+39
| | | | | | | | | | | | | | * tests/uninorm/test-u32-normalize-big.h (struct normalization_test_file): Remove 'const' from allocated member. (free_normalization_test_file): New declaration. * tests/uninorm/test-u32-normalize-big.c (test_other): Free allocated memory. (free_normalization_test_file): New function. * tests/uninorm/test-u32-nfc-big.c (main): Free allocated 'struct normalization_test_file' contents. * tests/uninorm/test-u32-nfd-big.c (main): Likewise. * tests/uninorm/test-u32-nfkc-big.c (main): Likewise. * tests/uninorm/test-u32-nfkd-big.c (main): Likewise.
* tests: Free allocated memory.Bruno Haible2019-03-1024-3/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by <deltatau@protonmail.com> via Assaf Gordon. * tests/test-astrxfrm.c (main): Free allocated memory. * tests/test-bitset.c (compare, check_attributes): Free allocated bitsets. * tests/test-filenamecat.c (main): Free allocated memory. * tests/test-freadahead.c (main): Free allocated memory and close stdin. * tests/test-freadptr.c (main): Likewise. * tests/test-freadptr2.c (main): Free allocated memory. * tests/test-freadseek.c (main): Likewise. * tests/test-gc-arcfour.c (main): Close allocated context. * tests/test-gc-arctwo.c (main): Likewise. * tests/test-gc-des.c (main): Close all allocated contexts. * tests/test-pipe-filter-gi1.c (main): Free allocated memory. * tests/test-pipe-filter-ii1.c (main): Likewise. * tests/test-posix_spawn_file_actions_addchdir.c (main): Destroy the allocated file actions. * tests/test-posix_spawn_file_actions_addclose.c (main): Likewise. * tests/test-posix_spawn_file_actions_adddup2.c (main): Likewise. * tests/test-posix_spawn_file_actions_addopen.c (main): Likewise. * tests/test-sameacls.c (main): Free allocated memory and ACLs. * tests/test-strfmon_l.c (main): Free allocated locales. * tests/test-striconveh.c (main): Free allocated iconv_t objects. * tests/uniconv/test-u8-conv-to-enc.c (main): Free allocated memory. * tests/uniconv/test-u16-conv-to-enc.c (main): Likewise. * tests/uniconv/test-u32-conv-to-enc.c (main): Likewise. * tests/unistr/test-chr.h (main): Free input32. * tests/unistr/test-strchr.h (test_strchr): Likewise.
* Fix another test failure introduced by the same commit.Bruno Haible2019-03-101-1/+1
|
* Fix test failure introduced by last commit.Bruno Haible2019-03-101-1/+1
|
* tests: Prepare for using valgrind.Bruno Haible2019-03-10174-331/+331
| | | | | tests/*.sh: Invoke all test programs through ${CHECKER}. tests/*/*.sh: Likewise.
* get-rusage-as, pthread_sigmask tests: Fix -fsanitize=thread findings.Bruno Haible2019-03-101-0/+4
| | | | | | | * lib/get-rusage-as.c (get_rusage_as): When compiled by "gcc -fsanitize=thread", don't try get_rusage_as_via_setrlimit. * tests/test-pthread_sigmask2.c (main): Clean up the killer_thread before exiting.
* test-userspec.c: don't print NULLJim Meyering2019-03-091-2/+4
| | | | | | | | * tests/test-userspec.c (main): A test release of gcc, 9.0.1 20190310, warned that this test would attempt to print a NULL pointer via a %s printf format. Fix that and remove the unnecessary preceding "!diag" conjunct. Also add a comment.
* alloca, tsearch-tests: Write NULL for the null pointer.Michal Privoznik2019-03-101-1/+1
| | | | | * lib/alloca.c (i00afunc): Write NULL instead of 0. * tests/test-tsearch.c (mangle_tree): Likewise.
* Fix undefined behaviour.Bruno Haible2019-03-094-52/+84
| | | | | | | | | | | | | * lib/bitrotate.h (rotl16, rotr16, rotl8, rotr8): Case x to 'unsigned int', to avoid shift operations on 'int'. * lib/xmemdup0.c (xmemdup0): Don't invoke memcpy with a zero size. * tests/test-count-leading-zeros.c (main): Use a random number that has as many bits as TYPE, not only 2*15 or 2*31 bits. * tests/test-count-trailing-zeros.c (main): Likewise. * tests/test-count-one-bits.c (main): Likewise. * tests/test-memmem.c: Don't include "null-ptr.h". (main): Use zerosize_ptr() instead of null_ptr(). * modules/memmem-tests (Files): Remove tests/null-ptr.h.
* *-map tests: Fix compilation error.Colin Watson2019-02-023-0/+3
| | | | | | * tests/test-array_map.c: Include <limits.h>, for CHAR_BIT. * tests/test-hash_map.c: Likewise. * tests/test-linkedhash_map.c: Likewise.
* strtod, strtold: Use the locale's decimal point.Bruno Haible2019-02-014-0/+240
| | | | | | | | | | | | | | | | | | | | | | | * lib/strtod.c: Include <locale.h>, <stdio.h>, <langinfo.h>. (decimal_point_char): New function, copied from lib/vasnprintf.c. (parse_number): Add a radixchar argument. Use it instead of '.'. (STRTOD): Invoke decimal_point_char and pass the result to parse_number. * m4/strtod.m4 (gl_PREREQ_STRTOD): Test whether nl_langinfo exists. * m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise. * tests/test-strtod1.c: New file. * tests/test-strtod1.sh: New file. * modules/strtod-tests (Files): Add test-strtod1.{sh,c}. Add locale-fr.m4 and its dependencies. (configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8. (Makefile.am): Arrange to compile test-strtod1.c and run test-strtod1.sh. * tests/test-strtold1.c: New file. * tests/test-strtold1.sh: New file. * modules/strtold-tests (Files): Add test-strtold1.{sh,c}. Add locale-fr.m4 and its dependencies. (configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8. (Makefile.am): Arrange to compile test-strtold1.c and run test-strtold1.sh.
* strtod, strtold tests: Simplify tests.Bruno Haible2019-02-012-16/+4
| | | | | * tests/test-strtod.c (main): Assume no rounding errors for 0.5. * tests/test-strtold.c (main): Likewise.
* strtold: Add tests.Bruno Haible2019-01-301-0/+986
| | | | | * tests/test-strtold.c: New file, based on tests/test-strtod.c. * modules/strtold-tests: New file.
* Fix build error when building a shared libunistring on Android.Bruno Haible2019-01-284-8/+8
| | | | | | | | | | | | | | | * tests/uninorm/test-nfc.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfd.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfkc.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference. * tests/uninorm/test-nfkd.c (n): Don't define on Android. (main): Add 'volatile', to defeat a GCC optimization that would eliminate the reference.
* test-framework-sh: Improve maintainability.Bruno Haible2019-01-271-241/+281
| | | | * tests/init.sh: Clarify what belongs together. Reorder definitions.
* tests: Don't assume that /tmp exists.Bruno Haible2019-01-274-0/+4
| | | | | | | * tests/test-set-mode-acl-1.sh: Skip the test if /tmp does not exist. * tests/test-copy-acl-1.sh: Likewise. * tests/test-file-has-acl-1.sh: Likewise. * tests/test-copy-file-1.sh: Likewise.
* tests: Accommodate a shell that is not in /bin/sh.Bruno Haible2019-01-2715-22/+87
| | | | | | | | | | | | | | | | | | | | | | | | | * tests/init.sh (setup_): Set srcdir and builddir. (BOURNE_SHELL): New variable. * modules/acl-tests (Depends-on): Add 'test-framework-sh'. * modules/file-has-acl-tests (Depends-on): Likewise. * modules/copy-file-tests (Depends-on): Likewise. * tests/test-set-mode-acl-1.sh: Use the test framework. Invoke shell scripts through $BOURNE_SHELL. * tests/test-set-mode-acl-2.sh: Likewise. * tests/test-copy-acl-1.sh: Likewise. * tests/test-copy-acl-2.sh: Likewise. * tests/test-file-has-acl-1.sh: Likewise. * tests/test-file-has-acl-2.sh: Likewise. * tests/test-copy-file-1.sh: Likewise. * tests/test-copy-file-2.sh: Likewise. * tests/test-set-mode-acl.sh (builddir): Consider value set by the invoker. * tests/test-copy-acl.sh (builddir): Likewise. * tests/test-file-has-acl.sh (builddir): Likewise. * tests/test-copy-file.sh (builddir): Likewise. * tests/test-vc-list-files-cvs.sh: Don't create shims for executables in build-aux/. Instead, invoke shell scripts through $BOURNE_SHELL. * tests/test-vc-list-files-git.sh: Likewise.
* tests: Fix some "unused variable" warnings.Bruno Haible2019-01-2717-18/+16
| | | | | | | | | | | | | | | | | | | | | | * tests/test-fts.c (fts_dealloc): Remove unused variable. * tests/unigbrk/test-uc-grapheme-breaks.c (main): Likewise. * tests/test-striconveh.c (main): Move some variable into the '#if HAVE_ICONV'. * 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. * tests/uniconv/test-u32-conv-to-enc.c (main): Likewise. * tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise. * tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise. * tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise. * tests/uniconv/test-u8-strconv-to-enc.c (main): Likewise. * tests/uniconv/test-u16-strconv-to-enc.c (main): Likewise. * tests/uniconv/test-u32-strconv-to-enc.c (main): Likewise. * tests/test-tsearch.c (main): Move some variable into the '#if HAVE_INITSTATE'.
* tests: Enable Linux specific tests on Android.Bruno Haible2019-01-272-2/+2
| | | | | * tests/test-flock.c (main): Treat Android like Linux. * tests/test-openat-safer.c (main): Likewise.
* fts: Add support for Android.Bruno Haible2019-01-271-2/+4
| | | | | | * m4/fts.m4 (gl_FUNC_FTS_CORE): Avoid conflicts between the symbols defined by this module and the ones in libc. * tests/test-fts.c (main): Treat mkdir error EMLINK like EMFILE.
* nonblocking-socket-tests: Fix test failure on Android 4.3.Bruno Haible2019-01-261-1/+2
| | | | | * tests/test-nonblocking-socket.h (SOCKET_HAS_LARGE_BUFFER): Define to 1 also on Android.
* wcrtomb: Work around bug on Android 4.3.Bruno Haible2019-01-252-0/+8
| | | | | | | | | | * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Test also whether wcrtomb works in the C locale. * lib/wcrtomb.c (wcrtomb): Provide alternate implementation for Android, which does not have the 'wctomb' function. * doc/posix-functions/wcrtomb.texi: Mention the Android bug. * tests/test-wcrtomb.c (main): Accept argument '5'. * tests/test-wcrtomb.sh: Add tests in the POSIX locale.
* getcwd: Fix test failure when building on a Linux 9p file system.Bruno Haible2019-01-131-3/+11
| | | | | | * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): On Linux, treat error EINVAL from mkdir like ENAMETOOLONG. * tests/test-getcwd.c (test_long_name): Likewise.
* xstdopen: Add tests.Bruno Haible2019-01-062-0/+52
| | | | | | * tests/test-xstdopen.c: New file. * tests/test-xstdopen.sh: New file. * modules/xstdopen-tests: New file.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011181-1181/+1181
|
* memcmp: Mention the clang bug.Bruno Haible2018-12-211-0/+3
| | | | | * tests/test-memcmp.c: Add comment about a known test failure. * doc/posix-functions/memcmp.texi: Mention the clang bug.
* lchown tests: Be more permissive regarding errno values.Bruno Haible2018-12-201-1/+1
| | | | | | | | | Reported by Ivan Zakharyaschev <imz@altlinux.org>. * tests/test-lchown.h (test_lchown): Recognize EOPNOTSUPP as an alternative to ENOSYS. * modules/lchown-tests (Depends-on): Add 'errno'. * modules/fchownat-tests (Depends-on): Likewise.
* duplocale: Avoid test failure on AIX 7.Bruno Haible2018-12-181-6/+6
| | | | | | | | * modules/duplocale-tests (Files): Add m4/intl-thread-locale.m4. (configure.ac): Invoke gt_FUNC_USELOCALE. * tests/test-duplocale.c: Test HAVE_WORKING_USELOCALE instead of HAVE_USELOCALE. Assume that nl_langinfo_l only works when uselocale works.
* localename: Fix test failure on AIX 7.Bruno Haible2018-12-181-1/+1
| | | | | | | | | | | | | | | Reported by Assaf Gordon in <https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00019.html>. * m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): New macro. (gt_INTL_THREAD_LOCALE_NAME): Invoke it. Test gt_cv_func_uselocale_works instead of ac_cv_func_uselocale. * lib/localename.c: Test HAVE_WORKING_USELOCALE instead of HAVE_USELOCALE. * lib/localename-table.h: Likewise. * lib/localename-table.c: Likewise. * tests/test-localename.c: Likewise. * doc/posix-functions/uselocale.texi: Mention the AIX problem.
* localename: Avoid test failure on some glibc systems.Bruno Haible2018-12-161-2/+32
| | | | | | * tests/test-localename.c (test_locale_name, test_locale_name_posix): Unset environment variables that might disturb the first setlocale call, and verify that this setlocale call succeeds.
* localename: Fix test failure on OpenBSD >= 6.2.Bruno Haible2018-12-161-9/+13
| | | | | | | | | | | | | | * m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Test for fake locale system. Define HAVE_FAKE_LOCALES in this case. * lib/localename.c (HAVE_GOOD_USELOCALE): New macro. Use it instead of HAVE_USELOCALE. * tests/test-localename.c (HAVE_GOOD_USELOCALE): New macro. Use it instead of HAVE_NEWLOCALE && HAVE_USELOCALE. * doc/posix-functions/uselocale.texi: Mention OpenBSD problem. Update platforms list. * doc/posix-functions/newlocale.texi: Likewise. * doc/posix-functions/duplocale.texi: Update platforms list. * doc/posix-functions/freelocale.texi: Likewise.
* duplocale tests: Re-enable the test on platforms without <monetary.h>.Bruno Haible2018-12-161-2/+12
| | | | | * tests/test-duplocale.c: Use more fine-grained #ifs to re-enable most of the test, on platforms without <monetary.h>.
* openat-safer tests: Avoid test failure on NetBSD 8. Part 2.Bruno Haible2018-12-161-0/+2
|
* openat-safer tests: Avoid test failure on NetBSD 8.Bruno Haible2018-12-161-0/+2
| | | | | * tests/test-openat-safer.c (main): Execute a Linux specific test only on Linux.
* regex: work around a bug in glibc-2.27 and priorJim Meyering2018-12-151-0/+11
| | | | | | * m4/regex.m4 (gl_REGEX): Reject any system regexp that gets a failed assertion for /0|()0|\1|0/. * tests/test-regex.c (main): Add the same test here.
* dfa tests: Avoid test failure on Alpine Linux.Bruno Haible2018-12-151-1/+5
| | | | | * tests/dfa-match.sh (timeout_10): Accommodate the BusyBox 'timeout' command found on Alpine Linux.
* hash-map: Add tests.Bruno Haible2018-12-141-0/+195
| | | | | * tests/test-hash_map.c: New file. * modules/hash-map-tests: New file.
* linkedhash-map: Add tests.Bruno Haible2018-12-141-0/+195
| | | | | * tests/test-linkedhash_map.c: New file. * modules/linkedhash-map-tests: New file.
* array-map: Add tests.Bruno Haible2018-12-141-0/+219
| | | | | * tests/test-array_map.c: New file. * modules/array-map-tests: New file.
* select tests: Avoid test failure on Cygwin.Bruno Haible2018-12-131-3/+10
| | | | * tests/test-select.h (test_bad_fd): Use an fd < FD_SETSIZE.