diff --git a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc index 922d47028a0..d044777a710 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 40e6cc6a1ab..a04215e7d22 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 fd31614774e..519c89cb4c9 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 diff --git a/libstdc++-v3/testsuite/27_io/stringbuf.cc b/libstdc++-v3/testsuite/27_io/stringbuf.cc index 5660677b82d..20deda41ea6 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 5b77c660502..fc72e95f51e 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;