stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1242179 - /stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp
Date Wed, 08 Feb 2012 23:47:31 GMT
Author: vitek
Date: Wed Feb  8 23:47:30 2012
New Revision: 1242179

URL: http://svn.apache.org/viewvc?rev=1242179&view=rev
Log:
2012-02-08  Travis Vitek  <vitek@roguewave.com>

	* test/regress/26.valarray.binary.stdcxx-1061.cpp: Update
	loop condition to avoid stepping past the end of arrays.


Modified:
    stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp

Modified: stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp?rev=1242179&r1=1242178&r2=1242179&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp (original)
+++ stdcxx/branches/4.2.x/tests/regress/26.valarray.binary.stdcxx-1061.cpp Wed Feb  8 23:47:30
2012
@@ -34,10 +34,10 @@ int main ()
 {
     const int a[] = { 0, 1, 0, 3, 0, -5, 0, -7, 0, -11 };
 
-    const std::valarray<int>  v0 (a, sizeof a);
+    const std::valarray<int>  v0 (a, sizeof a / sizeof *a);
     const std::valarray<bool> v1 = std::operator&& (v0, 1);
 
-    for (std::size_t i = 0; i < sizeof a; ++i)
+    for (std::size_t i = 0; i < sizeof a / sizeof *a; ++i)
         assert ((a [i] && 1) == v1 [i]);
     
     return 0;



Mime
View raw message