testsuite std:: prefix patch

Mumit Khan khan@nanotech.wisc.edu
Thu Nov 18 21:08:00 GMT 1999


Quite unglamarous, but somebody has to do the dirty work ;-) Hopefully
I've gotten them all.

Thu Nov 18 22:52:53 1999  Mumit Khan  <khan@xraylith.wisc.edu>

	* testsuite/18_support/numeric_limits.cc: Add missing std:: prefix.
	* testsuite/21_strings/inserters_extractors.cc: Likewise.
	* testsuite/22_locale/ctype.cc: Likewise.
	* testsuite/23_containers/multiset.cc: Likewise.
	* testsuite/23_containers/vector_ctor.cc: Likewise.
	* testsuite/26_numerics/binary_closure.cc: Likewise.
	* testsuite/27_io/fpos.cc: Likewise.
	* testsuite/27_io/ios_base_callbacks.cc: Likewise.
	* testsuite/27_io/istream_extractor_arith.cc: Likewise.
	* testsuite/27_io/istream_extractor_char.cc: Likewise.
	* testsuite/27_io/istream_extractor_other.cc: Likewise.
	* testsuite/27_io/istream_sentry.cc: Likewise.
	* testsuite/27_io/ostream_inserter_char.cc: Likewise.
	* testsuite/27_io/ostream_inserter_other.cc: Likewise.
	* testsuite/27_io/streambuf.cc: Likewise.
	* testsuite/27_io/stringstream.cc: Likewise.

