Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 70588 invoked from network); 19 May 2006 15:13:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 May 2006 15:13:29 -0000 Received: (qmail 45074 invoked by uid 500); 19 May 2006 15:13:29 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 45052 invoked by uid 500); 19 May 2006 15:13:29 -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 45041 invoked by uid 99); 19 May 2006 15:13:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2006 08:13:29 -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; Fri, 19 May 2006 08:13:28 -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: svn commit: r407684 - /incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp Date: Fri, 19 May 2006 19:13:06 +0400 Message-ID: <4D6A8407B7AC6F4D95B0E55C4E7C4C62043B0ADC@exmsk.moscow.vdiweb.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: svn commit: r407684 - /incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp Thread-Index: AcZ66C/7VnYOaeAxSwu2sXm0pFd2DwAWbA/w 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: > Anton, the most important bit here enables the exception safety tests for all test cases (except those that test other exceptions such as > out_of_range). I'd like to do the same in the rest of > the tests as well. I see, thanks. I made few changes to force it working on Windows without asserts.=20 Also I suggest to add new helper functions template bool isUserAlloc (charT, UserAlloc*) { return true; } template bool isUserAlloc (charT, std::allocator*) { return false; } to the rw_allocator.h. The diff files are here: http://people.apache.org/~antonp/stdcxx05192006/ Also I updated several tests using the replace test as the example, they are there too. Martin Sebor wrote: > I'm also thinking about exercising length_error in a similar way as bad_alloc with UserAlloc, i.e., inducing the error by setting > max_size() to a value less than the expected size of the result string and then setting it to a greater value and letting the function succeed. Sounds good. This allows us to avoid the tricky code, but how about the exercising of the length_error for std::string and std::wstring ? Thanks, Anton Pevtsov -----Original Message----- From: Martin Sebor [mailto:sebor@roguewave.com]=20 Sent: Friday, May 19, 2006 06:02 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r407684 - /incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp sebor@apache.org wrote: > Author: sebor > Date: Thu May 18 18:41:46 2006 > New Revision: 407684 Anton, the most important bit here enables the exception safety tests for all test cases (except those that test other exceptions such as out_of_range). I'd like to do the same in the rest of the tests as well. The SharedAlloc bits don't do anything yet, but they're a start. I'm also thinking about exercising length_error in a similar way as bad_alloc with UserAlloc, i.e., inducing the error by setting max_size() to a value less than the expected size of the result string and then setting it to a greater value and letting the function succeed. Let me know your thoughts! Martin >=20 > URL: http://svn.apache.org/viewvc?rev=3D407684&view=3Drev > Log: > 2006-05-18 Martin Sebor >=20 > * 21.string.replace.cpp (test cases): Changed the meaning of > (tcase.bthrow =3D=3D 0) to enable the testing of exception safety, > and used -1 to disable. > (Test, MemFun): Removed unused typedefs. > (test_replace): Renamed throw_after to throw_count to better > reflect the purpose of the variable. > Simplified the conditional computing the expected exception. > Set UserAlloc::allocate() to throw bad_alloc analogously to > operator new. > Exercised exception safety in each test case by default (i.e., > when tcase.bthrow =3D=3D 0).