Patchwork [libstdc++,testsuite] Shrink more tests for simulator

login
register
mail settings
Submitter Steve Ellcey
Date Dec. 14, 2012, 6:10 p.m.
Message ID <2591f3c8-28db-4656-a635-af9c65fc5e91@EXCHHUB01.MIPS.com>
Download mbox | patch
Permalink /patch/206534/
State New
Headers show

Comments

Steve Ellcey - Dec. 14, 2012, 6:10 p.m.
Here are four more C++ tests that fail for me when run under the GNU
simulator.  I would like to shrink them to use less memory in the same
way as the other tests that I modified earlier.

OK to checkin?

Steve Ellcey
sellcey@mips.com


2012-12-14  Steve Ellcey  <sellcey@mips.com>

	* testsuite/21_strings/basic_string/append/wchar_t/3.cc: Shrink
	memory usage under simulator.
	* testsuite/21_strings/basic_string/cons/wchar_t/6.cc: Ditto.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc:
	Ditto.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc:
	Ditto.
Jonathan Wakely - Dec. 14, 2012, 9:59 p.m.
On 14 December 2012 18:10, Steve Ellcey wrote:
> Here are four more C++ tests that fail for me when run under the GNU
> simulator.  I would like to shrink them to use less memory in the same
> way as the other tests that I modified earlier.
>
> OK to checkin?

OK, thanks.

Patch

diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc
index dca5dbd..d20b994 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc
@@ -19,6 +19,12 @@ 
 
 // 21.3.5 string modifiers
 
+// { dg-options "-DITERATIONS=14" { target simulator } }
+
+#ifndef ITERATIONS
+#define ITERATIONS 18
+#endif
+
 #include <string>
 #include <testsuite_hooks.h>
 
@@ -37,7 +43,7 @@  test03()
     {
       wstring one(source);
       wstring two(source);
-      for (unsigned j = 0; j < 18; ++j)
+      for (unsigned j = 0; j < ITERATIONS; ++j)
 	{
 	  VERIFY( one == two );
 	  one.append(one);
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc
index 82ed764..95acdd0 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc
@@ -19,6 +19,12 @@ 
 
 // 21.3.1 basic_string constructors.
 
+// { dg-options "-DITERATIONS=11" { target simulator } }
+
+#ifndef ITERATIONS
+#define ITERATIONS 13
+#endif
+
 #include <iterator>
 #include <sstream>
 #include <cstdlib>
@@ -50,6 +56,6 @@  void test01(int iter)
 
 int main()
 {
-  test01(13);
+  test01(ITERATIONS);
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc
index 0883e13..a647c39 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc
@@ -17,6 +17,12 @@ 
 
 // 21.3.7.9 inserters and extractors
 
+// { dg-options "-DMAX_SIZE=505" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 777
+#endif
+
 #include <istream>
 #include <string>
 #include <fstream>
@@ -64,7 +70,7 @@  void test01()
 
   const wchar_t delim = L'|';
   const unsigned nchunks = 10;
-  const wstring data = prepare(777, nchunks, delim);
+  const wstring data = prepare(MAX_SIZE, nchunks, delim);
 
   wofstream ofstrm;
   ofstrm.open(filename);
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc
index 2f174ca..a0a822f 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc
@@ -17,6 +17,12 @@ 
 
 // 21.3.7.9 inserters and extractors
 
+// { dg-options "-DMAX_SIZE=466" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE 666
+#endif
+
 #include <istream>
 #include <string>
 #include <fstream>
@@ -63,7 +69,7 @@  void test01()
   const char filename[] = "inserters_extractors-3.txt";
 
   const unsigned nchunks = 10;
-  const wstring data = prepare(666, nchunks);
+  const wstring data = prepare(MAX_SIZE, nchunks);
 
   wofstream ofstrm;
   ofstrm.open(filename);