aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/27_io')
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc28
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_iostream/cons/16251.C42
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_iostream/cons/2020.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc10
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc74
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc75
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/fpos/14320-1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc9
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc9
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/9.cc2
24 files changed, 283 insertions, 54 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc
index dde8086999a..1c8d9ea21f1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/4.cc
@@ -1,6 +1,6 @@
// 2006-10-01 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -18,11 +18,12 @@
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
+// { dg-require-fileio "" }
+
#include <fstream>
#include <testsuite_hooks.h>
-// As an extension to Table 92, consistently with the C standards, we also
-// allow in|out|app and in|out|app|binary.
+// DR 596.
void test01()
{
bool test __attribute__((unused)) = true;
@@ -30,17 +31,38 @@ void test01()
std::fstream scratch_file;
+ scratch_file.open(name, std::ios_base::app);
+ VERIFY( scratch_file );
+ VERIFY( scratch_file.is_open() );
+ scratch_file.close();
+
scratch_file.open(name, std::ios_base::in | std::ios_base::out
| std::ios_base::app);
VERIFY( scratch_file );
VERIFY( scratch_file.is_open() );
scratch_file.close();
+ scratch_file.open(name, std::ios_base::in | std::ios_base::app);
+ VERIFY( scratch_file );
+ VERIFY( scratch_file.is_open() );
+ scratch_file.close();
+
+ scratch_file.open(name, std::ios_base::app | std::ios_base::binary);
+ VERIFY( scratch_file );
+ VERIFY( scratch_file.is_open() );
+ scratch_file.close();
+
scratch_file.open(name, std::ios_base::in | std::ios_base::out
| std::ios_base::app | std::ios_base::binary);
VERIFY( scratch_file );
VERIFY( scratch_file.is_open() );
scratch_file.close();
+
+ scratch_file.open(name, std::ios_base::in | std::ios_base::app
+ | std::ios_base::binary);
+ VERIFY( scratch_file );
+ VERIFY( scratch_file.is_open() );
+ scratch_file.close();
}
int
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/cons/16251.C b/libstdc++-v3/testsuite/27_io/basic_iostream/cons/16251.C
new file mode 100644
index 00000000000..0167d1db790
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_iostream/cons/16251.C
@@ -0,0 +1,42 @@
+// Copyright (C) 2008 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 27.6.1.5 - Template class basic_iostream
+
+#include <iostream>
+
+class mystream
+: public std::iostream
+{
+public:
+ mystream () { };
+};
+
+// libstdc++/16251
+void test01()
+{
+ mystream x;
+ x.rdbuf(std::cout.rdbuf());
+ x << std::endl;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_iostream/cons/2020.cc b/libstdc++-v3/testsuite/27_io/basic_iostream/cons/2020.cc
index e0af3ebd3e6..014ab7164a8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_iostream/cons/2020.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_iostream/cons/2020.cc
@@ -1,6 +1,7 @@
// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -19,8 +20,7 @@
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
-// 27.8.1.1 - Template class basic_filebuf
-// NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
+// 27.6.1.5 - Template class basic_iostream
#include <iostream>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc
index 7a979be7d38..a5164dc94c9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc
@@ -1,6 +1,7 @@
// 2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+// 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
@@ -50,10 +51,11 @@ void test03()
bool test __attribute__((unused)) = true;
// input streams
- pod_ushort arr[6] = { value_type('a'), value_type('b'),
- value_type('c'), value_type('d'), value_type('e') };
+ pod_ushort arr[6] = { { value_type('a') }, { value_type('b') },
+ { value_type('c') }, { value_type('d') },
+ { value_type('e') } };
- try
+ try
{
iss >> arr;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc b/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc
index d4dd4f117d7..4f3c1b15758 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2004 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007 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
@@ -30,7 +30,7 @@ void test01()
wistringstream stream;
VERIFY( stream.rdstate() == ios_base::goodbit );
wistringstream::int_type c = stream.peek();
- VERIFY( c == istringstream::traits_type::eof() );
+ VERIFY( c == wistringstream::traits_type::eof() );
VERIFY( stream.rdstate() == ios_base::eofbit );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc
index f79fb064ccc..9c68320bf17 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc
@@ -1,6 +1,6 @@
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2006 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
@@ -38,7 +38,7 @@ void test01()
oss_01 << 'a';
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == string::size_type(width) );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc
index cc02979cb5e..3ef1f8c4362 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc
@@ -1,6 +1,6 @@
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 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
@@ -39,7 +39,7 @@ void test01()
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == string::size_type(width) );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc
index 736c8a8ae94..6213ad1f4be 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-2.cc
@@ -1,6 +1,6 @@
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 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
@@ -39,7 +39,7 @@ void test01()
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc
index ae13c5267e3..dc5ffe5dff2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc
@@ -1,6 +1,6 @@
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 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
@@ -38,7 +38,7 @@ void test01()
oss_01 << L'a';
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc
index 1a13e04fc40..e80242cf0a7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc
@@ -1,6 +1,6 @@
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 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
@@ -39,7 +39,7 @@ void test01()
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc
new file mode 100644
index 00000000000..71c93e8d1b9
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc
@@ -0,0 +1,74 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <ostream>
+#include <sstream>
+#include <system_error>
+#include <algorithm>
+#include <testsuite_hooks.h>
+
+// Effects: os << ec.category().name() << ':' << ec.value();
+void test()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ char buf[64];
+ error_code e1;
+ error_code e2(posix_error::bad_address);
+ string s, s1, s2;
+
+ {
+ ostringstream ostr;
+ ostr << e1 << endl;
+ s1 = ostr.str();
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+ }
+ VERIFY( test );
+ VERIFY( find(s1.begin(), s1.end(), ':') != s1.end() );
+
+ sprintf(buf, "%i", e1.value());
+ s = buf;
+ VERIFY( s1.find(s) != string::npos);
+
+ {
+ ostringstream ostr;
+ ostr << e2 << endl;
+ s2 = ostr.str();
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+ }
+ VERIFY( test );
+ VERIFY( find(s2.begin(), s2.end(), ':') != s2.end() );
+
+ sprintf(buf, "%i", e2.value());
+ s = buf;
+ VERIFY( s2.find(s) != string::npos);
+}
+
+int
+main()
+{
+ test();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc
new file mode 100644
index 00000000000..73c838b4399
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_code.cc
@@ -0,0 +1,75 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <ostream>
+#include <sstream>
+#include <system_error>
+#include <algorithm>
+#include <wchar.h>
+#include <testsuite_hooks.h>
+
+// Effects: os << ec.category().name() << ':' << ec.value();
+void test()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ wchar_t buf[64];
+ error_code e1;
+ error_code e2(posix_error::bad_address);
+ wstring s, s1, s2;
+
+ {
+ wostringstream ostr;
+ ostr << e1 << endl;
+ s1 = ostr.str();
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+ }
+ VERIFY( test );
+ VERIFY( find(s1.begin(), s1.end(), L':') != s1.end() );
+
+ swprintf(buf, 64, L"%i", e1.value());
+ s = buf;
+ VERIFY( s1.find(s) != string::npos);
+
+ {
+ wostringstream ostr;
+ ostr << e2 << endl;
+ s2 = ostr.str();
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+ }
+ VERIFY( test );
+ VERIFY( find(s2.begin(), s2.end(), L':') != s2.end() );
+
+ swprintf(buf, 64, L"%i", e2.value());
+ s = buf;
+ VERIFY( s2.find(s) != string::npos);
+}
+
+int
+main()
+{
+ test();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
index ca3f919a823..83989ff400f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
@@ -106,11 +106,11 @@ void test01()
buf01.pub_setg(lit01, lit01, (lit01 + i01));
VERIFY( i01 == buf01.in_avail() );
- VERIFY( buf01.pub_uflow() == lit01[0] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[0]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
- VERIFY( buf01.pub_uflow() == lit01[1] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[1]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
- VERIFY( buf01.pub_uflow() == lit01[2] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[2]) );
VERIFY( buf01.sgetc() == traits_type::eof() );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc
index ecd9b4c5f04..009af5d24b8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc
@@ -106,11 +106,11 @@ void test01()
buf01.pub_setg(lit01, lit01, (lit01 + i01));
VERIFY( i01 == buf01.in_avail() );
- VERIFY( buf01.pub_uflow() == lit01[0] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[0]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
- VERIFY( buf01.pub_uflow() == lit01[1] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[1]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
- VERIFY( buf01.pub_uflow() == lit01[2] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[2]) );
VERIFY( buf01.sgetc() == traits_type::eof() );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc
index 9fc9a62cfd4..60ae6812fae 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc
@@ -1,6 +1,7 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -47,8 +48,8 @@ void test04()
int_type c1 = strb_01.sbumpc();
int_type c2 = strb_02.sbumpc();
VERIFY( c1 != c2 );
- VERIFY( c1 == str_01[0] );
- VERIFY( c2 == str_02[0] ); //should equal first letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[0]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[0]) ); //should equal first letter at this point
int_type c3 = strb_01.sbumpc();
int_type c4 = strb_02.sbumpc();
VERIFY( c1 != c2 );
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc
index fa9dda8a8d8..5d583089883 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc
@@ -47,8 +47,8 @@ void test04()
int_type c1 = strb_01.sbumpc();
int_type c2 = strb_02.sbumpc();
VERIFY( c1 != c2 );
- VERIFY( c1 == str_01[0] );
- VERIFY( c2 == str_02[0] ); //should equal first letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[0]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[0]) ); //should equal first letter at this point
int_type c3 = strb_01.sbumpc();
int_type c4 = strb_02.sbumpc();
VERIFY( c1 != c2 );
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc
index 4a2b54821cc..6b6ad590440 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc
@@ -1,6 +1,7 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -83,8 +84,8 @@ void test04()
c2 = strb_02.sgetc();
VERIFY( c6 == c1 ); //just by co-incidence both o's
VERIFY( c7 != c2 ); // n != i
- VERIFY( c1 == str_01[13] );
- VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[13]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[13]) ); //should equal fourteenth letter at this point
strmsz_1 = strb_03.sgetn(carray1, 10);
VERIFY( !strmsz_1 ); //zero
strmsz_1 = strb_02.in_avail();
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc
index b7fda2f15c0..f77cb97c376 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == wchar_t
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -83,8 +84,8 @@ void test04()
c2 = strb_02.sgetc();
VERIFY( c6 == c1 ); //just by co-incidence both o's
VERIFY( c7 != c2 ); // n != i
- VERIFY( c1 == str_01[13] );
- VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[13]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[13]) ); //should equal fourteenth letter at this point
strmsz_1 = strb_03.sgetn(carray1, 10);
VERIFY( !strmsz_1 ); //zero
strmsz_1 = strb_02.in_avail();
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc
index ddaa51e5bde..1383f83fb0d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc
@@ -1,6 +1,7 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -62,8 +63,8 @@ void test04()
c7 = strb_02.snextc();
VERIFY( c6 != c8 );
VERIFY( c7 != c9 );
- VERIFY( c6 == str_01[3] );
- VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
+ VERIFY( c6 == traits_type::to_int_type(str_01[3]) );
+ VERIFY( c7 == traits_type::to_int_type(str_02[3]) ); //should equal fourth letter at this point
c5 = strb_03.snextc();
VERIFY( c5 == traits_type::eof() );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc
index 3cfaab2362d..955390b8030 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc
@@ -1,6 +1,7 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == wchar_t
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -62,8 +63,8 @@ void test04()
c7 = strb_02.snextc();
VERIFY( c6 != c8 );
VERIFY( c7 != c9 );
- VERIFY( c6 == str_01[3] );
- VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
+ VERIFY( c6 == traits_type::to_int_type(str_01[3]) );
+ VERIFY( c7 == traits_type::to_int_type(str_02[3]) ); //should equal fourth letter at this point
c5 = strb_03.snextc();
VERIFY( c5 == traits_type::eof() );
}
diff --git a/libstdc++-v3/testsuite/27_io/fpos/14320-1.cc b/libstdc++-v3/testsuite/27_io/fpos/14320-1.cc
index 85e1d432eb3..1e492d06d03 100644
--- a/libstdc++-v3/testsuite/27_io/fpos/14320-1.cc
+++ b/libstdc++-v3/testsuite/27_io/fpos/14320-1.cc
@@ -20,7 +20,7 @@
// 27.4.3 fpos
-// { dg-do run { xfail *-*-* } }
+// { dg-do run }
#include <typeinfo>
#include <limits>
@@ -36,6 +36,11 @@ void test01()
typedef istreambuf_iterator<char>::difference_type Distance;
bool found = false;
+ // The C++ standard didn't originally have "long long", however that
+ // type will be in the C++0x standard and testing for it allows
+ // ilp32 targets to pass this test when `Distance' is 64 bits.
+ if (typeid(Distance) == typeid(long long int))
+ found = true;
if (typeid(Distance) == typeid(long int))
found = true;
if (typeid(Distance) == typeid(int))
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
index ec27d187e7b..5325523a0cc 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
@@ -1,6 +1,7 @@
// { dg-do compile }
-// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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
@@ -40,7 +41,7 @@ void test01()
test_base io2;
io1 = io2;
}
-// { dg-error "synthesized" "" { target *-*-* } 41 }
-// { dg-error "within this context" "" { target *-*-* } 34 }
-// { dg-error "is private" "" { target *-*-* } 790 }
+// { dg-error "synthesized" "" { target *-*-* } 42 }
+// { dg-error "within this context" "" { target *-*-* } 35 }
+// { dg-error "is private" "" { target *-*-* } 786 }
// { dg-error "operator=" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
index 0c6bb296d38..536682eb6f3 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
@@ -1,6 +1,7 @@
// { dg-do compile }
-// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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
@@ -40,7 +41,7 @@ void test02()
test_base io1;
test_base io2 = io1;
}
-// { dg-error "within this context" "" { target *-*-* } 35 }
-// { dg-error "synthesized" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 787 }
+// { dg-error "within this context" "" { target *-*-* } 36 }
+// { dg-error "synthesized" "" { target *-*-* } 42 }
+// { dg-error "is private" "" { target *-*-* } 783 }
// { dg-error "copy constructor" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/9.cc b/libstdc++-v3/testsuite/27_io/objects/char/9.cc
index 6ad7c47278e..4da987b94f8 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/9.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/9.cc
@@ -17,6 +17,8 @@
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
+
+// { dg-require-fileio "" }
#include <iostream>
#include <cstdio>