Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 61076 invoked from network); 11 Apr 2008 17:05:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2008 17:05:50 -0000 Received: (qmail 84121 invoked by uid 500); 11 Apr 2008 17:05:51 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 84102 invoked by uid 500); 11 Apr 2008 17:05:51 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 84093 invoked by uid 99); 11 Apr 2008 17:05:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 10:05:51 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 17:05:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E47FC1A9832; Fri, 11 Apr 2008 10:05:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r647225 - /stdcxx/trunk/tests/algorithms/25.random.shuffle.cpp Date: Fri, 11 Apr 2008 17:05:27 -0000 To: commits@stdcxx.apache.org From: vitek@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080411170527.E47FC1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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,