Index: testsuite/18_support/numeric_limits.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/18_support/numeric_limits.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 numeric_limits.cc
--- numeric_limits.cc	1999/08/24 16:04:38	1.1
+++ numeric_limits.cc	1999/11/19 05:03:03
@@ -42,7 +42,7 @@ struct B { };
 bool test01()
 {
   bool test = true;
-  numeric_limits< A<B> > obj;
+  std::numeric_limits< A<B> > obj;
 
   test &= !obj.is_specialized;
   test &= obj.min() == 0;
@@ -73,7 +73,7 @@ bool test01()
   test &= !obj.is_modulo;
   test &= !obj.traps;
   test &= !obj.tinyness_before;
-  test &= obj.round_style == round_toward_zero;
+  test &= obj.round_style == std::round_toward_zero;
 
 #ifdef DEBUG_ASSERT
   assert(test);
Index: testsuite/21_strings/inserters_extractors.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/21_strings/inserters_extractors.cc,v
retrieving revision 1.12
diff -u -3 -p -r1.12 inserters_extractors.cc
--- inserters_extractors.cc	1999/10/26 00:11:10	1.12
+++ inserters_extractors.cc	1999/11/19 05:03:03
@@ -165,11 +165,11 @@ void test04(int size)
   test &= oss.good();
 
   // stress test
-  oss << str << endl;
+  oss << str << std::endl;
   if (!oss.good()) 
     test = false;
 
-  oss << str << endl;
+  oss << str << std::endl;
   if (!oss.good()) 
     test = false;
 
@@ -193,18 +193,18 @@ void test05(int size)
   const char* filename = "buffer.txt";
   const char fillc = 'f';
   std::ofstream ofs(filename);
-  string str(size, fillc);
+  std::string str(size, fillc);
 
   // sanity checks
   test &= str.size() == size;
   test &= ofs.good();
 
   // stress test
-  ofs << str << endl;
+  ofs << str << std::endl;
   if (!ofs.good()) 
     test = false;
 
-  ofs << str << endl;
+  ofs << str << std::endl;
   if (!ofs.good()) 
     test = false;
 
@@ -241,8 +241,8 @@ void test06(void)
 {
   bool test = true;
 
-  typedef string::size_type size_type;
-  string str01("@silent");
+  typedef std::string::size_type size_type;
+  std::string str01("@silent");
   size_type i01 = str01.size();
   size_type i02 = str01.capacity();
   str01.erase(0, 1);
@@ -251,9 +251,9 @@ void test06(void)
   test &= i01 - 1 == i03;
   test &= i02 >= i04;
 
-  istringstream is(str01);
-  string str02;
-  is >> str02 >> ws;
+  std::istringstream is(str01);
+  std::string str02;
+  is >> str02 >> std::ws;
   size_type i05 = str02.size();
   size_type i06 = str02.capacity();
   test &= i05 == i03;
Index: testsuite/22_locale/ctype.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/22_locale/ctype.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 ctype.cc
--- ctype.cc	1999/08/26 08:54:09	1.1
+++ ctype.cc	1999/11/19 05:03:03
@@ -23,7 +23,7 @@
 #include <locale>
 
 // 1 should be able to instantiate this for other types besides char, wchar_t
-class gnu_ctype: public ctype<unsigned char> { };
+class gnu_ctype: public std::ctype<unsigned char> { };
 gnu_ctype facet01;
 
 
Index: testsuite/23_containers/multiset.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/23_containers/multiset.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 multiset.cc
--- multiset.cc	1999/06/24 18:19:17	1.1
+++ multiset.cc	1999/11/19 05:03:03
@@ -24,19 +24,19 @@
 #include <set>
 #include <algorithm>
 
-ostream& 
-operator<<(ostream& os, pair<int, int> const& p) 
+std::ostream& 
+operator<<(std::ostream& os, std::pair<int, int> const& p) 
 { return os << p.first << ' ' << p.second; }
 
 bool 
-operator<(pair<int, int> const& lhs, pair<int, int> const& rhs) 
+operator<(std::pair<int, int> const& lhs, std::pair<int, int> const& rhs) 
 { return lhs.first < rhs.first; }
 
 int main () 
 {
-  typedef multiset<pair<int, int> >::iterator iterator;
-  pair<int, int> p(69, 0);
-  multiset<pair<int, int> > s;
+  typedef std::multiset<pair<int, int> >::iterator iterator;
+  std::pair<int, int> p(69, 0);
+  std::multiset<pair<int, int> > s;
 
   for (p.second = 0; p.second < 5; ++p.second)
     s.insert(p);
@@ -50,7 +50,8 @@ int main () 
   // XXX need to use debug-assert here and get this working with an
   // ostrinsrtream, that way we can just check the strings for
   // equivalance.
-  copy(s.begin(), s.end(), ostream_iterator<pair<int, int> >(cout, "\n"));
+  std::copy(s.begin(), s.end(), 
+            std::ostream_iterator<std::pair<int, int> >(std::cout, "\n"));
 
   return 0;
 }
Index: testsuite/23_containers/vector_ctor.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/23_containers/vector_ctor.cc,v
retrieving revision 1.2
diff -u -3 -p -r1.2 vector_ctor.cc
--- vector_ctor.cc	1999/08/12 03:54:16	1.2
+++ vector_ctor.cc	1999/11/19 05:03:03
@@ -50,8 +50,8 @@ bool test01()
 }
 
 // 2
-template class vector<double>;
-template class vector< A<B> >;
+template class std::vector<double>;
+template class std::vector< A<B> >;
 
 int main()
 {
Index: testsuite/26_numerics/binary_closure.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/26_numerics/binary_closure.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 binary_closure.cc
--- binary_closure.cc	1999/08/05 21:49:13	1.1
+++ binary_closure.cc	1999/11/19 05:03:03
@@ -10,7 +10,7 @@
 
 int main()
 {
-    valarray<double> a(10), b(10), c(10), d(10);
+    std::valarray<double> a(10), b(10), c(10), d(10);
 
     a = 1.2;
     b = 3.1;
@@ -18,19 +18,19 @@ int main()
     c = 4.0;
 
     d = ( 2.0 * b + a );  // works
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
 
     d = (a * 2.0 + b ); // works
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
 
     d = (a + b * 2.0 ); // segfaults!
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
     d = (a + 2.0* b );
 
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
     d = (a + 2.0* b );
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
     d = (a + 2.0* b );
 
-    cout << "d[4] = " << d[4] << endl;
+    std::cout << "d[4] = " << d[4] << std::endl;
 }
Index: testsuite/27_io/fpos.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/fpos.cc,v
retrieving revision 1.3
diff -u -3 -p -r1.3 fpos.cc
--- fpos.cc	1999/10/07 07:51:58	1.3
+++ fpos.cc	1999/11/19 05:03:03
@@ -146,20 +146,20 @@ void test03()
 
   // casts to const streamoff
   // (yes, I know this is weak code)
-  const streampos pos01 = 0;
+  const std::streampos pos01 = 0;
   off01 = pos01;
 
   // equality/inequality with const args
-  const streampos pos02(54);
-  streampos pos03(44);
+  const std::streampos pos02(54);
+  std::streampos pos03(44);
   test &= !(pos03 == pos02);
   test &= pos03 != pos02;
   test &= !(pos02 == pos03);
   test &= pos02 != pos03;
 
   // default values
-  streampos pos04;
-  test &= (streamoff)pos04 == 0; 
+  std::streampos pos04;
+  test &= (std::streamoff)pos04 == 0; 
 
 #ifdef DEBUG_ASSERT
   assert(test);
Index: testsuite/27_io/ios_base_callbacks.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/ios_base_callbacks.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 ios_base_callbacks.cc
--- ios_base_callbacks.cc	1999/11/11 20:17:37	1.1
+++ ios_base_callbacks.cc	1999/11/19 05:03:03
@@ -26,19 +26,19 @@
 #include <assert.h>
 #endif
 
-const string str01("the nubians of plutonia");
-string str02;
+const std::string str01("the nubians of plutonia");
+std::string str02;
 
 void 
-callb01(ios_base::event e,  ios_base& b, int i)
+callb01(std::ios_base::event e,  std::ios_base& b, int i)
 { str02 += "the nubians"; }
 
 void 
-callb02(ios_base::event e,  ios_base& b, int i)
+callb02(std::ios_base::event e,  std::ios_base& b, int i)
 { str02 += " of "; }
 
 void 
-callb03(ios_base::event e,  ios_base& b, int i)
+callb03(std::ios_base::event e,  std::ios_base& b, int i)
 { str02 += "plutonia"; }
 
 bool test01() 
Index: testsuite/27_io/istream_extractor_arith.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/istream_extractor_arith.cc,v
retrieving revision 1.4
diff -u -3 -p -r1.4 istream_extractor_arith.cc
--- istream_extractor_arith.cc	1999/09/01 00:48:09	1.4
+++ istream_extractor_arith.cc	1999/11/19 05:03:03
@@ -118,7 +118,7 @@ bool test02() {
   bool test = true;
   const std::string str_01("20000AB");
   std::stringbuf strb_01(str_01, std::ios_base::in);
-  istream is(&strb_01);
+  std::istream is(&strb_01);
 
   int n = 15;
   is >> n;
Index: testsuite/27_io/istream_extractor_char.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/istream_extractor_char.cc,v
retrieving revision 1.6
diff -u -3 -p -r1.6 istream_extractor_char.cc
--- istream_extractor_char.cc	1999/10/20 05:46:14	1.6
+++ istream_extractor_char.cc	1999/11/19 05:03:03
@@ -140,11 +140,11 @@ bool test01() {
 
   is_03 >> array1;
   test &=  !ctraits_type::compare(array1,"impulse!!", 10);
-  test &= is_03.rdstate() == ios_base::eofbit;
+  test &= is_03.rdstate() == std::ios_base::eofbit;
 
   is_04.width(9);
   is_04 >> array1;
-  test &=  ! ios::traits_type::compare(array1,"impulse!", 9);
+  test &=  ! std::ios::traits_type::compare(array1,"impulse!", 9);
   test &= !is_04.rdstate(); 
 
 #ifdef DEBUG_ASSERT
Index: testsuite/27_io/istream_extractor_other.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/istream_extractor_other.cc,v
retrieving revision 1.6
diff -u -3 -p -r1.6 istream_extractor_other.cc
--- istream_extractor_other.cc	1999/11/16 07:14:56	1.6
+++ istream_extractor_other.cc	1999/11/19 05:03:03
@@ -168,7 +168,7 @@ bool test02() {
   if (test)
     {
       std::istream is(&fbin);
-      is.unsetf(ios_base::skipws);
+      is.unsetf(std::ios_base::skipws);
       is >> &fbout;
     }
 
Index: testsuite/27_io/istream_sentry.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/istream_sentry.cc,v
retrieving revision 1.1
diff -u -3 -p -r1.1 istream_sentry.cc
--- istream_sentry.cc	1999/10/18 06:29:22	1.1
+++ istream_sentry.cc	1999/11/19 05:03:03
@@ -39,25 +39,25 @@ void test01()
 {
   bool test = true;
   const char* lit01 = "stereolab on the bolsinga tip";
-  const string str01(lit01);
+  const std::string str01(lit01);
 
-  stringbuf strbuf01;
-  stringbuf strbuf02(str01);
-  istream istr01(&strbuf01);
-  istream istr02(&strbuf02);
+  std::stringbuf strbuf01;
+  std::stringbuf strbuf02(str01);
+  std::istream istr01(&strbuf01);
+  std::istream istr02(&strbuf02);
   
   // test negatives
-  istream::sentry sentry01(istr01);	
+  std::istream::sentry sentry01(istr01);	
   test &= bool(sentry01) == false; 
 
-  istream::sentry sentry02(istr01, true);
+  std::istream::sentry sentry02(istr01, true);
   test &= bool(sentry02) == false; 
 
   // positive tests
-  istream::sentry sentry03(istr02);	
+  std::istream::sentry sentry03(istr02);	
   test &= bool(sentry03) == true; 
 
-  istream::sentry sentry04(istr02, true);
+  std::istream::sentry sentry04(istr02, true);
   test &= bool(sentry04) == true; 
 
 #ifdef DEBUG_ASSERT
Index: testsuite/27_io/ostream_inserter_char.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/ostream_inserter_char.cc,v
retrieving revision 1.4
diff -u -3 -p -r1.4 ostream_inserter_char.cc
--- ostream_inserter_char.cc	1999/11/01 02:43:05	1.4
+++ ostream_inserter_char.cc	1999/11/19 05:03:03
@@ -32,7 +32,7 @@
 bool test01()
 {
   bool test = true;
-  string str01;
+  std::string str01;
   const int size = 1000;
   const char name_02[] = "testsuite/ostream_inserter_char-1.txt";
 
@@ -66,31 +66,31 @@ bool test01()
 bool test02(void) 
 {
   bool test = true;
-  string tmp;
+  std::string tmp;
   
-  string str01 = "";
-  ostringstream oss01;
+  std::string str01 = "";
+  std::ostringstream oss01;
   oss01.width(5);
   oss01.fill('0');
-  oss01.flags(ios_base::left);
+  oss01.flags(std::ios_base::left);
   oss01 << str01;
   tmp = oss01.str();
   test &= tmp == "00000";
 
-  string str02 = "1";
-  ostringstream oss02;
+  std::string str02 = "1";
+  std::ostringstream oss02;
   oss02.width(5);
   oss02.fill('0');
-  oss02.flags(ios_base::left);
+  oss02.flags(std::ios_base::left);
   oss02 << str02;
   tmp = oss02.str();
   test &= tmp == "10000";
 
-  string str03 = "909909";
-  ostringstream oss03;
+  std::string str03 = "909909";
+  std::ostringstream oss03;
   oss03.width(5);
   oss03.fill('0');
-  oss03.flags(ios_base::left);
+  oss03.flags(std::ios_base::left);
   oss03 << str03;
   tmp = oss03.str();
   test &= tmp == "909909";
@@ -107,31 +107,31 @@ bool test02(void) 
 bool test03(void) 
 {
   bool test = true;
-  string tmp;
+  std::string tmp;
 
-  string str01 = "";
-  ostringstream oss01;
+  std::string str01 = "";
+  std::ostringstream oss01;
   oss01.width(5);
   oss01.fill('0');
-  oss01.flags(ios_base::right);
+  oss01.flags(std::ios_base::right);
   oss01 << str01;
   tmp = oss01.str();
   test &= tmp == "00000";
 
-  string str02 = "1";
-  ostringstream oss02;
+  std::string str02 = "1";
+  std::ostringstream oss02;
   oss02.width(5);
   oss02.fill('0');
-  oss02.flags(ios_base::right);
+  oss02.flags(std::ios_base::right);
   oss02 << str02;
   tmp = oss02.str();
   test &= tmp == "00001";
 
-  string str03 = "909909";
-  ostringstream oss03;
+  std::string str03 = "909909";
+  std::ostringstream oss03;
   oss03.width(5);
   oss03.fill('0');
-  oss03.flags(ios_base::right);
+  oss03.flags(std::ios_base::right);
   oss03 << str03;
   tmp = oss03.str();
   test &= tmp == "909909";
@@ -153,7 +153,7 @@ bool test04() {
   std::string str_tmp;
   const int i_max=250;
 
-  std::ostringstream oss_01(ios_base::out);
+  std::ostringstream oss_01(std::ios_base::out);
   std::ostringstream oss_02(str_01, std::ios_base::out);
 
   std::ios_base::iostate state1, state2, statefail;
@@ -162,7 +162,7 @@ bool test04() {
   // template<_CharT, _Traits>
   //  basic_ostream& operator<<(ostream&, const char*)
   for (int i = 0; i < i_max; ++i) 
-    oss_02 << "Test: " << i << endl;
+    oss_02 << "Test: " << i << std::endl;
   str_tmp = oss_02.str();
   test &= !oss_02.bad();
   test &= oss_02.good();
@@ -180,11 +180,11 @@ bool test04() {
 bool test05()
 {
   bool test = true;
-  string str05, str10;
+  std::string str05, str10;
 
   typedef std::ostream::pos_type	pos_type;
   typedef std::ostream::off_type	off_type;
-  string str01;
+  std::string str01;
   const int size = 1000;
 
   // initialize string
@@ -202,7 +202,7 @@ bool test05()
   }
 
   // test 1: out
-  std::ostringstream sstr01(str01, ios_base::out);
+  std::ostringstream sstr01(str01, std::ios_base::out);
   std::ostringstream sstr02;
   sstr02 << str01;
   str05 = sstr01.str();
@@ -211,8 +211,8 @@ bool test05()
   test &= str10 == str01;
 
   // test 2: in | out 
-  std::ostringstream sstr04(str01, ios_base::out | ios_base::in);
-  std::ostringstream sstr05(ios_base::in | ios_base::out);
+  std::ostringstream sstr04(str01,  std::ios_base::out | std::ios_base::in);
+  std::ostringstream sstr05(std::ios_base::in | std::ios_base::out);
   sstr05 << str01;
   str05 = sstr04.str();
   str10 = sstr05.str();
Index: testsuite/27_io/ostream_inserter_other.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/ostream_inserter_other.cc,v
retrieving revision 1.3
diff -u -3 -p -r1.3 ostream_inserter_other.cc
--- ostream_inserter_other.cc	1999/11/16 07:14:56	1.3
+++ ostream_inserter_other.cc	1999/11/19 05:03:03
@@ -58,12 +58,12 @@ bool test02() {
   f_in1 >> strbuf01;
   iostate state02 = f_in1.rdstate();
   test &= state01 != state02;
-  test &= (state02 & ios_base::failbit) != 0;
+  test &= (state02 & std::ios_base::failbit) != 0;
   state01 = f_out1.rdstate();
   f_out1 << strbuf01;
   state02 = f_out1.rdstate();
   test &= state01 != state02;
-  test &= (state02 & ios_base::failbit) != 0;
+  test &= (state02 & std::ios_base::failbit) != 0;
 
   // filebuf->filebuf
   std::ifstream f_in(name_01);
Index: testsuite/27_io/streambuf.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/streambuf.cc,v
retrieving revision 1.2
diff -u -3 -p -r1.2 streambuf.cc
--- streambuf.cc	1999/11/16 07:14:56	1.2
+++ streambuf.cc	1999/11/19 05:03:03
@@ -34,17 +34,17 @@
 #include <assert.h>
 #endif
 
-class testbuf : public streambuf
+class testbuf : public std::streambuf
 {
   // Typdefs:
-  typedef streambuf::traits_type traits_type;
+  typedef std::streambuf::traits_type traits_type;
 
 public:
 
-  testbuf(): streambuf()
+  testbuf(): std::streambuf()
   {
     _M_buf_size = 1024;
-    _M_mode = (ios_base::in | ios_base::out);
+    _M_mode = (std::ios_base::in | std::ios_base::out);
   }
 
   int_type
@@ -79,8 +79,8 @@ public:
   pub_setp(char *beg, char *end) 
   { this->setp(beg, end); }
 
-  streamsize 
-  pub_xsputn(char_type *s,  streamsize n)
+  std::streamsize 
+  pub_xsputn(char_type *s,  std::streamsize n)
   { return (this->xsputn(s, n)); }
 
 protected:
Index: testsuite/27_io/stringstream.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/27_io/stringstream.cc,v
retrieving revision 1.5
diff -u -3 -p -r1.5 stringstream.cc
--- stringstream.cc	1999/08/19 05:19:59	1.5
+++ stringstream.cc	1999/11/19 05:03:03
@@ -126,19 +126,19 @@ bool test02(void) {
 #endif
 
   // stringstream
-  string str1("");
-  string str3("this is a somewhat  string");
-  stringstream ss1(str1, ios_base::in|ios_base::out);
-  stringstream ss2(str3, ios_base::in|ios_base::out);
+  std::string str1("");
+  std::string str3("this is a somewhat  string");
+  std::stringstream ss1(str1, std::ios_base::in|std::ios_base::out);
+  std::stringstream ss2(str3, std::ios_base::in|std::ios_base::out);
 
   return test;
 }
 
 // user-reported error
-class derived_oss: public ostringstream 
+class derived_oss: public std::ostringstream 
 {
 public:
-  derived_oss() : ostringstream() {}
+  derived_oss() : std::ostringstream() {}
 };
 
 bool test03()
@@ -146,7 +146,7 @@ bool test03()
   bool test = true;
   derived_oss yy;
   yy << "buena vista social club\n";
-  test &= yy.str() == string("buena vista social club\n");
+  test &= yy.str() == std::string("buena vista social club\n");
 
 #ifdef DEBUG_ASSERT
   assert(test);

Regards,
Mumit



More information about the Libstdc++ mailing list