From 00f780822f234fc161b9003478ed8953b3fe1241 Mon Sep 17 00:00:00 2001 From: paolo Date: Sat, 21 Aug 2004 11:56:46 +0000 Subject: [PATCH] 2004-08-21 Paolo Carlini * testsuite/22_locale/money_put/put/wchar_t/1.cc: Use proper wchar_t type for the fill argument; minor formatting tweaks. * testsuite/22_locale/money_put/put/wchar_t/12971.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/2.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/3.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/4.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/5.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/6.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86362 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 11 ++++++++ .../testsuite/22_locale/money_put/put/wchar_t/1.cc | 27 ++++++++++---------- .../22_locale/money_put/put/wchar_t/12971.cc | 5 ++-- .../testsuite/22_locale/money_put/put/wchar_t/2.cc | 29 ++++++++++++---------- .../testsuite/22_locale/money_put/put/wchar_t/3.cc | 19 +++++++------- .../testsuite/22_locale/money_put/put/wchar_t/4.cc | 6 ++--- .../testsuite/22_locale/money_put/put/wchar_t/5.cc | 10 ++++---- .../testsuite/22_locale/money_put/put/wchar_t/6.cc | 8 +++--- 8 files changed, 66 insertions(+), 49 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 44f5ccb..40ef639 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,16 @@ 2004-08-21 Paolo Carlini + * testsuite/22_locale/money_put/put/wchar_t/1.cc: Use proper + wchar_t type for the fill argument; minor formatting tweaks. + * testsuite/22_locale/money_put/put/wchar_t/12971.cc: Likewise. + * testsuite/22_locale/money_put/put/wchar_t/2.cc: Likewise. + * testsuite/22_locale/money_put/put/wchar_t/3.cc: Likewise. + * testsuite/22_locale/money_put/put/wchar_t/4.cc: Likewise. + * testsuite/22_locale/money_put/put/wchar_t/5.cc: Likewise. + * testsuite/22_locale/money_put/put/wchar_t/6.cc: Likewise. + +2004-08-21 Paolo Carlini + * include/bits/basic_ios.tcc (basic_ios<>::copyfmt): Don't deal with _M_word != _M_local_word two times, redundantly. diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc index 9518d16..76d0cdd 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc @@ -49,16 +49,17 @@ void test01() // cache the money_put facet wostringstream oss; oss.imbue(loc_de); - const money_put& mon_put = use_facet >(oss.getloc()); + const money_put& mon_put = + use_facet >(oss.getloc()); - iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1); + iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits1); wstring result1 = oss.str(); - VERIFY( result1 == L"7.200.000.000,00 "); + VERIFY( result1 == L"7.200.000.000,00 " ); oss.str(empty); - iterator_type os_it02 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1); + iterator_type os_it02 = mon_put.put(oss.rdbuf(), false, oss, L' ', digits1); wstring result2 = oss.str(); - VERIFY( result2 == L"7.200.000.000,00 "); + VERIFY( result2 == L"7.200.000.000,00 " ); // intl and non-intl versions should be the same. VERIFY( result1 == result2 ); @@ -67,14 +68,14 @@ void test01() oss.setf(ios_base::showbase); oss.str(empty); - iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1); + iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits1); wstring result3 = oss.str(); - VERIFY( result3 == L"7.200.000.000,00 EUR "); + VERIFY( result3 == L"7.200.000.000,00 EUR " ); oss.str(empty); - iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1); + iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, L' ', digits1); wstring result4 = oss.str(); - VERIFY( result4 == L"7.200.000.000,00 \x20ac"); + VERIFY( result4 == L"7.200.000.000,00 \x20ac" ); // intl and non-intl versions should be different. VERIFY( result3 != result4 ); @@ -87,16 +88,16 @@ void test01() // test various fill strategies oss.str(empty); oss.width(20); - iterator_type os_it10 = mon_put.put(oss.rdbuf(), true, oss, '*', digits2); + iterator_type os_it10 = mon_put.put(oss.rdbuf(), true, oss, L'*', digits2); wstring result10 = oss.str(); - VERIFY( result10 == L"***************-,01*"); + VERIFY( result10 == L"***************-,01*" ); oss.str(empty); oss.width(20); oss.setf(ios_base::internal); - iterator_type os_it11 = mon_put.put(oss.rdbuf(), true, oss, '*', digits2); + iterator_type os_it11 = mon_put.put(oss.rdbuf(), true, oss, L'*', digits2); wstring result11 = oss.str(); - VERIFY( result11 == L"-,01****************"); + VERIFY( result11 == L"-,01****************" ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc index 1bc93e3..9af992a 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc @@ -1,6 +1,6 @@ // 2003-11-09 Paolo Carlini -// Copyright (C) 2003 Free Software Foundation +// Copyright (C) 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -36,7 +36,8 @@ void test01() // cache the money_put facet wostringstream oss; - const money_put& mon_put = use_facet >(oss.getloc()); + const money_put& mon_put = + use_facet >(oss.getloc()); iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, L' ', amount); wstring result = oss.str(); diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc index 312a505..4f6148b 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc @@ -55,45 +55,48 @@ void test02() // cache the money_put facet wostringstream oss; oss.imbue(loc_hk); - const money_put& mon_put = use_facet >(oss.getloc()); + const money_put& mon_put = + use_facet >(oss.getloc()); // now try with showbase, to get currency symbol in format oss.setf(ios_base::showbase); // test sign of more than one digit, say hong kong. oss.str(empty); - iterator_type os_it05 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1); + iterator_type os_it05 = mon_put.put(oss.rdbuf(), false, oss, L' ', digits1); wstring result5 = oss.str(); - VERIFY( result5 == L"HK$7,200,000,000.00"); + VERIFY( result5 == L"HK$7,200,000,000.00" ); oss.str(empty); - iterator_type os_it06 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits2); + iterator_type os_it06 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits2); wstring result6 = oss.str(); - VERIFY( result6 == L"(HKD 100,000,000,000.00)"); + VERIFY( result6 == L"(HKD 100,000,000,000.00)" ); // test one-digit formats without zero padding oss.imbue(loc_c); oss.str(empty); - const money_put& mon_put2 = use_facet >(oss.getloc()); - iterator_type os_it07 = mon_put2.put(oss.rdbuf(), true, oss, ' ', digits4); + const money_put& mon_put2 = + use_facet >(oss.getloc()); + iterator_type os_it07 = mon_put2.put(oss.rdbuf(), true, oss, L' ', digits4); wstring result7 = oss.str(); - VERIFY( result7 == L"1"); + VERIFY( result7 == L"1" ); // test one-digit formats with zero padding, zero frac widths oss.imbue(loc_hk); oss.str(empty); - const money_put& mon_put3 = use_facet >(oss.getloc()); - iterator_type os_it08 = mon_put3.put(oss.rdbuf(), true, oss, ' ', digits4); + const money_put& mon_put3 = + use_facet >(oss.getloc()); + iterator_type os_it08 = mon_put3.put(oss.rdbuf(), true, oss, L' ', digits4); wstring result8 = oss.str(); - VERIFY( result8 == L"(HKD .01)"); + VERIFY( result8 == L"(HKD .01)" ); oss.unsetf(ios_base::showbase); // test bunk input oss.str(empty); - iterator_type os_it09 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits3); + iterator_type os_it09 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits3); wstring result9 = oss.str(); - VERIFY( result9 == L""); + VERIFY( result9 == L"" ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc index 7e381d9..63f1609 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc @@ -46,16 +46,17 @@ void test03() // cache the money_put facet wostringstream oss; oss.imbue(loc_de); - const money_put& mon_put = use_facet >(oss.getloc()); + const money_put& mon_put = + use_facet >(oss.getloc()); - iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1); + iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits1); wstring result1 = oss.str(); - VERIFY( result1 == L"7.200.000.000,00 "); + VERIFY( result1 == L"7.200.000.000,00 " ); oss.str(empty); - iterator_type os_it02 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1); + iterator_type os_it02 = mon_put.put(oss.rdbuf(), false, oss, L' ', digits1); wstring result2 = oss.str(); - VERIFY( result2 == L"7.200.000.000,00 "); + VERIFY( result2 == L"7.200.000.000,00 " ); // intl and non-intl versions should be the same. VERIFY( result1 == result2 ); @@ -64,14 +65,14 @@ void test03() oss.setf(ios_base::showbase); oss.str(empty); - iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, ' ', digits1); + iterator_type os_it03 = mon_put.put(oss.rdbuf(), true, oss, L' ', digits1); wstring result3 = oss.str(); - VERIFY( result3 == L"7.200.000.000,00 EUR "); + VERIFY( result3 == L"7.200.000.000,00 EUR " ); oss.str(empty); - iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, ' ', digits1); + iterator_type os_it04 = mon_put.put(oss.rdbuf(), false, oss, L' ', digits1); wstring result4 = oss.str(); - VERIFY( result4 == L"7.200.000.000,00 \x20ac"); + VERIFY( result4 == L"7.200.000.000,00 \x20ac" ); // intl and non-intl versions should be different. VERIFY( result3 != result4 ); diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc index d288dee..06ed50e 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc @@ -1,6 +1,6 @@ // 2001-08-27 Benjamin Kosnik -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -50,7 +50,7 @@ void test04() // 01 wstring res = x; - iter_type ret1 = mp.put(res.begin(), false, oss, ' ', str); + iter_type ret1 = mp.put(res.begin(), false, oss, L' ', str); wstring sanity1(res.begin(), ret1); VERIFY( err == goodbit ); VERIFY( res == L"1943xxxxxxxxxxxxx" ); @@ -58,7 +58,7 @@ void test04() // 02 long double res = x; - iter_type ret2 = mp.put(res.begin(), false, oss, ' ', ld); + iter_type ret2 = mp.put(res.begin(), false, oss, L' ', ld); wstring sanity2(res.begin(), ret2); VERIFY( err == goodbit ); VERIFY( res == L"1943xxxxxxxxxxxxx" ); diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc index 40b4092..bc65998 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc @@ -1,6 +1,6 @@ // 2001-08-27 Benjamin Kosnik -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,8 +26,8 @@ struct My_money_io : public std::moneypunct { - char_type do_decimal_point() const { return '.'; } - char_type do_thousands_sep() const { return ','; } + char_type do_decimal_point() const { return L'.'; } + char_type do_thousands_sep() const { return L','; } std::string do_grouping() const { return "\003"; } std::wstring do_negative_sign() const { return L"()"; } @@ -53,13 +53,13 @@ void test05() bool intl = false; wstring val(L"-123456"); - const money_put& mp = + const money_put& mp = use_facet >(loc); wostringstream fmt; fmt.imbue(loc); OutIt out(fmt); - mp.put(out,intl,fmt,'*',val); + mp.put(out, intl, fmt, L'*', val); VERIFY( fmt.str() == L"*(1,234.56)" ); } diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc index 255aa6e..30dafd3 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc @@ -1,6 +1,6 @@ // 2001-08-27 Benjamin Kosnik -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,7 +26,7 @@ struct My_money_io_2 : public std::moneypunct { - char_type do_thousands_sep() const { return ','; } + char_type do_thousands_sep() const { return L','; } std::string do_grouping() const { return "\001"; } }; @@ -42,13 +42,13 @@ void test06() bool intl = false; long double val = 1.0e50L; - const money_put& mp = + const money_put& mp = use_facet >(loc); wostringstream fmt; fmt.imbue(loc); OutIt out(fmt); - mp.put(out,intl,fmt,'*',val); + mp.put(out, intl, fmt, L'*', val); VERIFY( fmt.good() ); } -- 2.7.4