bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duplocale test on AIX 7.1BETA


From: Rainer Tammer
Subject: Re: duplocale test on AIX 7.1BETA
Date: Sat, 31 Jul 2010 09:46:26 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

Hello Bruno,
the duplocale() is new to AIX 7BETA.

The AIX 7BETA does not contain all locales, so it could be possible that
this fails.

Bruno Haible wrote:
> Hello Rainer,
>
> Regarding this test failure:
>
>   test-duplocale.c:70: assertion failed
>   FAIL: test-duplocale
>
> What does the following test program print?
>
> ===============================================================================
> #define _GNU_SOURCE
> #define _ALL_SOURCE
> #include <locale.h>
> #include <errno.h>
> #include <stdio.h>
>
> int main ()
> {
>   int i;
>   for (i = 0; i < 3; i++)
>     {
>       if (i == 1)
>         setlocale (LC_ALL, "en_US.UTF-8");
>       if (i == 2)
>         {
>           setlocale (LC_NUMERIC, "de_DE.UTF-8");
>           setlocale (LC_TIME, "fr_FR.UTF-8");
>         }
>       {
>         locale_t l = duplocale (LC_GLOBAL_LOCALE);
>         if (l != 0)
>           fprintf (stderr, "i = %d: OK\n", i);
>         else
>           {
>             int err = errno;
>             fprintf (stderr, "i = %d: errno = %d\n", i, err);
>             errno = err; perror ("");
>           }
>       }
>     }
>   return 0;
> }
> ===============================================================================
>
>   

# ./a.out
i = 0: errno = 22
Invalid argument
i = 1: errno = 22
Invalid argument
i = 2: errno = 22
Invalid argument

> Bruno
>
>
>   
Bye
  Rainer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]