Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 45843 invoked from network); 14 Feb 2006 01:06:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Feb 2006 01:06:33 -0000 Received: (qmail 44382 invoked by uid 500); 14 Feb 2006 01:06:33 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 44369 invoked by uid 500); 14 Feb 2006 01:06:32 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 44357 invoked by uid 99); 14 Feb 2006 01:06:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2006 17:06:32 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [12.17.213.84] (HELO bco-exchange.bco.roguewave.com) (12.17.213.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2006 17:06:32 -0800 Received: from [10.70.3.113] (10.70.3.113 [10.70.3.113]) by bco-exchange.bco.roguewave.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id ZGW28VSY; Mon, 13 Feb 2006 18:06:11 -0700 Message-ID: <43F12DFF.9060401@roguewave.com> Date: Mon, 13 Feb 2006 18:10:23 -0700 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: test for lib.alg.min.max References: <43ECBBE9.5040602@moscow.vdiweb.com> In-Reply-To: <43ECBBE9.5040602@moscow.vdiweb.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Anton Pevtsov wrote: > The attached file contains the tests for the lib.alg.min.max algorithms > (min, max, min_element, max_element). Great, thanks! Here's the commit: http://svn.apache.org/viewcvs.cgi?rev=377556&view=rev A couple of comments below... [...] > template > void test_min_max (int line, > const char a, > const char b, > const T*, > const Predicate *ppred, > bool min) I renamed min to test_min to avoid colliding with the min macro that is sometimes (incorrectly) #defined on Windows. > { > _RWSTD_UNUSED(ppred); This is unnecessary -- ppred is being used. > [...] > rw_assert (exp_res == res.val_ && exp_id == res.origin_, 0, line, > "line %d %s <%s%{?}, %s%{;}> (%#c, %#c) returned " > "value %#c, id %d; expected value %#c, id %d", > __LINE__, fname, tname, ppred, funname, a, b, You need 0 != ppred (or !!ppred) and not just ppred above. ppred is a pointer but the %{?} directive extracts an int from the argument list. On 64-bit platforms where pointers are 64-bits wide and ints are only 32 bits (i.e., all sane platforms), the function would extract only half the argument leaving the other half for the next directive. Martin