stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r357563 - in /incubator/stdcxx/trunk/tests: algorithms/25.for.each.cpp diagnostics/19.exceptions.mt.cpp strings/21.string.push_back.mt.cpp support/atomic_add.cpp support/atomic_xchg.cpp
Date Sun, 18 Dec 2005 23:43:40 GMT
Author: sebor
Date: Sun Dec 18 15:43:31 2005
New Revision: 357563

URL: http://svn.apache.org/viewcvs?rev=357563&view=rev
Log:
2005-12-18  Martin Sebor  <sebor@roguewave.com>

	* 19.exceptions.mt.cpp (--nloops=N, --nthreads=N): Restricted the set of
	valid values of N accepted by the test driver and eliminated validation
	done by the test (obviated by rev 357416).
	* 21.string.push_back.mt.cpp: Same.
	* 25.for.each.cpp (--nloops=N): Same.
	* atomic_add.cpp (--nloops=N, --nthreads=N): Same.
	* atomic_xchg.cpp: Same.

Modified:
    incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
    incubator/stdcxx/trunk/tests/diagnostics/19.exceptions.mt.cpp
    incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
    incubator/stdcxx/trunk/tests/support/atomic_add.cpp
    incubator/stdcxx/trunk/tests/support/atomic_xchg.cpp

Modified: incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp?rev=357563&r1=357562&r2=357563&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp (original)
+++ incubator/stdcxx/trunk/tests/algorithms/25.for.each.cpp Sun Dec 18 15:43:31 2005
@@ -20,7 +20,7 @@
  **************************************************************************/
 
 #include <algorithm>     // for for_each
-#include <cstddef>       // for size_t
+#include <cstddef>       // for ptrdiff_t
 
 #include <alg_test.h>
 #include <driver.h>      // for rw_test(), ...
@@ -164,6 +164,7 @@
 
 /**************************************************************************/
 
+static int rw_opt_nloops = 32;     // --nloops=#
 static int rw_opt_no_input_iter;   // --no-InputIterator
 static int rw_opt_no_fwd_iter;     // --no-ForwardIterator
 static int rw_opt_no_bidir_iter;   // --no-BidirectionalIterator
