aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Williams <anthony@anthonyw.cjb.net>2000-06-13 23:48:29 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2000-06-13 23:48:29 +0000
commit97e0a05a9d0998859386522f8d710d1e2d17b35f (patch)
tree6fb8a991fb2006ef1ee09e836a2001d588afecd4
parent8173b2d78a179d12405438b4c9135cb20e8af68c (diff)
downloadgcc-97e0a05a9d0998859386522f8d710d1e2d17b35f.zip
gcc-97e0a05a9d0998859386522f8d710d1e2d17b35f.tar.gz
gcc-97e0a05a9d0998859386522f8d710d1e2d17b35f.tar.bz2
bitset_ctor.cc: Qualify reverse wth std::.
2000-06-13 Anthony Williams <anthony@anthonyw.cjb.net> * testsuite/23_containers/bitset_ctor.cc: Qualify reverse wth std::. * testsuite/27_io/filebuf.cc: Changed calls to fpos<>._M_position() to implicit calls to operator streamoff(). * testsuite/27_io/iostream_objects.cc: Removed #include <ciso646>, as not needed. Revert, as part of standard. * testsuite/27_io/ostream_inserter_arith.cc: Replaced explicit call to numpunct<>._M_init() with overrides of the appropriate virtual functions. * testsuite/27_io/stringstream.cc: Removed unnecessary char * pointers from test01, so no need to call base(), which isn't guaranteed to be implemented as iterators may themselves be pointers * testsuite/27_io/stringbuf.cc: Removed unnecessary calls to _M_position() - use implicit conversion to streamoff instead From-SVN: r34535
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_ctor.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/filebuf.cc12
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc20
-rw-r--r--libstdc++-v3/testsuite/27_io/stringbuf.cc18
-rw-r--r--libstdc++-v3/testsuite/27_io/stringstream.cc12
5 files changed, 36 insertions, 30 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
index 922d470..d044777 100644
--- a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
+++ b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
@@ -1,6 +1,6 @@
// 1999-06-08 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000 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
@@ -65,7 +65,7 @@ bool test01(void)
std::string str03;
for (int i = 0; i < sz; ++i)
str03 += (bit03.test(i) ? '1' : '0');
- reverse(str03.begin(), str03.end());
+ std::reverse(str03.begin(), str03.end());
test &= str03 == str02;
}
catch(std::invalid_argument& fail) {
diff --git a/libstdc++-v3/testsuite/27_io/filebuf.cc b/libstdc++-v3/testsuite/27_io/filebuf.cc
index 40e6cc6..a04215e 100644
--- a/libstdc++-v3/testsuite/27_io/filebuf.cc
+++ b/libstdc++-v3/testsuite/27_io/filebuf.cc
@@ -409,7 +409,7 @@ bool test03() {
strmsz_1 = fb_03.in_avail();
pt_1 = fb_03.pubseekoff(2, std::ios_base::beg);
strmsz_2 = fb_03.in_avail();
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 > 0;
c1 = fb_03.snextc(); //current in pointer +1
test &= c1 == '3';
@@ -423,7 +423,7 @@ bool test03() {
//cur
// 27filebuf-3.txt = bd2\n456789:;<=>?...
pt_2 = fb_03.pubseekoff(2, std::ios_base::cur);
- off_2 = pt_2._M_position();
+ off_2 = pt_2;
test &= (off_2 == (off_1 + 2 + 1 + 1));
c1 = fb_03.snextc(); //current in pointer +1
test &= c1 == '7';
@@ -437,7 +437,7 @@ bool test03() {
// 27filebuf-3.txt = "bd2\n456x\n9"
pt_2 = fb_03.pubseekoff(0, std::ios_base::end,
std::ios_base::in|std::ios_base::out);
- off_1 = pt_2._M_position();
+ off_1 = pt_2;
test &= off_1 > off_2; //weak, but don't know exactly where it ends
c3 = fb_03.sputc('\n');
strmsz_1 = fb_03.sputn("because because because. . .", 28);
@@ -456,7 +456,7 @@ bool test03() {
//IN|OUT
//beg
pt_1 = fb_03.pubseekoff(78, std::ios_base::beg);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 > 0;
c1 = fb_03.snextc(); //current in pointer +1
test &= c1 == ' ';
@@ -464,12 +464,12 @@ bool test03() {
c3 = fb_03.sgetc();
fb_03.pubsync(); //resets pointers
pt_2 = fb_03.pubseekpos(pt_1);
- off_2 = pt_2._M_position();
+ off_2 = pt_2;
test &= off_1 == off_2;
c3 = fb_03.snextc(); //current in pointer +1
test &= c2 == c3;
pt_1 = fb_03.pubseekoff(0, std::ios_base::end);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 > off_2;
fb_03.sputn("\nof the wonderful things he does!!\nok", 37);
fb_03.pubsync();
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
index fd31614..519c89c 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
@@ -141,12 +141,24 @@ class testpunct : public numpunct<_CharT>
{
public:
typedef _CharT char_type;
+ const char_type dchar;
explicit
- testpunct(char_type decimal_char) : numpunct<_CharT>()
- {
- _M_init(decimal_char, ',', "");
- }
+ testpunct(char_type decimal_char) : numpunct<_CharT>(), dchar(decimal_char)
+ { }
+
+protected:
+ char_type
+ do_decimal_point() const
+ { return dchar; }
+
+ char_type
+ do_thousands_sep() const
+ { return ','; }
+
+ string
+ do_grouping() const
+ { return string(); }
};
template<typename _CharT>
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf.cc b/libstdc++-v3/testsuite/27_io/stringbuf.cc
index 5660677..20deda4 100644
--- a/libstdc++-v3/testsuite/27_io/stringbuf.cc
+++ b/libstdc++-v3/testsuite/27_io/stringbuf.cc
@@ -1,6 +1,6 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2000 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
@@ -338,7 +338,7 @@ bool test04() {
//IN|OUT
//beg
pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 >= 0;
c1 = strb_01.snextc(); //current in pointer +1
test &= c1 == 'o';
@@ -347,12 +347,12 @@ bool test04() {
test &= strb_01.str() == str_tmp;
//cur
pt_1 = strb_01.pubseekoff(2, std::ios_base::cur);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 == -1; // can't seekoff for in and out + cur in sstreams
pt_1 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
pt_2 = strb_01.pubseekoff(2, std::ios_base::cur, std::ios_base::in);
- off_2 = pt_2._M_position();
+ off_2 = pt_2;
test &= off_2 == off_1 + 2;
c1 = strb_01.snextc(); //current in pointer + 1
test &= c1 == ' ';
@@ -361,7 +361,7 @@ bool test04() {
test &= strb_01.str() == str_tmp;
//end
pt_2 = strb_01.pubseekoff(2, std::ios_base::end);
- off_1 = pt_2._M_position();
+ off_1 = pt_2;
test &= off_1 == -1; // not a valid position
test &= strb_01.str() == str_tmp;
// end part two (from the filebuf tests)
@@ -393,10 +393,10 @@ bool test04() {
//IN|OUT
//beg
pt_1 = strb_01.pubseekoff(2, std::ios_base::beg);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
test &= off_1 >= 0;
pt_1 = strb_01.pubseekoff(0, std::ios_base::cur, std::ios_base::out);
- off_1 = pt_1._M_position();
+ off_1 = pt_1;
c1 = strb_01.snextc(); //current in pointer +1
test &= c1 == 'o';
c2 = strb_01.sputc('x'); //test current out pointer
@@ -404,7 +404,7 @@ bool test04() {
test &= strb_01.str() == str_tmp;
strb_01.pubsync(); //resets pointers
pt_2 = strb_01.pubseekpos(pt_1, std::ios_base::in|std::ios_base::out);
- off_2 = pt_2._M_position();
+ off_2 = pt_2;
test &= off_1 == off_2;
c3 = strb_01.snextc(); //current in pointer +1
test &= c1 == c3;
diff --git a/libstdc++-v3/testsuite/27_io/stringstream.cc b/libstdc++-v3/testsuite/27_io/stringstream.cc
index 5b77c66..fc72e95 100644
--- a/libstdc++-v3/testsuite/27_io/stringstream.cc
+++ b/libstdc++-v3/testsuite/27_io/stringstream.cc
@@ -44,33 +44,27 @@ std::string test01()
// Empty string sanity check.
std::string str01;
std::string::iterator __i_start = str01.begin();
- char* __p_start = __i_start.base();
std::string::iterator __i_end = str01.end();
- char* __p_end = __i_end.base();
std::string::size_type len = str01.size();
- test = __p_start == __p_end;
+ test = __i_start == __i_end;
test &= len == 0;
// Full string sanity check.
std::string str02("these golden days, i spend waiting for you:\n
Betty Carter on Verve with I'm Yours and You're Mine.");
__i_start = str02.begin();
- __p_start = __i_start.base();
__i_end = str02.end();
- __p_end = __i_end.base();
len = str02.size();
- test &= __p_start != __p_end;
+ test &= __i_start != __i_end;
test &= len != 0;
// Test an empty ostring stream for sanity.
std::ostringstream ostrstream0;
std::string str03 = ostrstream0.str();
__i_start = str03.begin();
- __p_start = __i_start.base();
__i_end = str03.end();
- __p_end = __i_end.base();
len = str03.size();
- test &= __p_start == __p_end;
+ test &= __i_start == __i_end;
test &= len == 0;
test &= str01 == str03;