summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-06-28 04:18:55 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-06-28 04:18:55 +0200
commit7b65dbd4ebade81d504cfe5e681292a58ad1fdf0 (patch)
tree7f538708782712f993180dd6363e46bf0cfe8eaa /tests
parentf7c3580478601e3a77dc864e5a1d91c1edad5187 (diff)
New upstream version 0.9.10upstream/0.9.10
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.gnulib1
-rw-r--r--tests/Makefile.in8
-rw-r--r--tests/dirname.h2
-rw-r--r--tests/dosname.h5
-rw-r--r--tests/error.c4
-rw-r--r--tests/getpagesize.c2
-rw-r--r--tests/glthread/thread.h4
-rw-r--r--tests/inttypes.in.h6
-rw-r--r--tests/locale.in.h11
-rw-r--r--tests/msvc-nothrow.h2
-rw-r--r--tests/putenv.c4
-rw-r--r--tests/setlocale.c8
-rw-r--r--tests/sigprocmask.c2
-rw-r--r--tests/sleep.c2
-rw-r--r--tests/stdio.in.h4
-rw-r--r--tests/test-localename.c15
-rw-r--r--tests/test-mbrtowc-w32.c2
-rw-r--r--tests/test-pthread_sigmask1.c2
-rw-r--r--tests/test-sigprocmask.c2
-rw-r--r--tests/test-wcrtomb-w32.c2
-rw-r--r--tests/xalloc.h6
-rw-r--r--tests/zerosize-ptr.h13
22 files changed, 67 insertions, 40 deletions
diff --git a/tests/Makefile.gnulib b/tests/Makefile.gnulib
index 0127385..6499773 100644
--- a/tests/Makefile.gnulib
+++ b/tests/Makefile.gnulib
@@ -372,6 +372,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 865d1f9..4e4eb0b 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -4088,6 +4088,7 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
HAVE_DECL_TANL = @HAVE_DECL_TANL@
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
@@ -4138,6 +4139,7 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
HAVE_ILOGB = @HAVE_ILOGB@
HAVE_ILOGBF = @HAVE_ILOGBF@
HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_ISBLANK = @HAVE_ISBLANK@
HAVE_ISNAND = @HAVE_ISNAND@
@@ -4256,7 +4258,6 @@ HAVE_TANHF = @HAVE_TANHF@
HAVE_TANL = @HAVE_TANL@
HAVE_TIMEGM = @HAVE_TIMEGM@
HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
-HAVE_TRUNCATE = @HAVE_TRUNCATE@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_TZSET = @HAVE_TZSET@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -14100,6 +14101,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
diff --git a/tests/dirname.h b/tests/dirname.h
index 69aeb86..8b51111 100644
--- a/tests/dirname.h
+++ b/tests/dirname.h
@@ -36,7 +36,7 @@ extern "C" {
#endif
# if GNULIB_DIRNAME
-char *base_name (char const *file);
+char *base_name (char const *file) _GL_ATTRIBUTE_MALLOC;
char *dir_name (char const *file);
# endif
diff --git a/tests/dosname.h b/tests/dosname.h
index 66486d5..fef3b6d 100644
--- a/tests/dosname.h
+++ b/tests/dosname.h
@@ -20,9 +20,8 @@
#ifndef _DOSNAME_H
#define _DOSNAME_H
-#if (defined _WIN32 || defined __WIN32__ || \
- defined __MSDOS__ || defined __CYGWIN__ || \
- defined __EMX__ || defined __DJGPP__)
+#if (defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
/* This internal macro assumes ASCII, but all hosts that support drive
letters use ASCII. */
# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
diff --git a/tests/error.c b/tests/error.c
index 81788c7..adc8733 100644
--- a/tests/error.c
+++ b/tests/error.c
@@ -93,7 +93,7 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# include <fcntl.h>
# include <unistd.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -131,7 +131,7 @@ int strerror_r (int errnum, char *buf, size_t buflen);
static int
is_open (int fd)
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows: The initial state of unassigned standard file
descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
There is no fcntl, and the gnulib replacement fcntl does not support
diff --git a/tests/getpagesize.c b/tests/getpagesize.c
index 2a01563..9e79ed6 100644
--- a/tests/getpagesize.c
+++ b/tests/getpagesize.c
@@ -23,7 +23,7 @@
#include <unistd.h>
/* This implementation is only for native Windows systems. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
diff --git a/tests/glthread/thread.h b/tests/glthread/thread.h
index 8bc857f..1e266bd 100644
--- a/tests/glthread/thread.h
+++ b/tests/glthread/thread.h
@@ -149,8 +149,8 @@ extern int glthread_in_use (void);
# endif
# if !PTHREAD_IN_USE_DETECTION_HARD
-# pragma weak pthread_cancel
-# define pthread_in_use() (pthread_cancel != NULL)
+# pragma weak pthread_mutexattr_gettype
+# define pthread_in_use() (pthread_mutexattr_gettype != NULL)
# endif
# else
diff --git a/tests/inttypes.in.h b/tests/inttypes.in.h
index ca3cec5..c7d7968 100644
--- a/tests/inttypes.in.h
+++ b/tests/inttypes.in.h
@@ -52,7 +52,7 @@
/* Get CHAR_BIT. */
#include <limits.h>
/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# include <stdio.h>
#endif
@@ -1067,11 +1067,13 @@ _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
#endif
#if @GNULIB_IMAXDIV@
-# if !@HAVE_DECL_IMAXDIV@
+# if !@HAVE_IMAXDIV_T@
# if !GNULIB_defined_imaxdiv_t
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# define GNULIB_defined_imaxdiv_t 1
# endif
+# endif
+# if !@HAVE_DECL_IMAXDIV@
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
diff --git a/tests/locale.in.h b/tests/locale.in.h
index 1b27f1f..804261d 100644
--- a/tests/locale.in.h
+++ b/tests/locale.in.h
@@ -19,10 +19,13 @@
#endif
@PRAGMA_COLUMNS@
-#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
+#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
+ || defined _GL_ALREADY_INCLUDING_LOCALE_H
-/* Special invocation conventions to handle Solaris header files
- (through Solaris 10) when combined with gettext's libintl.h. */
+/* Special invocation convention:
+ - Inside mingw header files,
+ - To handle Solaris header files (through Solaris 10) when combined
+ with gettext's libintl.h. */
#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
@@ -212,5 +215,5 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
#endif
#endif /* _@GUARD_PREFIX@_LOCALE_H */
-#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
diff --git a/tests/msvc-nothrow.h b/tests/msvc-nothrow.h
index f7a7f8a..a9671c3 100644
--- a/tests/msvc-nothrow.h
+++ b/tests/msvc-nothrow.h
@@ -25,7 +25,7 @@
This file defines wrappers that turn such an invalid parameter notification
into an error code. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* Get original declaration of _get_osfhandle. */
# include <io.h>
diff --git a/tests/putenv.c b/tests/putenv.c
index 556d5f8..801e372 100644
--- a/tests/putenv.c
+++ b/tests/putenv.c
@@ -34,7 +34,7 @@
#include <string.h>
#include <unistd.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -153,7 +153,7 @@ putenv (char *string)
*ep = string;
break;
}
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (putenv_result == 0)
{
/* _putenv propagated "NAME= " into the subprocess environment;
diff --git a/tests/setlocale.c b/tests/setlocale.c
index 5ac7f72..1ac3f4d 100644
--- a/tests/setlocale.c
+++ b/tests/setlocale.c
@@ -72,7 +72,7 @@ category_to_name (int category)
return retval;
}
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* The native Windows setlocale() function expects locale names of the form
"German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need
@@ -635,7 +635,7 @@ setlocale_unixlike (int category, const char *locale)
/* The native Windows implementation of setlocale understands the special
locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
if (locale != NULL && strcmp (locale, "POSIX") == 0)
locale = "C";
#endif
@@ -852,7 +852,7 @@ rpl_setlocale (int category, const char *locale)
if (setlocale_unixlike (LC_ALL, base_name) == NULL)
goto fail;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
/* On native Windows, setlocale(LC_ALL,...) may succeed but set the
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
@@ -903,7 +903,7 @@ rpl_setlocale (int category, const char *locale)
}
else
{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
{
char *saved_locale;
diff --git a/tests/sigprocmask.c b/tests/sigprocmask.c
index 0a8cd53..7a49bcd 100644
--- a/tests/sigprocmask.c
+++ b/tests/sigprocmask.c
@@ -50,7 +50,7 @@
/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
for the signal SIGABRT. Only one signal handler is stored for both
SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef SIGABRT_COMPAT
# define SIGABRT_COMPAT 6
#endif
diff --git a/tests/sleep.c b/tests/sleep.c
index 0b58697..8b75390 100644
--- a/tests/sleep.c
+++ b/tests/sleep.c
@@ -24,7 +24,7 @@
#include "verify.h"
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
diff --git a/tests/stdio.in.h b/tests/stdio.in.h
index b9a43bb..ff7c9c8 100644
--- a/tests/stdio.in.h
+++ b/tests/stdio.in.h
@@ -122,7 +122,7 @@
it before we #define perror rpl_perror. */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
# include <stdlib.h>
#endif
@@ -133,7 +133,7 @@
it before we #define rename rpl_rename. */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
- && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
# include <io.h>
#endif
diff --git a/tests/test-localename.c b/tests/test-localename.c
index c0952a1..4e8d146 100644
--- a/tests/test-localename.c
+++ b/tests/test-localename.c
@@ -155,7 +155,16 @@ test_locale_name (void)
if (setlocale (LC_ALL, "") != NULL)
{
name = gl_locale_name (LC_CTYPE, "LC_CTYPE");
+#if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, here,
+ gl_locale_name_thread (LC_CTYPE, "LC_CTYPE")
+ returns NULL and
+ gl_locale_name_posix (LC_CTYPE, "LC_CTYPE")
+ returns either "de_DE" or "de_DE.UTF-8". */
+ ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0);
+#else
ASSERT (strcmp (name, "de_DE.UTF-8") == 0);
+#endif
name = gl_locale_name (LC_MESSAGES, "LC_MESSAGES");
ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
}
@@ -575,7 +584,11 @@ test_locale_name_posix (void)
if (setlocale (LC_ALL, "") != NULL)
{
name = gl_locale_name_posix (LC_CTYPE, "LC_CTYPE");
+#if defined _WIN32 && !defined __CYGWIN__
+ ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0);
+#else
ASSERT (strcmp (name, "de_DE.UTF-8") == 0);
+#endif
name = gl_locale_name_posix (LC_MESSAGES, "LC_MESSAGES");
ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
}
@@ -737,7 +750,7 @@ test_locale_name_default (void)
/* Only Mac OS X and Windows have a facility for the user to set the default
locale. */
-#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__ || defined __CYGWIN__))
+#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __CYGWIN__))
ASSERT (strcmp (name, "C") == 0);
#endif
diff --git a/tests/test-mbrtowc-w32.c b/tests/test-mbrtowc-w32.c
index 2f83386..ba4d755 100644
--- a/tests/test-mbrtowc-w32.c
+++ b/tests/test-mbrtowc-w32.c
@@ -26,7 +26,7 @@
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
static int
test_one_locale (const char *name, int codepage)
diff --git a/tests/test-pthread_sigmask1.c b/tests/test-pthread_sigmask1.c
index fc4d3d0..92edb77 100644
--- a/tests/test-pthread_sigmask1.c
+++ b/tests/test-pthread_sigmask1.c
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (pthread_sigmask, int, (int, const sigset_t *, sigset_t *));
#include "macros.h"
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
static volatile int sigint_occurred;
diff --git a/tests/test-sigprocmask.c b/tests/test-sigprocmask.c
index bf8e3a6..7b09bb1 100644
--- a/tests/test-sigprocmask.c
+++ b/tests/test-sigprocmask.c
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *));
#include "macros.h"
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
static volatile int sigint_occurred;
diff --git a/tests/test-wcrtomb-w32.c b/tests/test-wcrtomb-w32.c
index e8576c7..19770d1 100644
--- a/tests/test-wcrtomb-w32.c
+++ b/tests/test-wcrtomb-w32.c
@@ -25,7 +25,7 @@
#include "macros.h"
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
static int
test_one_locale (const char *name, int codepage)
diff --git a/tests/xalloc.h b/tests/xalloc.h
index 2a51b84..c419a2d 100644
--- a/tests/xalloc.h
+++ b/tests/xalloc.h
@@ -36,12 +36,6 @@ extern "C" {
#endif
-#if __GNUC__ >= 3
-# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define _GL_ATTRIBUTE_MALLOC
-#endif
-
#if ! defined __clang__ && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
diff --git a/tests/zerosize-ptr.h b/tests/zerosize-ptr.h
index e4867e9..d5592c5 100644
--- a/tests/zerosize-ptr.h
+++ b/tests/zerosize-ptr.h
@@ -18,6 +18,19 @@
argument. Therefore this file produces a non-NULL pointer which cannot
be dereferenced, if possible. */
+/* On Android, when targeting Android 4.4 or older with a GCC toolchain,
+ prevent a compilation error
+ "error: call to 'mmap' declared with attribute error: mmap is not
+ available with _FILE_OFFSET_BITS=64 when using GCC until android-21.
+ Either raise your minSdkVersion, disable _FILE_OFFSET_BITS=64, or
+ switch to Clang."
+ The files that we access in this compilation unit are less than 2 GB
+ large. */
+#if defined __ANDROID__
+# undef _FILE_OFFSET_BITS
+# undef __USE_FILE_OFFSET64
+#endif
+
#include <stdlib.h>
/* Test whether mmap() and mprotect() are available.