From stdcxx-dev-return-1404-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Tue May 30 15:10:45 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 48898 invoked from network); 30 May 2006 15:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 May 2006 15:10:45 -0000 Received: (qmail 71541 invoked by uid 500); 30 May 2006 15:10:44 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 71516 invoked by uid 500); 30 May 2006 15:10:44 -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 71505 invoked by uid 99); 30 May 2006 15:10:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 08:10:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of AntonP@moscow.vdiweb.com designates 195.210.189.132 as permitted sender) Received: from [195.210.189.132] (HELO mail.moscow.vdiweb.com) (195.210.189.132) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 08:10:42 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Tests for string non-members - operators Date: Tue, 30 May 2006 19:10:18 +0400 Message-ID: <4D6A8407B7AC6F4D95B0E55C4E7C4C62044B49E2@exmsk.moscow.vdiweb.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Tests for string non-members - operators Thread-Index: AcaA8mJPeRtj8VZfTR6LCVa/mZ057wDCG7uw From: "Anton Pevtsov" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Martin Sebor wrote: > We should exercise long strings of more varying length rather than just 2048 characters (give or take a few).=20 [...] > initial or final length is close to the following values: 128, 207, 334, 540, 873, 1412, 2284, and 3695. I updated several tests and added the test cases containing the strings with special length. The diffs are here: http://people.apache.org/~antonp/stdcxx05302006/ Thanks, Anton Pevtsov -----Original Message----- From: Martin Sebor [mailto:sebor@roguewave.com]=20 Sent: Friday, May 26, 2006 22:30 To: stdcxx-dev@incubator.apache.org Subject: Re: Tests for string non-members - operators Anton Pevtsov wrote: > Martin Sebor wrote: >=20 >>Would you mind terribly merging all the [in]equality and relational >=20 > tests and keep just the one for operator+() separate? >=20 > The merged operators test (21.string.operators) and separate test for > operator+ are here: > http://people.apache.org/~antonp/stdcxx05262006/ Great! Thanks! A few comments/suggestions/requests: The name of the test in the comment at the top of the .cpp file should match the file name, i.e., 25.string.op.plus.cpp. It says 21.string.plus.cpp. We should exercise long strings of more varying length rather than just 2048 characters (give or take a few). The point is to exercise the correctness and exception safety of the reallocation algorithm. Since our string allocates space for at least 128 characters and then each time it needs to increase the capacity it does so by multiplying it by 1.618 (the golden ratio), I suggest adding few more test cases for strings whose either initial or final length is close to the following values: 128, 207, 334, 540, 873, 1412, 2284, and 3695. The curly braces around individual cases in the switch statements are only necessary when declaring a variable. Otherwise they are not needed and should be removed since they are (IMO) detrimental to readability. In the operators test, the comments describing the result say that -1 means less but we use NPOS. Could you change the cases to use -1 (you can cast the value to size_t in the definition of the macro to avoid warnings). With these changes okay to commit. Thanks again. Martin