diff options
Diffstat (limited to 'libstdc++-v3/testsuite/22_locale/money_get_members_char.cc')
-rw-r--r-- | libstdc++-v3/testsuite/22_locale/money_get_members_char.cc | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc b/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc index efe806fed33..bf2e47e3a9c 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc @@ -41,7 +41,7 @@ void test01() 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 @@ void test01() // 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 @@ void test01() 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 @@ void test01() 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 @@ void test02() 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 ); @@ -236,13 +236,13 @@ void test02() const string empty; // total EPA budget FY 2002 - const long double digits1 = 720000000000; + const long double digits1 = 720000000000.0; // est. cost, national missile "defense", expressed as a loss in USD 2001 - const long double digits2 = -10000000000000; + const long double digits2 = -10000000000000.0; // input less than frac_digits - const long double digits4 = -1; + const long double digits4 = -1.0; iterator_type end; istringstream iss; @@ -324,12 +324,12 @@ void test04() { #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(); @@ -546,6 +546,26 @@ void test07() VERIFY( val_b_ns == "123456" ); } +// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html +void test08() +{ + bool test = true; + + const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp"); + if (tentLANG != NULL) + { + std::string preLANG = tentLANG; + test01(); + test02(); + test03(); + test05(); + test06(); + test07(); + std::string postLANG = std::setlocale(LC_ALL, NULL); + VERIFY( preLANG == postLANG ); + } +} + int main() { test01(); @@ -555,5 +575,6 @@ int main() test05(); test06(); test07(); + test08(); return 0; } |