libstdc++ tests assumes all locale data are available

H. J. Lu hjl@lucon.org
Mon Dec 2 12:04:00 GMT 2002


I got

XFAIL: 20_util/auto_ptr_neg.cc (test for excess errors)
FAIL: 22_locale/codecvt_members_char_char.cc execution test
FAIL: 22_locale/codecvt_members_wchar_t_char.cc execution test
XFAIL: 22_locale/collate_byname.cc execution test
XFAIL: 22_locale/collate_members_char.cc execution test
XFAIL: 22_locale/collate_members_wchar_t.cc execution test
FAIL: 22_locale/ctor_copy_dtor.cc execution test
XFAIL: 22_locale/ctype_is_char.cc execution test
XFAIL: 22_locale/ctype_is_wchar_t.cc execution test
FAIL: 22_locale/ctype_narrow_wchar_t.cc execution test
FAIL: 22_locale/ctype_to_char.cc execution test
FAIL: 22_locale/ctype_to_wchar_t.cc execution test
FAIL: 22_locale/facet.cc execution test
XFAIL: 22_locale/members.cc execution test
XFAIL: 22_locale/messages_byname.cc execution test
XFAIL: 22_locale/messages_members_char.cc execution test
XFAIL: 22_locale/money_get_members_char.cc execution test
XFAIL: 22_locale/money_get_members_wchar_t.cc execution test
XFAIL: 22_locale/money_put_members_char.cc execution test
XFAIL: 22_locale/money_put_members_wchar_t.cc execution test
XFAIL: 22_locale/moneypunct_byname.cc execution test
XFAIL: 22_locale/moneypunct_members_char.cc execution test
XFAIL: 22_locale/moneypunct_members_wchar_t.cc execution test
XFAIL: 22_locale/num_get_members_char.cc execution test
XFAIL: 22_locale/num_get_members_wchar_t.cc execution test
XFAIL: 22_locale/num_put_members_char.cc execution test
XFAIL: 22_locale/num_put_members_wchar_t.cc execution test
XFAIL: 22_locale/numpunct_byname.cc execution test
XFAIL: 22_locale/numpunct_members_char.cc execution test
XFAIL: 22_locale/numpunct_members_wchar_t.cc execution test
XFAIL: 22_locale/time_get_members_char.cc execution test
XFAIL: 22_locale/time_get_members_wchar_t.cc execution test
XFAIL: 22_locale/time_put_members_char.cc execution test
XFAIL: 22_locale/time_put_members_wchar_t.cc execution test
FAIL: 26_numerics/c99_classification_macros_c.cc (test for excess errors)
FAIL: 27_io/ostream_inserter_arith.cc execution test
FAIL: 27_io/ostream_inserter_char.cc execution test

on Linux. The problem is many tests do something like

  // 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); 
    }


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?


H.J.



More information about the Gcc mailing list