This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] codecvt<wchar_t, char, mbstate_t>


Hi,
> FYI it looks like there might be issues with 64 bit hosts and 
> your patch
> 
> http://gcc.gnu.org/ml/gcc-testresults/2003-02/msg00332.html
> 
> you might want to contact schwab@suse directly.
> 
> -benjamin

The failures in question are:

FAIL: 22_locale/codecvt/always_noconv/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/encoding/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/codecvt/in/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/length/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/max_length/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/codecvt/out/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/unshift/wchar_t/3.cc execution test

The tests named 3.cc use the locale "en_US.ISO-8859-15". The
most likely reason for this failure is that this locale is not
installed.

One solution for this is to put a function in
testsuite_hooks.cc:

std::locale create_named_locale(const char* s)
{
  locale loc;
  try
    {
      loc = locale("foo");  // Throws runtime_error if "foo" is
                            // not a valid locale name for this
                            // system.
    }
  catch (runtime_error&)
    {
      exit(77); // Dejagnu magic number so this doesn't count
                // in the summary
    }
  return loc;
}

and then replace

locale loc ("foo");

with

locale loc (create_named_locale("foo"));

This probably needs to be done everywhere the testsuite uses named
locales other than "C" or "".

Another solution would be to have configure check for available
locales and then only run tests that use those.

The reason for the wrapped_locale.cc failures is probably that
the "generic" locale version is being used (or the "gnu" version
without __uselocale). This is a known bug: on systems without
__uselocale, the conversion is done according to the global C
locale.

Regards,
Petur


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