summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2004-02-21 09:26:35 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2004-02-21 09:26:35 +0000
commitfe932e504bb0efaaa874d1caffdc25e4d34c5484 (patch)
tree658b1a60aa9e4e6e7272da508ab2dff3e4f6d74b /libstdc++-v3/testsuite
parent8bb418a3d5c47572c382c7b8f195526247c02a1f (diff)
downloadgcc-fe932e504bb0efaaa874d1caffdc25e4d34c5484.tar.gz
locale_facets.h (class money_base): Add { _S_minus, _S_zero, _S_end } enum, _S_atoms.
2004-02-21 Paolo Carlini <pcarlini@suse.de> * include/bits/locale_facets.h (class money_base): Add { _S_minus, _S_zero, _S_end } enum, _S_atoms. (struct __moneypunct_cache<>): Parameterize on _Intl too; add _M_grouping_size, _M_curr_symbol_size, _M_positive_sign_size, _M_negative_sign_size, _M_atoms; tweak constructor consistently. (__moneypunct_cache<>::~__moneypunct_cache): Update. (__moneypunct_cache<>::_M_cache): Fill the cache. (class moneypunct): Tweak __cache_type typedef. (class money_put): Inherit from money_base too; tweak declaration of _M_insert, now parameterized on _Intl. * include/bits/locale_facets.tcc (struct __use_cache<__moneypunct_cache<_CharT, _Intl> >): New. (money_put<>::_M_insert): Update definition to use the cache; call reserve on __res to avoid multiple reallocations. (money_put<>::do_put(long double), money_put<>::do_put(const string_type&): Update calls of _M_insert. * config/locale/generic/monetary_members.cc (moneypunct<char, true>::_M_initialize_moneypunct, moneypunct<char, false>::_M_initialize_moneypunct, moneypunct<wchar_t, true>::_M_initialize_moneypunct, moneypunct<wchar_t, false>::_M_initialize_moneypunct): Update. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/monetary_members.cc (moneypunct<wchar_t, true>::~moneypunct(), moneypunct<wchar_t, false>::~moneypunct()): Likewise. * src/globals_locale.cc: Tweak fake_money_cache_c. * src/locale-inst.cc: Add instantiations for money_put::_M_insert<false> and money_put::_M_insert<true> and __moneypunct_cache<C, false>, __moneypunct_cache<C, true>. * src/locale_facets.cc: Define money_base::_S_atoms. * src/locale_init.cc: Update placement new of __moneypunct_cache<char, false>, __moneypunct_cache<char, true>, __moneypunct_cache<wchar_t, false>, __moneypunct_cache<wchar_T, true>. * config/locale/generic/numeric_members.cc: Clean up. * config/locale/gnu/numeric_members.cc: Likewise. * testsuite/22_locale/money_put/put/char/1.cc: Likewise. * testsuite/22_locale/money_put/put/char/2.cc: Likewise. * testsuite/22_locale/money_put/put/char/3.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/1.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/2.cc: Likewise. * testsuite/22_locale/money_put/put/wchar_t/3.cc: Likewise. From-SVN: r78216
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc15
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc13
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc15
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc13
6 files changed, 8 insertions, 64 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
index bba61451989..85998856cd5 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
@@ -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
@@ -28,8 +28,6 @@
void test01()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
@@ -39,10 +37,6 @@ void test01()
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- // cache the moneypunct facets
- typedef moneypunct<char, true> __money_true;
- typedef moneypunct<char, false> __money_false;
-
// sanity check the data is correct.
const string empty;
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
index 35882b64d5d..2833afbcaa3 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
@@ -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
@@ -28,8 +28,6 @@
void test02()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
@@ -37,16 +35,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 );
-
- // cache the moneypunct facets
- typedef moneypunct<char, true> __money_true;
- typedef moneypunct<char, false> __money_false;
+ VERIFY( loc_c != loc_hk );
// sanity check the data is correct.
const string empty;
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
index 1a1ca33d7a9..f4e70ec8d69 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
@@ -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
@@ -28,25 +28,14 @@
void test03()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
// 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;
- typedef moneypunct<char, false> __money_false;
// sanity check the data is correct.
const string empty;
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 a025d372edc..9518d16f37a 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
@@ -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
@@ -28,8 +28,6 @@
void test01()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
@@ -39,10 +37,6 @@ void test01()
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- // cache the moneypunct facets
- typedef moneypunct<wchar_t, true> __money_true;
- typedef moneypunct<wchar_t, false> __money_false;
-
// sanity check the data is correct.
const wstring empty;
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 f0e7ea1aabe..312a5051989 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
@@ -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
@@ -28,8 +28,6 @@
void test02()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
@@ -37,16 +35,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 );
-
- // cache the moneypunct facets
- typedef moneypunct<wchar_t, true> __money_true;
- typedef moneypunct<wchar_t, false> __money_false;
+ VERIFY( loc_c != loc_hk );
// sanity check the data is correct.
const wstring empty;
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 cd79e54d66d..7e381d9dc48 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
@@ -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
@@ -28,25 +28,14 @@
void test03()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
// 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;
- typedef moneypunct<wchar_t, false> __money_false;
// sanity check the data is correct.
const wstring empty;