[v3, preapproved] Tweak money_*_members_*.cc for Euro

Paolo Carlini pcarlini@unitus.it
Mon May 13 06:23:00 GMT 2002


Hi,

I have committed the below, pre-approved by Benjamin Kosnik and tested 
on i686-pc-linux-gnu jointly with the patch provided by Benjamin in 
libstdc++/6410 audit trail. Notice that, as expected, without a fix for 
6410, the patch causes money_get_members_wchar_t.cc and 
money_put_members_wchar_t.cc to regress.

Ciao, Paolo.

////////////////////

2002-05-13  Paolo Carlini  <pcarlini@unitus.it>
            Jakub Jelinek  <jakub@redhat.com>

        * testsuite/22_locale/money_get_members_char.cc
        (test01, test02, test04): Use the de_DE@euro named locale
        instead of de_DE to allow for an uniform behaviour with
        both old and Euro-era localedata; tweak some tests.
        * testsuite/22_locale/money_get_members_wchar_t.cc
        (test01, test02, test04): Likewise.
        * testsuite/22_locale/money_put_members_char.cc
        (test01, test02, test04): Likewise.
        * testsuite/22_locale/money_put_members_wchar_t.cc
        (test01, test02, test04): Likewise.

===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- gcc/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc	2002/05/13 10:58:13	1.16
+++ gcc/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc	2002/05/13 12:31:50	1.17
@@ -41,7 +41,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -122,7 +122,7 @@
   // now try with showbase, to get currency symbol in format
   iss.setf(ios_base::showbase);
 
-  iss.str("7.200.000.000,00 DEM ");
+  iss.str("7.200.000.000,00 EUR ");
   iterator_type is_it06(iss);
   string result6;
   ios_base::iostate err06 = ios_base::goodbit;
@@ -130,7 +130,7 @@
   VERIFY( result6 == digits1 );
   VERIFY( err06 == ios_base::eofbit );
 
-  iss.str("7.200.000.000,00 DEM  "); // Extra space.
+  iss.str("7.200.000.000,00 EUR  "); // Extra space.
   iterator_type is_it07(iss);
   string result7;
   ios_base::iostate err07 = ios_base::goodbit;
@@ -138,7 +138,7 @@
   VERIFY( result7 == digits1 );
   VERIFY( err07 == ios_base::goodbit );
 
-  iss.str("7.200.000.000,00 DM"); 
+  iss.str("7.200.000.000,00 \244"); 
   iterator_type is_it08(iss);
   string result8;
   ios_base::iostate err08 = ios_base::goodbit;
