Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 15647 invoked from network); 9 Jul 2008 23:12:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2008 23:12:32 -0000 Received: (qmail 98448 invoked by uid 500); 9 Jul 2008 23:12:33 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 98424 invoked by uid 500); 9 Jul 2008 23:12:33 -0000 Mailing-List: contact dev-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 dev@stdcxx.apache.org Received: (qmail 98413 invoked by uid 99); 9 Jul 2008 23:12:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 16:12:33 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 23:11:41 +0000 Received: from nebula.bco.roguewave.com ([10.70.3.27]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m69NC2oZ006466 for ; Wed, 9 Jul 2008 23:12:02 GMT Message-ID: <487545C2.5090900@roguewave.com> Date: Wed, 09 Jul 2008 17:12:02 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: svn commit: r675044 - in /stdcxx/branches/4.3.x: include/rw/_tuple.h include/tuple tests/utilities/20.tuple.cnstr.cpp tests/utilities/20.tuple.creation.cpp tests/utilities/20.tuple.h tests/utilities/20.tuple.helpers.cpp References: <20080708231336.C38872388A22@eris.apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Eric Lemings wrote: > [...] > With the following change: > > Index: > /work/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp > > =================================================================== > --- > /work/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp > (revision 675050) > +++ > /work/stdcxx/branches/4.3.x/tests/utilities/20.tuple.cnstr.cpp > (working copy) > @@ -74,18 +73,20 @@ [...] > It appears that pointer values are not guaranteed to be equal when > converting between pointer types. They must be. I see the assertions in the test but the small program below works fine. On an unrelated note, though: While working with the test I found the heavy use of macros and globals quite confusing. It makes it very difficult to find and track the tested values, and virtually impossible to extend with new test cases. The approach I've found to work better is splitting up the test into one or some other small number of worker functions parametrized on all the arguments and expected values and their types (if necessary) and other higher level functions, for example one for each overload of the tested function, with individual test cases and literal values of arguments and expected results. You can find examples of such tests in the tests/localization directory, such as all the 22.locale.{money,num,time}.{get,put}.cpp tests. I suggest you follow this example in the tuple tests as well. Martin #include #include int main () { const char* s = "string"; { std::tuple x (s); const char* const y = std::get<0>(x); assert (y == s); } { std::tuple x (0, s); const char* const y = std::get<1>(x); assert (y == s); } }