@@ -173,7 +174,7 @@
 static int
 run_test (int, char*[])
 {
-    static const std::size_t N = 32;
+    const std::size_t N = std::size_t (rw_opt_nloops);
 
     rw_info (0, 0, 0,
              "template <class %s, class %s> "
@@ -224,10 +225,12 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.alg.foreach",
                     0 /* no comment */, run_test,
-                    "|-no-InputIterator#"
-                    "|-no-ForwardIterator#"
-                    "|-no-BidirectionalIterator#"
+                    "|-nloops#0 "   // must be non-negative
+                    "|-no-InputIterator# "
+                    "|-no-ForwardIterator# "
+                    "|-no-BidirectionalIterator# "
                     "|-no-RandomAccessIterator#",
+                    &rw_opt_nloops,
                     &rw_opt_no_input_iter,
                     &rw_opt_no_fwd_iter,
                     &rw_opt_no_bidir_iter,

Modified: incubator/stdcxx/trunk/tests/diagnostics/19.exceptions.mt.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/diagnostics/19.exceptions.mt.cpp?rev=357563&r1=357562&r2=357563&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/diagnostics/19.exceptions.mt.cpp (original)
+++ incubator/stdcxx/trunk/tests/diagnostics/19.exceptions.mt.cpp Sun Dec 18 15:43:31 2005
@@ -276,16 +276,6 @@
 static int
 run_test (int, char**)
 {
-    // check that the number of threads is valid
-    rw_fatal (-1 < rw_opt_nthreads && rw_opt_nthreads < MAX_THREADS, 0, 0,
-              "number of threads must be in the range [0, %d), got %d",
-              MAX_THREADS, rw_opt_nthreads);
-
-    // check that the number of loops is non-negative
-    rw_fatal (-1 < rw_opt_nloops, 0, 0,
-              "number of loops must be non-negative, got %d",
-              rw_opt_nloops);
-
     // get the current alarm (if any) set for the test
     // on the command line without resetting it
     const unsigned max_sec = rw_alarm (0, rw_sig_hold);
@@ -358,8 +348,8 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.std.exceptions",
                     "thread safety", run_test,
-                    "|-nloops# "
-                    "|-nthreads#",
+                    "|-nloops#0 "        // must be non-negative
+                    "|-nthreads#0-32",   // must be between 0 and 32
                     &rw_opt_nloops,
                     &rw_opt_nthreads);
 }

Modified: incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp?rev=357563&r1=357562&r2=357563&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp (original)
+++ incubator/stdcxx/trunk/tests/strings/21.string.push_back.mt.cpp Sun Dec 18 15:43:31 2005
@@ -31,7 +31,7 @@
 
 /**************************************************************************/
 
-#define MAX_THREADS      36
+#define MAX_THREADS      32
 #define MAX_LOOPS    100000
 
 const char to_append [MAX_THREADS + 1] = {
@@ -102,16 +102,6 @@
 static int
 run_test (int, char**)
 {
-    // check that the number of threads is non-negative
-    rw_fatal (-1 < rw_opt_nthreads, 0, 0,
-              "number of threads must be non-negative. got %d",
-              rw_opt_nthreads);
-
-    // check that the number of loops is non-negative
-    rw_fatal (-1 < rw_opt_nloops, 0, 0,
-              "number of loops must be non-negative. got %d",
-              rw_opt_nloops);
-
     rw_info (0, 0, 0, "running %d thread%{?}s%{;}, %zu iteration%{?}s%{;} each",
              rw_opt_nthreads, 1 != rw_opt_nthreads,
              rw_opt_nloops, 1 != rw_opt_nloops);
@@ -143,8 +133,8 @@
     return rw_test (argc, argv, __FILE__,
                     "lib.string.push_back",
                     "thread safety", run_test,
-                    "|-nloops# "
-                    "|-nthreads# ",
+                    "|-nloops#0 "        // must be non-negative
+                    "|-nthreads#0-32",   // must be between 0 and 32
                     &rw_opt_nloops,
                     &rw_opt_nthreads);
 }

Modified: incubator/stdcxx/trunk/tests/support/atomic_add.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/support/atomic_add.cpp?rev=357563&r1=357562&r2=357563&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/support/atomic_add.cpp (original)
+++ incubator/stdcxx/trunk/tests/support/atomic_add.cpp Sun Dec 18 15:43:31 2005
@@ -292,16 +292,6 @@
 static int
 run_test (int, char**)
 {
-    // check that the number of threads is valid
-    rw_fatal (-1 < rw_opt_nthreads && rw_opt_nthreads < MAX_THREADS, 0, 0,
-              "number of threads must be in the range [0, %d), got %d",
-              MAX_THREADS, rw_opt_nthreads);
-
-    // check that the number of loops is non-negative
-    rw_fatal (-1 < rw_opt_nloops, 0, 0,
-              "number of loops must be non-negative, got %d",
-              rw_opt_nloops);
-
     // exercise atomic subtract
     run_test ((char)0, thr_args_base::Char, -1);
     run_test ((signed char)0, thr_args_base::SChar, -1);
@@ -376,8 +366,8 @@
     return rw_test (argc, argv, __FILE__,
                     0 /* no clause */,
                     0 /* no comment */, run_test,
-                    "|-nloops# "
-                    "|-nthreads#",
+                    "|-nloops#0 "        // must be non-negative
+                    "|-nthreads#0-32",   // must be between 0 and 32
                     &rw_opt_nloops,
                     &rw_opt_nthreads);
 }

Modified: incubator/stdcxx/trunk/tests/support/atomic_xchg.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/support/atomic_xchg.cpp?rev=357563&r1=357562&r2=357563&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/support/atomic_xchg.cpp (original)
+++ incubator/stdcxx/trunk/tests/support/atomic_xchg.cpp Sun Dec 18 15:43:31 2005
@@ -316,16 +316,6 @@
 static int
 run_test (int, char**)
 {
-    // check that the number of threads is valid
-    rw_fatal (-1 < rw_opt_nthreads && rw_opt_nthreads < MAX_THREADS, 0, 0,
-              "number of threads must be in the range [0, %d), got %d",
-              MAX_THREADS, rw_opt_nthreads);
-
-    // check that the number of loops is non-negative
-    rw_fatal (-1 < rw_opt_nloops, 0, 0,
-              "number of loops must be non-negative, got %d",
-              rw_opt_nloops);
-
     // exercise atomic exchange
     run_test ((char)0, thr_args_base::Char);
     run_test ((signed char)0, thr_args_base::SChar);
@@ -358,8 +348,8 @@
     return rw_test (argc, argv, __FILE__,
                     0 /* no clause */,
                     0 /* no comment */, run_test,
-                    "|-nloops# "
-                    "|-nthreads#",
+                    "|-nloops#0 "        // must be non-negative
+                    "|-nthreads#0-32",   // must be between 0 and 32
                     &rw_opt_nloops,
                     &rw_opt_nthreads);
 }



Mime
View raw message