summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* getopt: fix parallel test failureEric Blake2016-12-293-2/+4
| | | | | | | | | | | | I hit a testsuite failure due to a failure removing test-getopt.tmp, when running tests in parallel. * tests/test-getopt-posix.c (TEST_GETOPT_TMP_NAME): Set name. * tests/test-getopt-gnu.c (TEST_GETOPT_TMP_NAME): Likewise. * tests/test-getopt-main.h (main): Use different file names in case test-getopt-gnu and test-getopt-posix run in parallel. Signed-off-by: Eric Blake <eblake@redhat.com>
* lock test: Fix performance problem on multi-core machines.Bruno Haible2016-12-241-12/+67
| | | | | | | | | | | | | | | * tests/test-lock.c (USE_VOLATILE): New macro. (struct atomic_int): New type. (init_atomic_int, get_atomic_int_value, set_atomic_int_value): New functions. (lock_checker_done, rwlock_checker_done, reclock_checker_done): Define as 'struct atomic_int'. (lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock, reclock_checker_thread, test_recursive_lock): Use the new functions. Reported by Eric Blake in https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html and by Pádraig Brady in http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.
* Split tests for getopt-posix and getopt-gnu.Bruno Haible2016-12-183-37/+81
| | | | | | | | | | | | | * tests/test-getopt-posix.c: New file. * tests/test-getopt-gnu.c: New file, with code from test-getopt.c. * tests/test-getopt-main.h: Renamed from tests/test-getopt.c. Remove stuff moved to test-getopt-gnu.c. Test TEST_GETOPT_GNU instead of GNULIB_TEST_GETOPT_GNU. * modules/getopt-posix-tests (Files): Add test-getopt-posix.c, test-getopt-main.h. Remove test-getopt.c, test-getopt_long.h. (Makefile.am): Test test-getopt-posix instead of test-getopt. * modules/getopt-gnu-tests: New file. * modules/getopt-gnu (configure.ac): Don't define GNULIB_TEST_GETOPT_GNU.
* getopt: Fix link error for users of getopt() in <unistd.h>.Bruno Haible2016-12-181-1/+11
| | | | | | | | * lib/getopt.in.h (getopt etc.): Do the macro definitions also when __need_getopt is defined. Undefine all macros before defining them. * modules/getopt (Include): Clarify that including <unistd.h> is also OK. * tests/test-getopt.c: Add comment.
* getaddrinfo tests: Avoid compilation error on MSVC.Bruno Haible2016-12-181-1/+6
| | | | | * tests/test-getaddrinfo.c: Don't check the prototypes of freeaddrinfo, getaddrinfo on native Windows.
* getlogin_r tests: Port to mingw.Bruno Haible2016-12-171-1/+3
| | | | * tests/test-getlogin_r.c: Don't include <pwd.h> on native Windows.
* getlogin: Port to newer mingw.Bruno Haible2016-12-171-1/+3
| | | | | | | | | | | * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_GETLOGIN. * m4/getlogin.m4 (gl_FUNC_GETLOGIN): Set HAVE_DECL_GETLOGIN. * modules/unistd (Makefile.am): Substibute HAVE_DECL_GETLOGIN, not HAVE_GETLOGIN. * lib/unistd.in.h (getlogin): Test HAVE_DECL_GETLOGIN, not HAVE_GETLOGIN. * doc/posix-functions/getlogin.texi: Mention the issue. * tests/test-getlogin.c: Don't include <pwd.h> on native Windows.
* init.sh: Add possibility to not delete temporary files.Bruno Haible2016-12-161-5/+12
| | | | | * tests/init.sh (remove_tmp_): If the environment variable KEEP is set to yes, don't erase the temporary directory.
* freopen: work around glibc bug with closed fdPaul Eggert2016-11-261-0/+4
| | | | | | | | | | | | | Work around glibc bug#15589, where freopen mishandles the case where stdin etc. are already closed. * doc/posix-functions/freopen.texi (freopen): Document the bug. * lib/freopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this instead of __need_FILE, as the latter does not work with glibc. Include <fcntl.h>, for open flags. (rpl_freopen): Work around glibc bug. * m4/freopen.m4 (gl_FUNC_FREOPEN): Check for bug. * modules/freopen (Depends-on): Add fcntl-h. * tests/test-freopen.c (main): Test for bug.
* fix test driver leaks: exclude, malloc, reallocJim Meyering2016-11-203-2/+8
| | | | | | | | | | * tests/test-exclude.c (main): Fix trivial leak. * tests/test-malloc-gnu.c (main): Likewise. * tests/test-realloc-gnu.c (main): Likewise. With these changes, grep's tests are now leak free. I.e., running them with ASAN elicits no failure: make CFLAGS='-O0 -ggdb3' AM_CFLAGS=-fsanitize=address \ AM_LDFLAGS='-fsanitize=address -static-libasan' check
* Enable Unicode decoder safety unconditionally.Bruno Haible2016-11-198-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unistr.in.h (u32_mbtouc_unsafe): Assume CONFIG_UNICODE_SAFETY. * lib/unistr/u8-mblen.c (u8_mblen): Likewise. * lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise. * lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise. * lib/unistr/u8-prev.c (u8_prev): Likewise. * lib/unistr/u8-strmblen.c (u8_strmblen): Likewise. * lib/unistr/u8-strmbtouc.c (u8_strmbtouc): Likewise. * lib/unistr/u16-mblen.c (u16_mblen): Likewise. * lib/unistr/u16-mbtouc-unsafe.c (u16_mbtouc_unsafe): Likewise. * lib/unistr/u16-mbtouc-unsafe-aux.c (u16_mbtouc_unsafe_aux): Likewise. * lib/unistr/u16-prev.c (u16_prev): Likewise. * lib/unistr/u16-strmblen.c (u16_strmblen): Likewise. * lib/unistr/u16-strmbtouc.c (u16_strmbtouc): Likewise. * lib/unistr/u32-mblen.c (u32_mblen): Likewise. * lib/unistr/u32-mbtouc-unsafe.c (u32_mbtouc_unsafe): Likewise. * lib/unistr/u32-prev.c (u32_prev): Likewise. * lib/unistr/u32-next.c (u32_next): Likewise. * lib/unistr/u32-strmblen.c (u32_strmblen): Likewise. * lib/unistr/u32-strmbtouc.c (u32_strmbtouc): Likewise. * lib/uniconv/u8-conv-to-enc.c (u8_conv_to_encoding): Likewise. * lib/uniconv/u8-strconv-to-enc.c (u8_strconv_to_encoding): Likewise. * tests/unistr/test-u16-prev.c (check_invalid): Enable the CONFIG_UNICODE_SAFETY tests unconditionally. * tests/unistr/test-u32-mblen.c (main): Likewise. * tests/unistr/test-u32-mbtouc.h (test_function): Likewise. * tests/unistr/test-u32-prev.c (check_invalid): Likewise. * tests/unistr/test-u32-next.c (main): Likewise. * tests/unistr/test-u32-strmblen.c (main): Likewise. * tests/unistr/test-u32-strmbtouc.c (main): Likewise. * tests/unistr/test-u32-mbtouc.c (FULL_SAFETY): Remove macro. * lib/unistr/u8-check.c (u8_check): Remove old dead code. * lib/unistr/u8-mbtouc.c (u8_mbtouc): Likewise. * lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise. * lib/unistr/u8-mbtoucr.c (u8_mbtoucr): Likewise. * lib/unistr/u8-uctomb.c (u8_uctomb): Likewise. * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise. * lib/unistr/u16-check.c (u16_check): Update comment. * NEWS: Mention the changes that callers should be aware of.
* snippet/c++defs: fix real-floating arg functions in C++ modePedro Alves2016-11-151-2/+3
| | | | | | | | | | | | | | Also, define isfinite, isinf, isnan, signbit in the gnulib namespace instead of in the global namespace. * build-aux/snippet/c++defs.h (_GL_BEGIN_NAMESPACE) (_GL_END_NAMESPACE): New. * lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Use them. (isfinite, isinf, isnan, signbit) [__cplusplus && GNULIB_NAMESPACE]: Define them in the GNULIB_NAMESPACE namespace instead of in the global namespace. * tests/test-math-c++.cc: Check that the isfinite, isinf, isnan, signbit overloads exist in the GNULIB_NAMESPACE namespace, instead of in the global namespace.
* strftime,strptime: support %q to represent the quarterPádraig Brady2016-11-051-0/+36
| | | | | | * lib/strftime.c (strftime_case_): Add %q case. * lib/strptime.c (__strptime_internal): Likewise. * tests/test-strftime.c (quarter_test): A new test case.
* getprogname: port to HP-UXJohn David Anglin2016-10-261-1/+5
| | | | | | | See Bug#24805. * lib/getprogname.c (getprogname) [__hpux]: Port. * tests/test-getprogname.c (STREQ) [__hpux]: Special-case for HP-UX limitations on program name length.
* system-quote tests: Avoid compiler warning on AIX.Bruno Haible2016-10-221-0/+4
| | | | | * tests/test-system-quote-child.c (fopen): Redefine like the system's <stdio.h> does.
* Fix some "gcc -Wall" warnings.Bruno Haible2016-10-223-5/+12
| | | | | | | | * tests/test-ffsl.c (main): Use variable x, not i. * tests/test-posix_spawn3.c (parent_main): Consider the return value of freopen. * tests/test-sethostname1.c (main): Explicitly ignore the return value of sethostname.
* quotearg-tests: pacify gcc -WallPaul Eggert2016-10-202-9/+9
| | | | | | | Problem reported by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00066.html * tests/test-quotearg-simple.c (use_quote_double_quotes): Move here ... * tests/test-quotearg.h: ... from here.
* quotearg: never write beyond the returned lengthPádraig Brady2016-10-191-3/+2
| | | | | | | | | | | * lib/quotearg.c (quotearg_buffer_restyled): Switch to a read-only scan of the string when we initially encounter a single quote when shell quoting, so that if we then switch to a more concise quoting method we will not have written beyond that returned length. This is significant for sh-quote, which has separate routines to determine the length and do the actual quoting. * tests/test-quotearg.h: Reinstate the buffer bounds checking now that we never write more than the returned length.
* getprogname tests: Avoid failure in packages that use libtool.Bruno Haible2016-10-191-0/+7
| | | | | * tests/test-getprogname.c (main): Strip "lt-" prefix. Based on a patch by Jim Meyering.
* getprogname: Fix test failure on Cygwin. Comments.Bruno Haible2016-10-191-0/+16
| | | | | | | * lib/getprogname.h: Add comments. * lib/getprogname.c: Add comments. Fix #elif indentation. * tests/test-getprogname.c (main): On Cygwin, expect a result without ".exe" suffix.
* sh-quote, system-quote: revert regression of unit test.Bruno Haible2016-10-182-0/+4
| | | | | * tests/test-sh-quote.c (check_one): Do detect buffer overruns. * tests/test-system-quote-main.c (check_one): Likewise.
* quotearg: fix stale testsPádraig Brady2016-10-163-11/+7
| | | | | | | | | | | * tests/test-quotearg.c [locale_results]: Add the missing str7 entries to the expected results. tests/test-system-quote-main.c (check_one): Don't enforce that we don't write beyond the returned length, since that's no longer the case if we switch to a more concise quoting style. * tests/test-sh-quote.c (check_one): Likewise. (main): Adjust for the new more concise quoting style. Reported by Bruno Haible.
* Fix a test crash.Bruno Haible2016-10-161-0/+5
| | | | | * tests/test-duplocale.c (main): Skip the test if the 'newlocale' call fails.
* test-limits-h: suppress -Woverlength-stringsPádraig Brady2016-10-161-0/+4
| | | | * tests/test-limits-h.c [__GNUC__]: Ignore -Woverlength-strings.
* test-stdint: use _GL_VERIFY rather than "verify" for some testsJim Meyering2016-10-131-3/+12
| | | | | | | * tests/test-stdint.c (verify_width): Implement with _GL_VERIFY and an abbreviated diagnostic rather than verify with the full one, because the full-length strings would evoke warnings from gcc with -Woverlength-strings.
* quotearg: minimize shell quoting using double quotesPádraig Brady2016-10-032-72/+79
| | | | | | | | | | | I.E. 'it'\''s awkward like this'; "it's better like this" * lib/quotearg.c (quotearg_buffer_restyled): If an ASCII single quote in encountered then use double quotes (c style quoting) when possible, as it simplifies the quoting. * tests/test-quotearg-simple.c: Add test cases. * tests/test-quotearg.h (use_quotearg_buffer): Adjust to account for the fact we now may write beyond the returned length.
* tests/init.sh: port Alpine fix to AIX 7.1Paul Eggert2016-09-242-40/+15
| | | | | * tests/init.sh (compare_): When attempting to use diff -U3, prefer diff -u to -U3 to -c to plain diff. Do not insist on
* stdint: support new _WIDTH macrosPaul Eggert2016-09-161-0/+58
| | | | | | | | | | | | * doc/posix-headers/stdint.texi: Document this. * lib/stdint.in.h: Add support for INTMAX_WIDTH. etc. * m4/stdint.m4 (gl_STDINT_H): Require gl_LIMITS_H. Check for support for INTMAX_WIDTH, etc. as well as for support for just C99. * modules/stdint (Depends-on): Add limits-h. (Makefile.am): Substitute HAVE_C99_STDINT_H. * modules/stdint-tests (Depends-on): Add extensions, so that INTMAX_MAX etc. are defined. * tests/test-stdint.c: Verify the new macros.
* limits-h: new modulePaul Eggert2016-09-161-0/+46
| | | | | | | | This adds ISO/IEC TS 18661-1:2014 support to limits.h. * MODULES.html.sh: Add limits-h,and move size_max to stdint section. * doc/posix-headers/limits.texi: Document new module. * lib/limits.in.h, m4/limits-h.m4, modules/limits-h: * modules/limit-h-tests, tests/test-limits-h.c: New files.
* dfa: port to Solaris 9Paul Eggert2016-09-111-2/+6
| | | | | | | | | Problems reported by Tom G. Christensen in: http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00031.html * modules/dfa (Depends-on): Add isblank. * modules/dfa-tests (dfa_match_aux_LDADD): Rename from test_stat_LDADD, to fix typo. * tests/dfa-match.sh: Don't require 'timeout'; use it if available.
* dfa: new module, importing grep's DFA matcherJim Meyering2016-09-093-0/+138
| | | | | | | | | | | | | | | | Since grep's DFA matcher is now being used by two gnulib-enabled projects, grep and sed, it makes sense to version-control its sources and unit tests in one place: here. * modules/dfa: New module. * modules/dfa-tests: New file. * lib/dfa.c: New file, from grep. * lib/dfa.h: Likewise. * lib/localeinfo.c: Likewise. * lib/localeinfo.h: Likewise. * tests/dfa-match-aux.c: Likewise. * tests/dfa-invalid-char-class.sh: Likewise. * tests/dfa-match.sh: Likewise, with minor changes. * MODULES.html.sh (Misc): Add "dfa" to this list.
* getprogname-tests: work also when EXEEXT is nonemptyJim Meyering2016-09-081-1/+1
| | | | | | * modules/getprogname-tests (Makefile.am): Define EXEEXT. * tests/test-getprogname.c (main): Use it. Suggested by Gisle Vanem.
* getprogname: port to systems with __argv (mingw, msvc)Jim Meyering2016-09-071-0/+31
| | | | | | | | | | | | * lib/getprogname.c (getprogname): Include "dirname.h" and use last_component: more general than open coding it with hard-coded "/". * lib/getprogname.h (getprogname): Prefer "char const *" consistently. * modules/getprogname (Depends-on): Add dirname-lgpl. (configure.ac): Check for __argv in <stdlib.h>. * modules/getprogname-tests: New file. * tests/test-getprogname.c: New file. Suggested by Gisle Vanem in https://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00014.html
* Port tests away from prognamePino Toscano2016-09-0563-180/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules that need the program name already depend on getprogname. * modules/acl-tests (Depends-on): Remove progname. * modules/argmatch (Depends-on): Likewise. * modules/argmatch-tests (Depends-on): Likewise. * modules/argp-tests (Depends-on): Likewise. * modules/argp-version-etc-tests (Depends-on): Likewise. * modules/array-list-tests (Depends-on): Likewise. * modules/array-oset-tests (Depends-on): Likewise. * modules/avltree-list-tests (Depends-on): Likewise. * modules/avltree-oset-tests (Depends-on): Likewise. * modules/avltreehash-list-tests (Depends-on): Likewise. * modules/carray-list-tests (Depends-on): Likewise. * modules/copy-file-tests (Depends-on): Likewise. * modules/exclude-tests (Depends-on): Likewise. * modules/fchownat-tests (Depends-on): Likewise. * modules/fdopendir-tests (Depends-on): Likewise. * modules/filenamecat-tests (Depends-on): Likewise. * modules/fstatat-tests (Depends-on): Likewise. * modules/fstrcmp-tests (Depends-on): Likewise. * modules/linked-list-tests (Depends-on): Likewise. * modules/linkedhash-list-tests (Depends-on): Likewise. * modules/mkdirat-tests (Depends-on): Likewise. * modules/nonblocking-pipe-tests (Depends-on): Likewise. * modules/nonblocking-socket-tests (Depends-on): Likewise. * modules/obstack-printf-tests (Depends-on): Likewise. * modules/openat-tests (Depends-on): Likewise. * modules/parse-datetime-tests (Depends-on): Likewise. * modules/pipe-filter-gi-tests (Depends-on): Likewise. * modules/pipe-filter-ii-tests (Depends-on): Likewise. * modules/quotearg-simple-tests (Depends-on): Likewise. * modules/quotearg-tests (Depends-on): Likewise. * modules/rbtree-list-tests (Depends-on): Likewise. * modules/rbtree-oset-tests (Depends-on): Likewise. * modules/rbtreehash-list-tests (Depends-on): Likewise. * modules/spawn-pipe-tests (Depends-on): Likewise. * modules/system-quote-tests (Depends-on): Likewise. * modules/uniname/uniname-tests (Depends-on): Likewise. * modules/uninorm/nfc-tests (Depends-on): Likewise. * modules/uninorm/nfd-tests (Depends-on): Likewise. * modules/uninorm/nfkc-tests (Depends-on): Likewise. * modules/uninorm/nfkd-tests (Depends-on): Likewise. * modules/unistdio/u16-vsnprintf-tests (Depends-on): Likewise. * modules/unistdio/u16-vsprintf-tests (Depends-on): Likewise. * modules/unistdio/u32-vsnprintf-tests (Depends-on): Likewise. * modules/unistdio/u32-vsprintf-tests (Depends-on): Likewise. * modules/unistdio/u8-vsnprintf-tests (Depends-on): Likewise. * modules/unistdio/u8-vsprintf-tests (Depends-on): Likewise. * modules/unistdio/ulc-vsnprintf-tests (Depends-on): Likewise. * modules/unistdio/ulc-vsprintf-tests (Depends-on): Likewise. * modules/unlinkat-tests (Depends-on): Likewise. * modules/version-etc-tests (Depends-on): Likewise. * modules/xalloc-die-tests (Depends-on): Likewise. * modules/xmemdup0-tests (Depends-on): Likewise. * modules/xprintf-posix-tests (Depends-on): Likewise. * modules/xvasprintf-tests (Depends-on): Likewise. * tests/test-argmatch.c: Do not include progname.h. (main) Stop calling set_program_name. * tests/test-argp-version-etc.c: Likewise. * tests/test-argp.c: Likewise. * tests/test-argv-iter.c: Likewise. * tests/test-array_list.c: Likewise. * tests/test-array_oset.c: Likewise. * tests/test-avltree_list.c: Likewise. * tests/test-avltree_oset.c: Likewise. * tests/test-avltreehash_list.c: Likewise. * tests/test-carray_list.c: Likewise. * tests/test-copy-acl.c: Likewise. * tests/test-copy-file.c: Likewise. * tests/test-exclude.c: Likewise. * tests/test-fchownat.c: Likewise. * tests/test-fdopendir.c: Likewise. * tests/test-filenamecat.c: Likewise. * tests/test-fstatat.c: Likewise. * tests/test-fstrcmp.c: Likewise. * tests/test-linked_list.c: Likewise. * tests/test-linkedhash_list.c: Likewise. * tests/test-mkdirat.c: Likewise. * tests/test-nonblocking-pipe-main.c: Likewise. * tests/test-nonblocking-socket-main.c: Likewise. * tests/test-obstack-printf.c: Likewise. * tests/test-openat.c: Likewise. * tests/test-parse-datetime.c: Likewise. * tests/test-pipe-filter-gi1.c: Likewise. * tests/test-pipe-filter-gi2-main.c: Likewise. * tests/test-pipe-filter-ii1.c: Likewise. * tests/test-pipe-filter-ii2-main.c: Likewise. * tests/test-quotearg-simple.c: Likewise. * tests/test-quotearg.c: Likewise. * tests/test-rbtree_list.c: Likewise. * tests/test-rbtree_oset.c: Likewise. * tests/test-rbtreehash_list.c: Likewise. * tests/test-sameacls.c: Likewise. * tests/test-set-mode-acl.c: Likewise. * tests/test-spawn-pipe-main.c: Likewise. * tests/test-system-quote-main.c: Likewise. * tests/test-unlinkat.c: Likewise. * tests/test-version-etc.c: Likewise. * tests/test-xalloc-die.c: Likewise. * tests/test-xfprintf-posix.c: Likewise. * tests/test-xmemdup0.c: Likewise. * tests/test-xprintf-posix.c: Likewise. * tests/test-xvasprintf.c: Likewise. * tests/uniname/test-uninames.c: Likewise. * tests/uninorm/test-u32-nfc-big.c: Likewise. * tests/uninorm/test-u32-nfd-big.c: Likewise. * tests/uninorm/test-u32-nfkc-big.c: Likewise. * tests/uninorm/test-u32-nfkd-big.c: Likewise. * tests/unistdio/test-u16-vsnprintf1.c: Likewise. * tests/unistdio/test-u16-vsprintf1.c: Likewise. * tests/unistdio/test-u32-vsnprintf1.c: Likewise. * tests/unistdio/test-u32-vsprintf1.c: Likewise. * tests/unistdio/test-u8-vsnprintf1.c: Likewise. * tests/unistdio/test-u8-vsprintf1.c: Likewise. * tests/unistdio/test-ulc-vsnprintf1.c: Likewise. * tests/unistdio/test-ulc-vsprintf1.c: Likewise. * tests/test-c-stack.c: (program_name): Do not define. (main): Do not set program_name. * tests/test-closein.c: Likewise. * tests/test-xstrtol.c: Likewise. * tests/test-yesno.c: Likewise.
* strverscmp: sync with glibcPaul Eggert2016-08-301-0/+14
| | | | | | | | | | | | | | Although this doesn't exactly synchronize with glibc byte-for-byte, it makes the code behave the same as glibc. * lib/strverscmp.c (S_I, S_F, S_Z): Now masks, not powers of 2. (ISDIGIT): Remove, as glibc is sticking with isdigit, and the difference shouldn't matter in practical use. All uses changed back to isdigit. (__strverscmp, strverscmp): Use new glibc method for weak aliases. (next_state): Now unsigned char array; redo elements. (result_type): Now signed char array; redo elements. (__strverscmp): Fix glibc bug 9913 by using new states. * tests/test-strverscmp.c (main): Test glibc bug 9913.
* c-strcase-tests: port to EBCDICDaniel Richard G2016-08-191-0/+3
| | | | | | * tests/test-c-strncasecmp.c: Allow two c_strncasecmp calls which assume ASCII encoding semantics to run only in ASCII mode, as they fail in EBCDIC.
* sigpipe-tests: fix typoDaniel Richard G2016-08-191-1/+1
| | | | * tests/test-sigpipe.sh: C, not B.
* maint: port tests to z/OS errno behaviorDaniel Richard G2016-08-172-4/+4
| | | | | | | | * tests/test-nonblocking-reader.h: * tests/test-nonblocking-writer.h: Accommodate z/OS errno code preferences. (I believe this should still be within spec; IBM is good at following the letter if not the spirit of such things.)
* maint: preprocessor changes to support z/OSDaniel Richard G2016-08-174-14/+30
| | | | | | | * lib/alloca.in.h, lib/fnmatch.c, lib/get-rusage-as.c: * lib/glob.c, lib/math.in.h, lib/ptsname_r.c: * tests/infinity.h, tests/nan.h, tests/test-canonicalize-lgpl.c: * tests/test-nonblocking-pipe.h:
* iconv_open-utf-tests, iconv-tests: port to EBCDICDaniel Richard G2016-08-172-36/+75
| | | | | | | | | | | * tests/test-iconv-utf.c, tests/test-iconv.c: Added appropriately conditional #pragmas so that the test strings in test-iconv-utf.c are correctly interpreted in ASCII instead of EBCDIC (i.e. 'J' == 0x4A and not 0xD1). This issue could be addressed in a more portable way by simply rewriting all the ASCII literal characters as octal escapes, but then you would lose the partial readability that the strings have now. Also, iconv_open() on z/OS does not recognize "ISO-8859-1", but "ISO8859-1" works.
* c-strcase-tests, wcwidth-tests: port to EBCDICDaniel Richard G2016-08-172-0/+6
| | | | | | * tests/test-c-strcasecmp.c: Include c-ctype.h. (main) [!C_CTYPE_ASCII]: Skip tests that assume ASCII. * tests/test-wcwidth.c: Likewise.
* tests/init.sh: exclude dash with bad "local" semanticsJim Meyering2016-08-081-0/+8
| | | | | | | * tests/init.sh (gl_shell_test_script_): Add a function to eliminate a shell like "dash" (unlike bash, zsh) that has surprising/risky "local var='...'" semantics. Inspired by the problem and discussion in https://bugs.gnu.org/24116#11.
* intprops-test: port to GCC 6Paul Eggert2016-06-231-6/+3
| | | | | * tests/test-intprops.c: Ignore -Woverflow if any GCC version, since the bug is not fixed in GCC 6.1.
* xstrtol: prohibit monstrosities like "1bB"Paul Eggert2016-04-271-0/+4
| | | | | | | Problem reported by Young Mo Kang in: http://bugs.gnu.org/23388 * lib/xstrtol.c (__xstrtol): Allow trailing second suffixes like "B" only if the first suffix needs a base. * tests/test-xstrtol.sh: Test this.
* intprops, mktime, strtol: assume two's complementPaul Eggert2016-04-131-19/+9
| | | | | | | | | | | | | | | | | | These macros were not portable to every conforming C11 ones' complement platform. It's not worth the hassle of porting to some platforms that use ones' complement or signed magnitude, as such platforms are almost purely theoretical nowadays and porting even to some of them makes the code harder to review for little practical benefit. Problem reported by Florian Weimer in: https://sourceware.org/ml/libc-alpha/2016-04/msg00295.html * lib/intprops.h (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE, _GL_INT_TWOS_COMPLEMENT): * lib/mktime.c (TYPE_TWOS_COMPLEMENT): * lib/strtol.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE): Remove. All uses rewritten to assume two's complement, which is all we can reasonably test nowadays anyway. * top/maint.mk (_intprops_names): Remove the removed macros.
* mbrtowc: work around glibc bug#19932Paul Eggert2016-04-092-1/+16
| | | | | | | | | | | | | | | | | | | | | | | Fix mbrtowc so that it never returns -1 in the C locale, as this conflicts with a future version of POSIX http://austingroupbugs.net/view.php?id=663#c2738 and causes problems with GNU grep: http://bugs.gnu.org/23234 See glibc bug 19932: https://sourceware.org/bugzilla/show_bug.cgi?id=19932 * doc/posix-functions/mbrlen.texi (mbrlen): * doc/posix-functions/mbrtowc.texi (mbrtowc): Document the glibc bug. * lib/mbrtowc.c [C_LOCALE_MAYBE_EILSEQ]: Include hard-locale.h, locale.h. (rpl_mbrtowc): Work around the C_LOCALE_MAYBE_EILSEQ bug, if the bug is possible. * m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): New macro. (gl_FUNC_MBRTOWC): Use it, and define C_LOCALE_MAYBE_EILSEQ as needed. * modules/hard-locale (License): Now LGPLv2+, for mbrtowc. * modules/mbrtowc (Depends-on): Add hard-locale. * modules/mbrtowc-tests (Files, TESTS): Add tests/test-mbrtowc5.sh. * tests/test-mbrtowc.c (main): Test for bug fix if arg is '5'. * tests/test-mbrtowc5.sh: New file.
* argp: merge changes from glibcPaul Eggert2016-04-031-4/+4
| | | | | | | | | | | | | Among other things, this should fix problems found by a Coverity scan and reported by Andrei Borzenkov: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00015.html http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00016.html * lib/argp-ba.c, lib/argp-fmtstream.c, lib/argp-fmtstream.h: * lib/argp-fs-xinl.c, lib/argp-help.c, lib/argp-namefrob.h: * lib/argp-parse.c, lib/argp-pv.c, lib/argp-pvh.c, lib/argp-xinl.c: * lib/argp.h: Merge changes from glibc. * tests/test-argp-2.sh: Adjust to match new behavior.
* test-framework-sh: minor cleanupsPaul Eggert2016-03-251-11/+8
| | | | | | | | | | * tests/init.sh (testdir_prefix_): Output a trailing newline, since strictly speaking POSIX requires this. (setup_): Do not use the variable 'fail', as that makes the trace output harder to read ('fail' is typically used by tests to mean the test failed). Treat // portably. Check that new directory is not merely a sibling of the tmp dir. Avoid unnecessary invocation of tr.
* test-framework-sh: revert port to NetBSD 7.0Paul Eggert2016-03-251-11/+26
| | | | | | | | | It was a false alarm; I misinterpreted Assaf Gordon's report. * tests/init.sh (testdir_prefix_, pfx_, template_length_): Restore. (test_dir_): Adjust to mktempd_ change. (mktempd_): Restore 2nd arg. Use -t again. (base_template_, template_, nx_): Resurrect old code.
* Port better to Alpine LinuxPaul Eggert2016-03-251-3/+9
| | | | | | | Its diff implementation does not support -c, but does support -U3. Problem reported by Assaf Gordon in: http://bugs.gnu.org/23107#13 * tests/init.sh (diff_opt_): New var. (compare_): Prefer diff -U3 to diff -c to plain diff.