libstdc++ tests assumes all locale data are available

Paolo Carlini pcarlini@unitus.it
Mon Dec 2 12:18:00 GMT 2002


H. J. Lu wrote:

>It doesn't look right to me since the de_DE locale may not be available
>on the host machine. Shouldn't
>
>  try
>    {
>      // Set the global locale to non-"C".
>      std::locale loc_de("de_DE");
>      std::locale::global(loc_de);
>
>      // Set LANG environment variable to de_DE.
>      const char* oldLANG = getenv("LANG");
>      if (!setenv("LANG", "de_DE", 1))
>        {
>          test01();
>          setenv("LANG", oldLANG ? oldLANG : "", 1); 
>        }
>    }
>  catch (runtime_error& obj)
>    {
>      cout << "de_DE: " << obj.what () << endl;
>    }
>
>be used instead?
>
Perhaps. However, Benjamin added some specific notes about this in the 
install documentation:

    http://gcc.gnu.org/onlinedocs/libstdc++/install.html

In particular:

If the 'gnu' locale model is being used, the following locales are used 
and tested in the libstdc++ testsuites: en_HK, en_US, fr_FR, fr_FR@euro, 
de_DE, de_DE@euro, ja_JP.eucjp, es_MX, en_PH, and it_IT. Failure to have 
the underlying "C" library locale information installed will mean that 
C++ named locales for the above regions will not work: because of this, 
the libstdc++ testsuite will not pass the named locale tests. If this 
isn't an issue, don't worry about it. If named locales are needed, the 
underlying locale information must be installed. Note that rebuilding 
libstdc++ after the "C" locales are installed is not necessary.

So...

Paolo.




More information about the Gcc mailing list