libstdc++ testsuite fixes, 2

Zack Weinberg zackw@stanford.edu
Tue May 15 11:30:00 GMT 2001


Three of the libstdc++ test cases contain multi-line string constants,
which have been carefully marked with dg-warning tags to catch the
"multi-line string constants are deprecated" warning.  For some
reason, all of these have been marked XFAIL.  And there are a couple
of single-line string constants that have the tag, too.

Now, in this particular case, when it says deprecated, it means 'this
feature _will_ be removed no later than 3.2, and in 3.1 if I can get
away with it.'  Hence I think the test suite should be changed not to
use multi-line string constants.  The appended patch accomplishes
this.  Note that the deprecation warning is not what is being tested
in any of these test cases (that's taken care of over in the C
compiler's test suite).

-- 
zw              But the voices in my head are what keeps me sane.
                	-- Shweta Narayan

	* testsuite/21_strings/inserters_extractors.cc,
	testsuite/27_io/istream_unformatted.cc,
	testsuite/27_io/stringstream.cc:
	Replace	multi-line string constants with C89-style
	concatenated string constants.
	
===================================================================
Index: testsuite/21_strings/inserters_extractors.cc
--- testsuite/21_strings/inserters_extractors.cc	2001/05/12 16:51:41	1.7
+++ testsuite/21_strings/inserters_extractors.cc	2001/05/15 18:28:59
@@ -41,9 +41,8 @@ bool test01(void)
   csize_type npos = std::string::npos;
   csize_type csz01, csz02;
 
-  // { dg-warning "string literals" "" { xfail *-*-* } 45 }
-  const std::string str01("sailing grand traverse bay
-			    from Elk Rapids to the point reminds me of miles");
+  const std::string str01("sailing grand traverse bay\n"
+		"\t\t\t    from Elk Rapids to the point reminds me of miles");
   const std::string str02("sailing");
   const std::string str03("grand");
   const std::string str04("traverse");
===================================================================
Index: testsuite/27_io/istream_unformatted.cc
--- testsuite/27_io/istream_unformatted.cc	2001/05/12 16:51:42	1.13
+++ testsuite/27_io/istream_unformatted.cc	2001/05/15 18:28:59
@@ -142,11 +142,10 @@ test02()
   typedef std::char_traits<char>	traits_type;
 
   bool test = true;
-  // { dg-warning "string literals" "" { xfail *-*-* } 146 }
-  const char str_lit01[] = "			    sun*ra 
-                            and his myth science arkestra present
-                            angles and demons @ play
-                            the nubians of plutonia";
+  const char str_lit01[] = "			    sun*ra \n"
+"                            and his myth science arkestra present\n"
+"                            angles and demons @ play\n"
+"                            the nubians of plutonia";
   std::string str01(str_lit01);
   std::string strtmp;
 
@@ -201,8 +200,9 @@ test02()
   VERIFY( is_04.gcount() == 64 );
   VERIFY( state1 != state2 );
   VERIFY( state2 == statefail );
-  // { dg-warning "string literals" "" { xfail *-*-* } 205 }
-  VERIFY( !traits_type::compare("                            and his myth science arkestra presen", carray1, 65) );
+  VERIFY( !traits_type::compare(
+  "                            and his myth science arkestra presen",
+				carray1, 65) );
 
   is_04.clear();
   state1 = is_04.rdstate();
@@ -234,10 +234,9 @@ test03()
   typedef std::char_traits<char>	traits_type;
 
   bool test = true;
-  // { dg-warning "string literals" "" { xfail *-*-* } 238 }
-  const char str_lit01[] = "   sun*ra 
-			   & his arkestra, featuring john gilmore: 
-                         jazz in silhouette: images and forecasts of tomorrow";
+  const char str_lit01[] = "   sun*ra \n"
+"			   & his arkestra, featuring john gilmore: \n"
+"                         jazz in silhouette: images and forecasts of tomorrow";
   std::string str01(str_lit01);
   std::string strtmp;
 
@@ -360,23 +359,21 @@ test04()
 int
 test05()
 {
-  // { dg-warning "string literals" "" { xfail *-*-* } 364 }
-  const char* charray = "
-a
-aa
-aaa
-aaaa
-aaaaa
-aaaaaa
-aaaaaaa
-aaaaaaaa
-aaaaaaaaa
-aaaaaaaaaa
-aaaaaaaaaaa
-aaaaaaaaaaaa
-aaaaaaaaaaaaa
-aaaaaaaaaaaaaa
-";
+  const char* charray = "\n"
+"a\n"
+"aa\n"
+"aaa\n"
+"aaaa\n"
+"aaaaa\n"
+"aaaaaa\n"
+"aaaaaaa\n"
+"aaaaaaaa\n"
+"aaaaaaaaa\n"
+"aaaaaaaaaa\n"
+"aaaaaaaaaaa\n"
+"aaaaaaaaaaaa\n"
+"aaaaaaaaaaaaa\n"
+"aaaaaaaaaaaaaa\n";
 
   bool test = true;
   const std::streamsize it = 5;
===================================================================
Index: testsuite/27_io/stringstream.cc
--- testsuite/27_io/stringstream.cc	2001/05/12 16:51:42	1.5
+++ testsuite/27_io/stringstream.cc	2001/05/15 18:28:59
@@ -49,8 +49,8 @@ test01()
 
   // Full string sanity check.
   // { dg-warning "string literals" "" { xfail *-*-* } 52 }
-  std::string str02("these golden days, i spend waiting for you:\n 
-              Betty Carter on Verve with I'm Yours and You're Mine.");
+  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();
   __i_end = str02.end();
   len = str02.size();



More information about the Libstdc++ mailing list