]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
1.cc: Use proper wchar_t type for the fill argument; minor formatting tweaks.
authorPaolo Carlini <pcarlini@suse.de>
Sat, 21 Aug 2004 11:56:46 +0000 (11:56 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 21 Aug 2004 11:56:46 +0000 (11:56 +0000)
2004-08-21  Paolo Carlini  <pcarlini@suse.de>

* 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.

From-SVN: r86362

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc
libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc

index 44f5ccb1ad653f7d6cf1f38fe3fc9471aed82b19..40ef639b07cd76350e8c479c1f71bc8e39b966d6 100644 (file)
@@ -1,3 +1,14 @@
+2004-08-21  Paolo Carlini  <pcarlini@suse.de>
+
+       * 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  <pcarlini@suse.de>
 
        * include/bits/basic_ios.tcc (basic_ios<>::copyfmt): Don't deal
index 9518d16f37afcf566b2096c824c26caee71e9ddc..76d0cdd556f408b6b365594fb26865c48addcd77 100644 (file)
@@ -49,16 +49,17 @@ void test01()
   // cache the money_put facet
   wostringstream oss;
   oss.imbue(loc_de);
-  const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 
+  const money_put<wchar_t>& mon_put =
+    use_facet<money_put<wchar_t> >(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()
index 1bc93e34898a31c46fd66f5e3ba1ccba95f0e349..9af992a6474977fe5caa285fe66f6c8569257af6 100644 (file)
@@ -1,6 +1,6 @@
 // 2003-11-09 Paolo Carlini <pcarlini@suse.de>
 
-// 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<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 
+  const money_put<wchar_t>& mon_put =
+    use_facet<money_put<wchar_t> >(oss.getloc()); 
 
   iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, L' ', amount);
   wstring result = oss.str();
index 312a50519894480fa2cc8a0a85f29b34bab35fa7..4f6148bcccce27446895fa666631102b7ed71085 100644 (file)
@@ -55,45 +55,48 @@ void test02()
   // cache the money_put facet
   wostringstream oss;
   oss.imbue(loc_hk);
-  const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 
+  const money_put<wchar_t>& mon_put =
+    use_facet<money_put<wchar_t> >(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<wchar_t>& mon_put2 = use_facet<money_put<wchar_t> >(oss.getloc()); 
-  iterator_type os_it07 = mon_put2.put(oss.rdbuf(), true, oss, ' ', digits4);
+  const money_put<wchar_t>& mon_put2 =
+    use_facet<money_put<wchar_t> >(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<wchar_t>& mon_put3 = use_facet<money_put<wchar_t> >(oss.getloc()); 
-  iterator_type os_it08 = mon_put3.put(oss.rdbuf(), true, oss, ' ', digits4);
+  const money_put<wchar_t>& mon_put3 =
+    use_facet<money_put<wchar_t> >(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()
index 7e381d9dc4879074953d80b348a0c19203aa24a5..63f16095cc128ee50821b428431cb3d1842c9be7 100644 (file)
@@ -46,16 +46,17 @@ void test03()
   // cache the money_put facet
   wostringstream oss;
   oss.imbue(loc_de);
-  const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc()); 
+  const money_put<wchar_t>& mon_put =
+    use_facet<money_put<wchar_t> >(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 );
index d288dee60abd149a4e81541e2a9ab6bd3262981c..06ed50e0c80b82122d5081b846a06f9ccc9b48bd 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-08-27 Benjamin Kosnik  <bkoz@redhat.com>
 
-// 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" );
index 40b4092eb5fb149207edcf5517552d68df8c2794..bc65998e0b00e3188410fbac211e27d3f4bb80fe 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-08-27 Benjamin Kosnik  <bkoz@redhat.com>
 
-// 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<wchar_t,false>
 {
-  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<wchar_t,OutIt>& mp  =
+  const money_put<wchar_t, OutIt>& mp  =
     use_facet<money_put<wchar_t, OutIt> >(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)" );
 }
 
index 255aa6e56fc11d0865062c6953a3eab45908bac5..30dafd311629d4523f673b7b2a4a1fdbc0c62993 100644 (file)
@@ -1,6 +1,6 @@
 // 2001-08-27 Benjamin Kosnik  <bkoz@redhat.com>
 
-// 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<wchar_t,false>
 {
-  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<wchar_t,OutIt>& mp  = 
+  const money_put<wchar_t, OutIt>& mp  = 
     use_facet<money_put<wchar_t, OutIt> >(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() );
 }