Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 64984 invoked from network); 10 Mar 2006 15:23:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Mar 2006 15:23:18 -0000 Received: (qmail 5475 invoked by uid 500); 10 Mar 2006 15:22:49 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 5457 invoked by uid 500); 10 Mar 2006 15:22:49 -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 5446 invoked by uid 99); 10 Mar 2006 15:22:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2006 07:22:49 -0800 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, 10 Mar 2006 07:22:47 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: test for 21.strings.capacity Date: Fri, 10 Mar 2006 18:22:23 +0300 Message-ID: <4D6A8407B7AC6F4D95B0E55C4E7C4C6203D3DF93@exmsk.moscow.vdiweb.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: test for 21.strings.capacity Thread-Index: AcZD7F1N958SzaT2SnO78GdinowFsAAQRHpg 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 The linker error disappears, thanks! But, unfortunately, the problems with UserTraits members occurred: 1) char.cpp, line 132, the copy() member function: ... for (size_t i =3D 0; i !=3D n; dst [i] =3D src [i]); ... This is the endless loop. I think it should be changed to something like this: ... for (size_t i =3D 0; i !=3D n; dst [i] =3D src [i++]); ... 2) char.cpp, line 146, the move() member function: ... for (; n--; dst [n] =3D src [n]); ... This code doesn't work properly. E.g. move when dst =3D "abc", src =3D "bc", n =3D 2, dst and src points to the same = string, results in "cc", but "bc" is expected. I use the following code instead: ... if (dst < src) { while (n--) *dst++ =3D *src++; } else { for (dst +=3D n, src +=3D n; n--; ) *--dst =3D *--src; } ... Thanks, Anton Pevtsov -----Original Message----- From: Martin Sebor [mailto:sebor@roguewave.com]=20 Sent: Friday, March 10, 2006 05:47 To: stdcxx-dev@incubator.apache.org Subject: Re: test for 21.strings.capacity Martin Sebor wrote: > Anton Pevtsov wrote: >=20 >> I add the UserChar case into the test for 21.strings.capacity and=20 >> finally got the following linker error: >> > [...] >=20 >> >> What do you think about this? >=20 >=20 > Looks like I forgot to define the function (or rather move its=20 > definition from rw_char.h to char.cpp in rev 384082:=20 > http://svn.apache.org/viewcvs.cgi?rev=3D384082&view=3Drev). Let me fix = it. > Sorry again. I believe I fixed this and the other problem with UserTraits in the following commit: http://svn.apache.org/viewcvs?rev=3D384635&view=3Drev I also made some enhancements to the UserTraits class here: http://svn.apache.org/viewcvs?rev=3D384680&view=3Drev Most notable is the counting of calls to member functions to allow our tests to verify that they are called as required. I started writing a test for the class but I'm not done with it yet. The test already revealed a couple of issues with some of the members that I fixed but it's possible that some still remain. I'll be OOTO tomorrow so if you run into any problems I'll fix them over the weekend. Martin