Author: vitek
Date: Fri Jun  6 14:19:55 2008
New Revision: 664133

URL: http://svn.apache.org/viewvc?rev=664133&view=rev
Log:
2008-06-06  Travis Vitek  <[EMAIL PROTECTED]>

        STDCXX-955
        * tests/regress/26.valarray.sub.stdcxx-955.cpp: Fix copyright date.
        Test both conditions mentioned in original bug to ensure that code
        is completely fixed.

Modified:
    stdcxx/branches/4.2.x/tests/regress/26.valarray.sub.stdcxx-955.cpp

Modified: stdcxx/branches/4.2.x/tests/regress/26.valarray.sub.stdcxx-955.cpp
URL: 
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/26.valarray.sub.stdcxx-955.cpp?rev=664133&r1=664132&r2=664133&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/regress/26.valarray.sub.stdcxx-955.cpp 
(original)
+++ stdcxx/branches/4.2.x/tests/regress/26.valarray.sub.stdcxx-955.cpp Fri Jun  
6 14:19:55 2008
@@ -24,7 +24,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2008 Rogue Wave Software, Inc.
+ * Copyright 2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -32,8 +32,30 @@
 #include <valarray>
 #include <cassert>
 
+void test_0 ()
+{
+    const std::size_t p_leng [] = { 0 };
+    const std::size_t p_strd [] = { 3 };
 
-int main ()
+    const std::valarray<std::size_t>
+        va_leng (p_leng, sizeof (p_leng) / sizeof (*p_leng));
+
+    const std::valarray<std::size_t>
+        va_strd (p_strd, sizeof (p_strd) / sizeof (*p_strd));
+
+    const std::gslice gs_slice (1, va_leng, va_strd);
+
+    std::valarray<char> va_lhs ('!', 4);
+
+    va_lhs [gs_slice] = '?';
+
+    assert (va_lhs [0] == '!');
+    assert (va_lhs [1] == '!');
+    assert (va_lhs [2] == '!');
+    assert (va_lhs [3] == '!');
+}
+
+void test_1 ()
 {
     const std::size_t p_leng [] = { 2, 0 };
     const std::size_t p_strd [] = { 1, 3 };
@@ -54,6 +76,12 @@
     assert (va_lhs [1] == '?');
     assert (va_lhs [2] == '?');
     assert (va_lhs [3] == '!');
+}
+
+int main ()
+{
+    test_0 ();
+    test_1 ();
 
     return 0;
 }


Reply via email to