aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2004-02-05 20:13:37 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2004-02-05 20:13:37 +0000
commitd9010fcacc75ccda1ad4966a870f7d67e120213a (patch)
tree80aa5e808ef9ea36526c2dd84d59c9b412e3a0c6
parent6327d36ac618a3d579e21934cff1745b22458b7f (diff)
downloadgcc-d9010fcacc75ccda1ad4966a870f7d67e120213a.zip
gcc-d9010fcacc75ccda1ad4966a870f7d67e120213a.tar.gz
gcc-d9010fcacc75ccda1ad4966a870f7d67e120213a.tar.bz2
locale_facets.tcc (money_get::do_get(string_type&)): Thousands-sep are always optional...
2004-02-05 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.tcc (money_get::do_get(string_type&)): Thousands-sep are always optional; thousands-sep are not allowed after the decimal_point. * testsuite/22_locale/money_get/get/char/12.cc: New. * testsuite/22_locale/money_get/get/char/13.cc: New. * testsuite/22_locale/money_get/get/wchar_t/12.cc: New. * testsuite/22_locale/money_get/get/wchar_t/13.cc: New. * testsuite/22_locale/money_get/get/char/1.cc: Clean-up. * testsuite/22_locale/money_get/get/char/2.cc: Likewise. * testsuite/22_locale/money_get/get/char/3.cc: Likewise. * testsuite/22_locale/money_get/get/char/4.cc: Likewise. * testsuite/22_locale/money_get/get/wchar_t/1.cc: Likewise. * testsuite/22_locale/money_get/get/wchar_t/2.cc: Likewise. * testsuite/22_locale/money_get/get/wchar_t/3.cc: Likewise. * testsuite/22_locale/money_get/get/wchar_t/4.cc: Likewise. * testsuite/22_locale/money_get/get/char/9.cc: Fix citation from the standard. * testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise. From-SVN: r77339
-rw-r--r--libstdc++-v3/ChangeLog23
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc12
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/12.cc70
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/13.cc67
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc9
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc7
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc9
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc7
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/12.cc70
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/13.cc67
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc9
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc7
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc9
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc4
16 files changed, 323 insertions, 58 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6d5ecf1..baa2734 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,26 @@
+2004-02-05 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (money_get::do_get(string_type&)):
+ Thousands-sep are always optional; thousands-sep are not allowed
+ after the decimal_point.
+ * testsuite/22_locale/money_get/get/char/12.cc: New.
+ * testsuite/22_locale/money_get/get/char/13.cc: New.
+ * testsuite/22_locale/money_get/get/wchar_t/12.cc: New.
+ * testsuite/22_locale/money_get/get/wchar_t/13.cc: New.
+
+ * testsuite/22_locale/money_get/get/char/1.cc: Clean-up.
+ * testsuite/22_locale/money_get/get/char/2.cc: Likewise.
+ * testsuite/22_locale/money_get/get/char/3.cc: Likewise.
+ * testsuite/22_locale/money_get/get/char/4.cc: Likewise.
+ * testsuite/22_locale/money_get/get/wchar_t/1.cc: Likewise.
+ * testsuite/22_locale/money_get/get/wchar_t/2.cc: Likewise.
+ * testsuite/22_locale/money_get/get/wchar_t/3.cc: Likewise.
+ * testsuite/22_locale/money_get/get/wchar_t/4.cc: Likewise.
+
+ * testsuite/22_locale/money_get/get/char/9.cc: Fix citation from
+ the standard.
+ * testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise.
+
2004-02-05 Richard Sandiford <rsandifo@redhat.com>
* config/os/irix/irix6.5/os_defines.h (_GLIBCXX_FIONREAD_TAKES_OFF_T):
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index c059889..2a3a987 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -1253,11 +1253,15 @@ namespace std
}
else if (__c == __d && !__testdecfound)
{
- __grouping_tmp += static_cast<char>(__sep_pos);
+ // If no grouping chars are seen, no grouping check
+ // is applied. Therefore __grouping_tmp is adjusted
+ // only if decimal_point comes after some thousands_sep.
+ if (__grouping_tmp.size())
+ __grouping_tmp += static_cast<char>(__sep_pos);
__sep_pos = 0;
__testdecfound = true;
}
- else if (__c == __sep)
+ else if (__c == __sep && !__testdecfound)
{
if (__grouping.size())
{
@@ -1319,6 +1323,10 @@ namespace std
// Test for grouping fidelity.
if (__grouping.size() && __grouping_tmp.size())
{
+ // Add the ending grouping if a decimal wasn't found.
+ if (!__testdecfound)
+ __grouping_tmp += static_cast<char>(__sep_pos);
+
if (!std::__verify_grouping(__grouping.data(),
__grouping.size(),
__grouping_tmp))
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
index fd2c1e5..b63d384 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -36,13 +36,8 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/12.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/12.cc
new file mode 100644
index 0000000..2b4f32a
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/12.cc
@@ -0,0 +1,70 @@
+// 2004-02-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 22.2.6.1.1 money_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// Same as 3.cc but no thousands-sep in input: they are always optional.
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<char> iterator_type;
+
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
+ VERIFY( loc_c != loc_de );
+
+ // total EPA budget FY 2002
+ const long double digits1 = 720000000000.0;
+
+ iterator_type end;
+ istringstream iss;
+ iss.imbue(loc_de);
+ // cache the money_get facet
+ const money_get<char>& mon_get = use_facet<money_get<char> >(iss.getloc());
+
+ iss.str("7200000000,00 ");
+ iterator_type is_it01(iss);
+ long double result1;
+ ios_base::iostate err01 = ios_base::goodbit;
+ mon_get.get(is_it01, end, true, iss, err01, result1);
+ VERIFY( result1 == digits1 );
+ VERIFY( err01 == ios_base::eofbit );
+
+ iss.str("7200000000,00 ");
+ iterator_type is_it02(iss);
+ long double result2;
+ ios_base::iostate err02 = ios_base::goodbit;
+ mon_get.get(is_it02, end, false, iss, err02, result2);
+ VERIFY( result2 == digits1 );
+ VERIFY( err02 == ios_base::eofbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/13.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/13.cc
new file mode 100644
index 0000000..d7040ba
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/13.cc
@@ -0,0 +1,67 @@
+// 2004-02-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 22.2.6.1.1 money_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// No thousands-sep allowed after the decimal-point.
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<char> iterator_type;
+
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
+ VERIFY( loc_c != loc_de );
+
+ iterator_type end01, end02;
+ istringstream iss;
+ iss.imbue(loc_de);
+ // cache the money_get facet
+ const money_get<char>& mon_get = use_facet<money_get<char> >(iss.getloc());
+
+ iss.str("500,1.0 ");
+ iterator_type is_it01(iss);
+ long double result1;
+ ios_base::iostate err01 = ios_base::goodbit;
+ end01 = mon_get.get(is_it01, end01, true, iss, err01, result1);
+ VERIFY( err01 == ios_base::failbit );
+ VERIFY( *end01 == '.' );
+
+ iss.str("500,1.0 ");
+ iterator_type is_it02(iss);
+ long double result2;
+ ios_base::iostate err02 = ios_base::goodbit;
+ end02 = mon_get.get(is_it02, end02, false, iss, err02, result2);
+ VERIFY( err02 == ios_base::failbit );
+ VERIFY( *end02 == '.' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
index 422a533..0d516a2 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -37,12 +37,7 @@ void test02()
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
- VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
+ VERIFY( loc_c != loc_hk );
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
index 5904ee1..a717bd9a 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -36,13 +36,8 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
index a80060a..7c009c8 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -37,12 +37,7 @@ void test04()
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
- VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
+ VERIFY( loc_c != loc_hk );
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc
index cb56e1a..a7b4aee 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc
@@ -1,6 +1,6 @@
// 2003-05-27 Brendan Kehoe <brendan@zen.org>
-// 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
@@ -18,7 +18,7 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// $22.2.6.3.3/8
+// $22.2.6.3/3
// The number of digits required after the decimal point (if any) is exactly
// the value returned by frac_digits().
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
index a895072..8a93e66 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -36,13 +36,8 @@ void test01()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/12.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/12.cc
new file mode 100644
index 0000000..95ecbef
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/12.cc
@@ -0,0 +1,70 @@
+// 2004-02-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 22.2.6.1.1 money_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// Same as 3.cc but no thousands-sep in input: they are always optional.
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
+ VERIFY( loc_c != loc_de );
+
+ // total EPA budget FY 2002
+ const long double digits1 = 720000000000.0;
+
+ iterator_type end;
+ wistringstream iss;
+ iss.imbue(loc_de);
+ // cache the money_get facet
+ const money_get<wchar_t>& mon_get = use_facet<money_get<wchar_t> >(iss.getloc());
+
+ iss.str(L"7200000000,00 ");
+ iterator_type is_it01(iss);
+ long double result1;
+ ios_base::iostate err01 = ios_base::goodbit;
+ mon_get.get(is_it01, end, true, iss, err01, result1);
+ VERIFY( result1 == digits1 );
+ VERIFY( err01 == ios_base::eofbit );
+
+ iss.str(L"7200000000,00 ");
+ iterator_type is_it02(iss);
+ long double result2;
+ ios_base::iostate err02 = ios_base::goodbit;
+ mon_get.get(is_it02, end, false, iss, err02, result2);
+ VERIFY( result2 == digits1 );
+ VERIFY( err02 == ios_base::eofbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/13.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/13.cc
new file mode 100644
index 0000000..564d5fd
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/13.cc
@@ -0,0 +1,67 @@
+// 2004-02-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 22.2.6.1.1 money_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// No thousands-sep allowed after the decimal-point.
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
+ VERIFY( loc_c != loc_de );
+
+ iterator_type end01, end02;
+ wistringstream iss;
+ iss.imbue(loc_de);
+ // cache the money_get facet
+ const money_get<wchar_t>& mon_get = use_facet<money_get<wchar_t> >(iss.getloc());
+
+ iss.str(L"500,1.0 ");
+ iterator_type is_it01(iss);
+ long double result1;
+ ios_base::iostate err01 = ios_base::goodbit;
+ end01 = mon_get.get(is_it01, end01, true, iss, err01, result1);
+ VERIFY( err01 == ios_base::failbit );
+ VERIFY( *end01 == '.' );
+
+ iss.str(L"500,1.0 ");
+ iterator_type is_it02(iss);
+ long double result2;
+ ios_base::iostate err02 = ios_base::goodbit;
+ end02 = mon_get.get(is_it02, end02, false, iss, err02, result2);
+ VERIFY( err02 == ios_base::failbit );
+ VERIFY( *end02 == '.' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
index f59cef7..efdec28 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -37,12 +37,7 @@ void test02()
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
- VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
+ VERIFY( loc_c != loc_hk );
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
index d0c8b06..90c45e8 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -36,13 +36,8 @@ void test03()
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
index 8861ce4..cea15f5 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
@@ -1,6 +1,6 @@
// 2001-09-12 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
@@ -37,12 +37,7 @@ void test04()
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
- locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
- VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
+ VERIFY( loc_c != loc_hk );
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc
index 989066b..ce8ab37 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc
@@ -1,6 +1,6 @@
// 2003-05-27 Brendan Kehoe <brendan@zen.org>
-// 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
@@ -18,7 +18,7 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// $22.2.6.3.3/8
+// $22.2.6.3/3
// The number of digits required after the decimal point (if any) is exactly
// the value returned by frac_digits().