stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r548125 - /incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
Date Sun, 17 Jun 2007 22:12:14 GMT
Author: sebor
Date: Sun Jun 17 15:12:13 2007
New Revision: 548125

URL: http://svn.apache.org/viewvc?view=rev&rev=548125
Log:
2007-06-17  Martin Sebor  <sebor@roguewave.com>

	* 21.string.push_back.mt.cpp [!_RWSTD_REENTRANT](rw_opt_nthreads): Set
	to 1 in "single-threaded" builds.
	(thread_func, run_test): Removed gratuitous output.
	(run_test): Added rw_error() calls checking the successful creation
	of thread pools.

Modified:
    incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp

Modified: incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp?view=diff&rev=548125&r1=548124&r2=548125
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp Sun Jun 17 15:12:13 2007
@@ -28,8 +28,7 @@
  **************************************************************************/
 
 #include <string>       // for string
-
-#include <cstdio>       // for putc(), puts(), ...
+#include <cstddef>      // for size_t
 
 #include <driver.h>     // for rw_test()
 #include <rw_thread.h>  // for rw_thread_pool(), ...
@@ -49,8 +48,14 @@
 
 /**************************************************************************/
 
+#ifdef _RWSTD_REENTRANT
 int rw_opt_nthreads = 4;
-int rw_opt_nloops   = MAX_LOOPS;
+#else   // if !defined (_RWSTD_REENTRANT)
+// in non-threaded builds use just one thread
+int rw_opt_nthreads = 1;
+#endif   // _RWSTD_REENTRANT
+
+int rw_opt_nloops = MAX_LOOPS;
 
 extern "C" {
 
@@ -93,12 +98,6 @@
         // verify that the local copies have the expected data
         RW_ASSERT (0 == rw_strncmp (expect0_data, local0.data ()));
         RW_ASSERT (0 == rw_strncmp (expect1_data, local1.data ()));
-      
-        if (60 < rw_opt_nloops && 0 == i % (rw_opt_nloops / 60)) {
-            // parentheses used to thwart macro expansion
-            (std::putc)(to_append [thr_inx], stdout);
-            std::fflush (stdout);
-        }
     }
 
     return 0;
@@ -119,7 +118,9 @@
     const int result = rw_thread_pool (0, std::size_t (rw_opt_nthreads),
                                        0, thread_func, 0);
 
-    std::puts ("");
+    rw_error (result == 0, 0, __LINE__,
+              "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
+              rw_opt_nthreads, thread_func);
 
     rw_assert (0 == shared0.size (), 0, 0,
                "shared empty string modifed: expected \"\", got %{#S}",



Mime
View raw message