stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r646567 - /stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
Date Wed, 09 Apr 2008 22:23:19 GMT
Author: vitek
Date: Wed Apr  9 15:23:18 2008
New Revision: 646567

URL: http://svn.apache.org/viewvc?rev=646567&view=rev
Log:

2008-04-09  Travis Vitek  <vitek@roguewave.com>

	STDCXX-783
	* tests/algorithms/25.random.shuffle.cpp (test_random_shuffle): Avoid
	indexing past the end of arrays when evaluating rw_assert() arguments
	by checking for failure first.


Modified:
    stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp

Modified: stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp?rev=646567&r1=646566&r2=646567&view=diff
==============================================================================
--- stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp (original)
+++ stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp Wed Apr  9 15:23:18 2008
@@ -314,11 +314,14 @@
             break;
     }
 
-    rw_assert (success, 0, line, 
-               "randomly shuffled sequence failed to match "
-               "the expected result (data portability failure) "
-               "%d != %d at %zu",
-               array [i], result [i], i + 1);
+    if (!success) {
+        rw_assert (0, 0, line, 
+                   "randomly shuffled sequence failed to match "
+                   "the expected result (data portability failure) "
+                   "%d != %d at %zu",
+                   array [i], result [i], i + 1);
+    }
+
 
 #else
     rw_note (0, 0, 0,



Mime
View raw message