@@ -216,7 +216,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -324,12 +324,12 @@
 {
 #ifdef _GLIBCPP_HAVE_SETENV 
   // Set the global locale to non-"C".
-  std::locale loc_de("de_DE");
+  std::locale loc_de("de_DE@euro");
   std::locale::global(loc_de);
 
-  // Set LANG environment variable to de_DE.
+  // Set LANG environment variable to de_DE@euro.
   const char* oldLANG = getenv("LANG");
-  if (!setenv("LANG", "de_DE", 1))
+  if (!setenv("LANG", "de_DE@euro", 1))
     {
       test01();
       test02();

===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- gcc/libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc	2002/05/13 10:58:13	1.15
+++ gcc/libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc	2002/05/13 12:31:50	1.16
@@ -42,7 +42,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -123,7 +123,7 @@
   // now try with showbase, to get currency symbol in format
   iss.setf(ios_base::showbase);
 
-  iss.str(L"7.200.000.000,00 DEM ");
+  iss.str(L"7.200.000.000,00 EUR ");
   iterator_type is_it06(iss);
   wstring result6;
   ios_base::iostate err06 = ios_base::goodbit;
@@ -131,7 +131,7 @@
   VERIFY( result6 == digits1 );
   VERIFY( err06 == ios_base::eofbit );
 
-  iss.str(L"7.200.000.000,00 DEM  "); // Extra space.
+  iss.str(L"7.200.000.000,00 EUR  "); // Extra space.
   iterator_type is_it07(iss);
   wstring result7;
   ios_base::iostate err07 = ios_base::goodbit;
@@ -139,7 +139,7 @@
   VERIFY( result7 == digits1 );
   VERIFY( err07 == ios_base::goodbit );
 
-  iss.str(L"7.200.000.000,00 DM"); 
+  iss.str(L"7.200.000.000,00 \x20ac"); 
   iterator_type is_it08(iss);
   wstring result8;
   ios_base::iostate err08 = ios_base::goodbit;
@@ -218,7 +218,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -326,12 +326,12 @@
 {
 #ifdef _GLIBCPP_HAVE_SETENV 
   // Set the global locale to non-"C".
-  std::locale loc_de("de_DE");
+  std::locale loc_de("de_DE@euro");
   std::locale::global(loc_de);
 
-  // Set LANG environment variable to de_DE.
+  // Set LANG environment variable to de_DE@euro.
   const char* oldLANG = getenv("LANG");
-  if (!setenv("LANG", "de_DE", 1))
+  if (!setenv("LANG", "de_DE@euro", 1))
     {
       test01();
       test02();

===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- gcc/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc	2002/05/13 10:58:13	1.15
+++ gcc/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc	2002/05/13 12:31:50	1.16
@@ -41,7 +41,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -97,12 +97,12 @@
   oss.str(empty);
   iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1);
   string result3 = oss.str();
-  VERIFY( result3 == "7.200.000.000,00 DEM ");
+  VERIFY( result3 == "7.200.000.000,00 EUR ");
 
   oss.str(empty);
   iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
   string result4 = oss.str();
-  VERIFY( result4 == "7.200.000.000,00 DM");
+  VERIFY( result4 == "7.200.000.000,00 \244");
 
   // intl and non-intl versions should be different.
   VERIFY( result3 != result4 );
@@ -175,7 +175,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -228,12 +228,12 @@
   oss.str(empty);
   iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1);
   string result3 = oss.str();
-  VERIFY( result3 == "7.200.000.000,00 DEM ");
+  VERIFY( result3 == "7.200.000.000,00 EUR ");
 
   oss.str(empty);
   iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
   string result4 = oss.str();
-  VERIFY( result4 == "7.200.000.000,00 DM");
+  VERIFY( result4 == "7.200.000.000,00 \244");
 
   // intl and non-intl versions should be different.
   VERIFY( result3 != result4 );
@@ -288,12 +288,12 @@
 {
 #ifdef _GLIBCPP_HAVE_SETENV 
   // Set the global locale to non-"C".
-  std::locale loc_de("de_DE");
+  std::locale loc_de("de_DE@euro");
   std::locale::global(loc_de);
 
-  // Set LANG environment variable to de_DE.
+  // Set LANG environment variable to de_DE@euro.
   const char* oldLANG = getenv("LANG");
-  if (!setenv("LANG", "de_DE", 1))
+  if (!setenv("LANG", "de_DE@euro", 1))
     {
       test01();
       test02();

===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- gcc/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc	2002/05/13 10:58:13	1.14
+++ gcc/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc	2002/05/13 12:31:50	1.15
@@ -42,7 +42,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -97,12 +97,12 @@
   oss.str(empty);
   iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1);
   wstring result3 = oss.str();
-  VERIFY( result3 == L"7.200.000.000,00 DEM ");
+  VERIFY( result3 == L"7.200.000.000,00 EUR ");
 
   oss.str(empty);
   iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
   wstring result4 = oss.str();
-  VERIFY( result4 == L"7.200.000.000,00 DM");
+  VERIFY( result4 == L"7.200.000.000,00 \x20ac");
 
   // intl and non-intl versions should be different.
   VERIFY( result3 != result4 );
@@ -175,7 +175,7 @@
   locale loc_c = locale::classic();
   locale loc_hk("en_HK");
   locale loc_fr("fr_FR@euro");
-  locale loc_de("de_DE");
+  locale loc_de("de_DE@euro");
   VERIFY( loc_c != loc_de );
   VERIFY( loc_hk != loc_fr );
   VERIFY( loc_hk != loc_de );
@@ -228,12 +228,12 @@
   oss.str(empty);
   iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1);
   wstring result3 = oss.str();
-  VERIFY( result3 == L"7.200.000.000,00 DEM ");
+  VERIFY( result3 == L"7.200.000.000,00 EUR ");
 
   oss.str(empty);
   iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1);
   wstring result4 = oss.str();
-  VERIFY( result4 == L"7.200.000.000,00 DM");
+  VERIFY( result4 == L"7.200.000.000,00 \x20ac");
 
   // intl and non-intl versions should be different.
   VERIFY( result3 != result4 );
@@ -288,12 +288,12 @@
 {
 #ifdef _GLIBCPP_HAVE_SETENV 
   // Set the global locale to non-"C".
-  std::locale loc_de("de_DE");
+  std::locale loc_de("de_DE@euro");
   std::locale::global(loc_de);
 
-  // Set LANG environment variable to de_DE.
+  // Set LANG environment variable to de_DE@euro.
   const char* oldLANG = getenv("LANG");
-  if (!setenv("LANG", "de_DE", 1))
+  if (!setenv("LANG", "de_DE@euro", 1))
     {
       test01();
       test02();








More information about the Gcc-patches mailing list