stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r647225 - /stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp
Date Fri, 11 Apr 2008 17:05:27 GMT
Author: vitek
Date: Fri Apr 11 10:05:18 2008
New Revision: 647225

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

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

	STDCXX-783
	* tests/algorithms/25.random.shuffle.cpp (test_random_shuffle): Move
	rw_assert() into loop to avoid bogus cadvise warning.


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=647225&r1=647224&r2=647225&view=diff
==============================================================================
--- stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp (original)
+++ stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp Fri Apr 11 10:05:18 2008
@@ -306,22 +306,16 @@
         0xfa, 0xbb, 0xdd, 0xa5, 0xa3, 0x73, 0x18, 0xd9
     };
 
-    bool success = true;
-    std::size_t i = 0;
-    for (; i != sizeof array / sizeof *array; ++i) {
-        success = array [i] == result [i];
-        if (!success)
-            break;
+    for (std::size_t i = 0; i != sizeof array / sizeof *array; ++i) {
+        const bool success = array [i] == result [i];
+        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);
+        }
     }
-
-    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