aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2002-02-20 21:06:42 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2002-02-20 21:06:42 +0000
commit04fc13943f17cca7158731e464da904577ff6163 (patch)
tree3efc2c1f6522ce939327daf4218495ed1ad6ad03 /libstdc++-v3
parent9fe2cc05565353eb61325cf3a87f8fc78335d98c (diff)
downloadgcc-04fc13943f17cca7158731e464da904577ff6163.zip
gcc-04fc13943f17cca7158731e464da904577ff6163.tar.gz
gcc-04fc13943f17cca7158731e464da904577ff6163.tar.bz2
money_put_members_char.cc: Fix.
2002-02-20 Benjamin Kosnik <bkoz@redhat.com> * testsuite/22_locale/money_put_members_char.cc: Fix. * testsuite/22_locale/money_put_members_wchar_t.cc: Fix. * testsuite/27_io/standard_manipulators.cc: New file. * testsuite/27_io/ios_manip_basefield.cc: Check results, now failing. * testsuite/27_io/ios_manip_fmtflags.cc: Use locale::classic(). From-SVN: r49910
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog10
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put_members_char.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/standard_manipulators.cc84
6 files changed, 134 insertions, 35 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c024609..2e92e2d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,13 @@
+2002-02-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/22_locale/money_put_members_char.cc: Fix.
+ * testsuite/22_locale/money_put_members_wchar_t.cc: Fix.
+
+ * testsuite/27_io/standard_manipulators.cc: New file.
+
+ * testsuite/27_io/ios_manip_basefield.cc: Check results, now failing.
+ * testsuite/27_io/ios_manip_fmtflags.cc: Use locale::classic().
+
2002-02-20 Danny Smith <dannysmith@users.sourceforge.net>
* config/os/mingw32/bits/ctype_noninline.h
diff --git a/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc b/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc
index 72915db..c894b18 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc
@@ -315,7 +315,7 @@ struct My_money_io : public std::moneypunct<char,false>
pattern do_neg_format() const
{
- static pattern pat = { { symbol, space, sign, value } };
+ pattern pat = { { symbol, space, sign, value } };
return pat;
}
};
diff --git a/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc b/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc
index 0688a65..09feadd 100644
--- a/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc
@@ -315,7 +315,7 @@ struct My_money_io : public std::moneypunct<wchar_t,false>
pattern do_neg_format() const
{
- static pattern pat = { { symbol, space, sign, value } };
+ pattern pat = { { symbol, space, sign, value } };
return pat;
}
};
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
index 013a015..e84d2e6 100644
--- a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
@@ -1,6 +1,6 @@
// 981027 ncm work with libstdc++v3
-// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
//
// 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
@@ -27,7 +27,6 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#include <iostream>
#include <sstream>
#include <locale>
#include <iomanip>
@@ -45,31 +44,36 @@ char MyNP::do_thousands_sep() const { return ' '; }
int
test01()
{
- std::cout.imbue(std::locale(std::locale(), new MyNP));
- std::cout << std::oct << std::showbase;
- std::cout << -0123456l << std::endl;
-
- std::cout << ":" << std::setw(11);
- std::cout << -01234567l << ":" << std::endl;
-
- std::cout << ":" << std::setw(11) << std::left;
- std::cout << -0123456l << ":" << std::endl;
-
- std::cout << ":" << std::setw(11) << std::right;
- std::cout << -012345l << ":" << std::endl;
-
- std::cout << ":" << std::setw(11) << std::internal;
- std::cout << -01234l << ":" << std::endl;
-
- std::cout << std::hex;
- std::cout << std::setfill('0');
- std::cout << std::internal;
- std::cout << std::showbase;
- std::cout << std::setw(16);
- std::cout << 0x12345678l << std::endl;
-#ifdef DEBUG_ASSERT
- assert (std::cout.good());
-#endif
+ bool test = true;
+ const char lit[] = "-0 123 456\n:-01 234 567:\n:-0 123 456 :"
+ "\n: -012 345:\n:- 01 234:\n0x000012 345 678";
+ std::ostringstream oss;
+ oss.imbue(std::locale(std::locale(), new MyNP));
+ oss << std::oct << std::showbase;
+ oss << -0123456l << std::endl;
+
+ oss << ":" << std::setw(11);
+ oss << -01234567l << ":" << std::endl;
+
+ oss << ":" << std::setw(11) << std::left;
+ oss << -0123456l << ":" << std::endl;
+
+ oss << ":" << std::setw(11) << std::right;
+ oss << -012345l << ":" << std::endl;
+
+ oss << ":" << std::setw(11) << std::internal;
+ oss << -01234l << ":" << std::endl;
+
+ oss << std::hex;
+ oss << std::setfill('0');
+ oss << std::internal;
+ oss << std::showbase;
+ oss << std::setw(16);
+ oss << 0x12345678l << std::endl;
+
+ VERIFY( oss.good() );
+ VERIFY( oss.str() == lit );
+
return 0;
}
@@ -94,14 +98,13 @@ test02()
VERIFY( strbuf.str() == "cisco " );
strbuf.str(str_blank);
-#ifdef DEBUG_ASSERT
- assert (test);
-#endif
+ VERIFY( test );
return 0;
}
int
-main() {
+main()
+{
test01();
test02();
return 0;
@@ -116,3 +119,4 @@ main() {
:- 01 234:
0x000012 345 678
*/
+
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
index 3af4d11..64b1b85 100644
--- a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
@@ -1,6 +1,7 @@
// 981027 ncm work with libstdc++v3
-// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Free Software Foundation, Inc.
//
// 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
@@ -69,7 +70,7 @@ test01()
oss << ":" << std::setw(3) << std::left << true << ":" << std::endl;
oss << ":" << std::setw(3) << std::right << false << ":" << std::endl;
- std::locale loc = std::locale (std::locale(), new MyNP);
+ std::locale loc = std::locale (std::locale::classic(), new MyNP);
oss.imbue(loc);
oss << std::boolalpha;
diff --git a/libstdc++-v3/testsuite/27_io/standard_manipulators.cc b/libstdc++-v3/testsuite/27_io/standard_manipulators.cc
new file mode 100644
index 0000000..7182237
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/standard_manipulators.cc
@@ -0,0 +1,84 @@
+// Copyright (C) 2002 Free Software Foundation, Inc.
+//
+// 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.
+
+// 27.6.3 - Standard manipulators
+
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ using namespace std;
+ bool test = true;
+
+ string s("john coltrane, a love supreme");
+ istringstream iss(s);
+ ostringstream oss;
+
+ // resetiosflags
+ resetiosflags(ios_base::boolalpha);
+ iss >> resetiosflags(ios_base::boolalpha);
+ VERIFY(iss.good());
+ oss << resetiosflags(ios_base::boolalpha);
+ VERIFY(oss.good());
+
+ // setiosflags
+ setiosflags(ios_base::skipws);
+ iss >> setiosflags(ios_base::skipws);
+ VERIFY(iss.good());
+ oss << setiosflags(ios_base::skipws);
+ VERIFY(oss.good());
+
+ // setbase
+ setbase(8);
+ iss >> setbase(8);
+ VERIFY(iss.good());
+ oss << setbase(8);
+ VERIFY(oss.good());
+
+ // setfil
+ setfill('a');
+ iss >> setfill('a');
+ VERIFY(iss.good());
+ oss << setfill('a');
+ VERIFY(oss.good());
+
+ // setprecision
+ setprecision(4);
+ iss >> setprecision(4);
+ VERIFY(iss.good());
+ oss << setprecision(4);
+ VERIFY(oss.good());
+
+ // setprecision
+ setw(7);
+ iss >> setw(7);
+ VERIFY(iss.good());
+ oss << setw(7);
+ VERIFY(oss.good());
+}
+
+
+int
+main()
+{
+ test01();
+ return 0;
+}