This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Minor tweaks to the money_put tests


Hi,

tested x86-linux, committed to mainline.

Paolo.

///////////
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.
diff -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/1.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/1.cc	2004-02-21 10:26:35.000000000 +0100
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc	2004-08-21 13:18:46.000000000 +0200
@@ -49,16 +49,17 @@
   // 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 @@
   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 @@
   // 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 -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/12971.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/12971.cc	2003-11-09 11:47:57.000000000 +0100
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc	2004-08-21 13:02:56.000000000 +0200
@@ -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 @@
   
   // 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();
diff -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/2.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/2.cc	2004-02-21 10:26:35.000000000 +0100
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc	2004-08-21 13:04:38.000000000 +0200
@@ -55,45 +55,48 @@
   // 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()
diff -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/3.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/3.cc	2004-02-21 10:26:35.000000000 +0100
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc	2004-08-21 13:05:02.000000000 +0200
@@ -46,16 +46,17 @@
   // 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 @@
   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 -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/4.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/4.cc	2003-09-23 22:02:29.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc	2004-08-21 13:01:51.000000000 +0200
@@ -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 @@
 
   // 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 @@
 
   // 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 -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/5.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/5.cc	2003-09-23 22:02:29.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc	2004-08-21 13:01:05.000000000 +0200
@@ -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 @@
   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)" );
 }
 
diff -urN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/6.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc
--- libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/6.cc	2003-09-23 22:02:29.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc	2004-08-21 13:01:27.000000000 +0200
@@ -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 @@
   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() );
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]