stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r489800 - /incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp
Date Fri, 22 Dec 2006 23:34:07 GMT
Author: sebor
Date: Fri Dec 22 15:34:06 2006
New Revision: 489800

URL: http://svn.apache.org/viewvc?view=rev&rev=489800
Log:
2006-12-22  Martin Sebor  <sebor@roguewave.com>

	* 26.class.gslice.cpp (make_array): Corrected an off-by-1 error.
	(test_gslice): Exercised gslice copy ctor.

Modified:
    incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp

Modified: incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp?view=diff&rev=489800&r1=489799&r2=489800
==============================================================================
--- incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp (original)
+++ incubator/stdcxx/trunk/tests/numerics/26.class.gslice.cpp Fri Dec 22 15:34:06 2006
@@ -50,7 +50,7 @@
         buf [i] = std::size_t (val);
 
         if ('\0' == *end)
-            return std::valarray<std::size_t>(buf, i);
+            return std::valarray<std::size_t>(buf, i + 1);
 
         s = end + 1;
     }
@@ -84,7 +84,7 @@
 
     const std::size_t ndims = asizes.size ();
 
-    std::size_t inx = asizes.size ();
+    std::size_t inx = ndims;
 
     if (0 == factors.size ()) {
         factors.resize (ndims);
@@ -160,11 +160,13 @@
     for (std::size_t i = 0; i != va.size (); ++i)
         va [i] = i;
 
-    for (int i = 0; i != 2; ++i) {
-        // repeat each test twice to verify that operator[](gslice)
-        // doesn't change the observable state of its argument
+    for (int i = 0; i != 3; ++i) {
+        // repeat each test three to verify that operator[](gslice)
+        // doesn't change the observable state of its argument and
+        // that the same result is obtained for a copy of gslice
 
-        const std::valarray<std::size_t> array_slice = va [gsl];
+        const std::valarray<std::size_t> array_slice =
+            i < 2 ? va [gsl] : va [std::gslice (gsl)];
 
         bool equal = array_slice.size () == indices.size ();
 



Mime
View raw message