This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] 18969 - multiple string test failures due to missing locale dependencies


Martin,

OK to checkin with one nit fixed.

On 09/24/2015 05:58 PM, Martin Sebor wrote:
> 2015-09-15  Martin Sebor  <msebor@redhat.com>
> 
>     * string/Makefile (LOCALES): Define.
>     (gen-locales.mk): Include.
>     (test-strcasecmp.out, test-strncasecmp.out, tst-strxfrm.out)
>     (tst-strxfrm2.out): Add deppendency on $(gen-locales).
>     * string/tst-strxfrm2.c (do_test): Print the name of the locale
>     on setlocale failure.
> 
> diff --git a/string/Makefile b/string/Makefile
> index 8424a61..0d8df0b 100644
> --- a/string/Makefile
> +++ b/string/Makefile
> @@ -75,4 +75,13 @@ ifeq ($(run-built-tests),yes)
>  $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
>         cmp $^ > $@; \
>         $(evaluate-test)
> +
> +LOCALES = de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 tr_TR.ISO-8859-9 tr_TR.UTF-8

Please use ":=" to avoid any possible deferred expansion, which
we presently never want with LOCALES.

> +include ../gen-locales.mk
> +
> +$(objpfx)test-strcasecmp.out: $(gen-locales)
> +$(objpfx)test-strncasecmp.out: $(gen-locales)
> +$(objpfx)tst-strxfrm.out: $(gen-locales)
> +$(objpfx)tst-strxfrm2.out: $(gen-locales)

OK.

> +
>  endif
> diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
> index d5a1115..bea5aa2 100644
> --- a/string/tst-strxfrm2.c
> +++ b/string/tst-strxfrm2.c
> @@ -5,6 +5,8 @@
>  static int
>  do_test (void)
>  {
> +  static const char test_locale[] = "de_DE.UTF-8";

OK.

> +
>    int res = 0;
> 
>    char buf[20];
> @@ -38,9 +40,9 @@ do_test (void)
>        res = 1;
>      }
> 
> -  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
> +  if (setlocale (LC_ALL, test_locale) == NULL)
>      {
> -      puts ("setlocale failed");
> +      printf ("cannot set locale \"%s\"\n", test_locale);

OK. Thanks for fixing this.

>        res = 1;
>      }
>    else

OK, with the nit fixed.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]