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  <vi...@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;


Reply via email to