From stdcxx-dev-return-1244-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Fri Apr 28 15:11:42 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 22144 invoked from network); 28 Apr 2006 15:11:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Apr 2006 15:11:42 -0000 Received: (qmail 67434 invoked by uid 500); 28 Apr 2006 15:11:41 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 67418 invoked by uid 500); 28 Apr 2006 15:11:41 -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 67403 invoked by uid 99); 28 Apr 2006 15:11:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Apr 2006 08:11:40 -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, 28 Apr 2006 08:11:39 -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 lib.string::find methods Date: Fri, 28 Apr 2006 19:11:15 +0400 Message-ID: <4D6A8407B7AC6F4D95B0E55C4E7C4C62041F5345@exmsk.moscow.vdiweb.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Tests for lib.string::find methods Thread-Index: AcZqJ+X1ExztSyiqReGHnF2PKYl3YQAqRuOQ 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 OK, I removed the nres member and renamed res_len to nres. Here is new version: http://people.apache.org/~antonp/stdcxx04282006/ Also I added verification that traits::length() is really used to the append test. I think it will be useful to move get_calls functions to the rw_char.h or provide Another mechanism to retrieve n_calls array or 0, if it is absent in the traits type. What do you think about this?=20 The change log: 2006-04-27 Anton Pevtsov * 21.strings.h (SignatureId): Added missed signatures.=20 (MemberId): Added elements for erase, find, rfind, etc, set start of elements to 1 << 6 because there are more than 32 signatures. (OverloadId): Added elements for find, rfind, etc overloads. (TestCase): res_len member renamed ot nres to be used as the expected result value than an integer is expected. * 21.strings.cpp (_rw_memfun_names): Added names for find, rfind, find_first_of, etc methods.=20 (_rw_setvars): Added missed signatures to the signatures array, added cases for erase method and find methods overloads. (run_test): Added options for new signatures.=20 * 21.string.erase.cpp (MemFun, EraseTags): Removed as=20 obsolete. (void_test_cases, size_test_cases, etc): New arrays of the test cases to exercise erase overloads. (test_erase): Rewrote to use test cases arrays, exception=20 handling updated. (main): Updated to use new test driver features. * 21.string.append.cpp (ptr_test_cases, str_test_cases, etc):=20 signature descriptions updated. (get_calls): New function returning pointer to n_calls array, if it presents in the traits type. (test_append): Removed obsolete declarations, added the traits::length() use verification. * 21.string.assign.cpp (ptr_test_cases, str_test_cases, etc):=20 signature descriptions updated. (test_assign): Removed obsolete declarations. * 21.string.insert.cpp: Same * 21.string.op.plus.eq.cpp: Same * 21.string.replace.cpp: Same May I commit these changes and add new tests to svn? Thanks, Anton Pevtsov -----Original Message----- From: Martin Sebor [mailto:sebor@roguewave.com]=20 Sent: Thursday, April 27, 2006 22:25 To: stdcxx-dev@incubator.apache.org Subject: Re: Tests for lib.string::find methods Anton Pevtsov wrote: > Martin Sebor wrote: >=20 >>I think we should be able to accommodate find without adding the new >=20 > TestCase member, though. Instead we can reuse res_len. Feel free to=20 > rename it to reflect its dual purpose. Hmm. I think it will be=20 > inconvenient. For example, the possible value returned by the compare=20 > method may be any integer, positive or negative. So we will run into=20 > conversions between size_t and int (res_len has type size_t). Will the > code with these conversions be more effective than the code with extra > member in the sructure? I'm not sure what you mean by "effective" but we can certainly change the type of the integer member from size_t to plain old int to handle the special case of compare. It seems like overkill to add a whole new data member (and change all existing tests) just to accommodate a single member function (find returns size_type), especially given our already established policy of dual-purposing members for two functions (e.g., for the offset and iterator members). In summary, unless there are member functions yet to be tested that would necessitate adding this new member (can you think of any?) I don't think the compare argument is compelling enough. Martin >=20 > Updated tests are here:=20 > http://people.apache.org/~antonp/stdcxx04272006/ >=20 > Also there are new updated test : 21.string.erase.cpp and tests for=20 > all find methods. >=20 > In this version I kept nres on its place. >=20 > Martin Sebor wrote: >=20 >>One other request: could you please change all occurrences of charT in >=20 > the comments to read value_type and remove the formal argument? Done. >=20 > The change log: >=20 > 2006-04-27 Anton Pevtsov >=20 > * 21.strings.h (SignatureId): Added missed signatures.=20 > (MemberId): Added elements for erase, find, rfind, etc, > set start of elements to 1 << 6 because there are more than > 32 signatures. > (OverloadId): Added elements for find, rfind, etc overloads. > (TestCase): Added nres member to keep expected results > than an integer value is expected. > * 21.strings.cpp (_rw_memfun_names): Added names for > find, rfind, find_first_of, etc methods.=20 > (_rw_setvars): Added missed signatures to the signatures array, > added cases for erase method and find methods overloads. > (run_test): Added options for new signatures.=20 > * 21.string.erase.cpp (MemFun, EraseTags): Removed as=20 > obsolete. > (void_test_cases, size_test_cases, etc): New arrays of the > test cases to exercise erase overloads. > (test_erase): Rewrote to use test cases arrays, exception=20 > handling updated. > (main): Updated to use new test driver features. > * 21.string.append.cpp (ptr_test_cases, str_test_cases, etc):=20 > Added default value for new TestCase member nres, set to -1=20 > for all test case arrays, signature descriptions updated. > (test_append): Removed obsolete declaration > * 21.string.assign.cpp: Same > * 21.string.insert.cpp: Same > * 21.string.op.plus.eq.cpp: Same > * 21.string.replace.cpp: Same >=20 >=20 > Thanks, > Anton Pevtsov >=20 >=20 > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com] > Sent: Wednesday, April 26, 2006 20:22 > To: stdcxx-dev@incubator.apache.org > Subject: Re: Tests for lib.string::find methods >=20 >=20 > Anton Pevtsov wrote: >=20 >>Martin, I updated test for the find method. It required several minor >>changes to 21.strings.cpp and 21.strings.h. The most important - I=20 >>added "int nres" member to the TestCase structure and updated the=20 >>existing tests properly. >> >>The difference files and new test are here: >>http://people.apache.org/~antonp/stdcxx04262006/ >> >>I hope there will be no problems to access them. >=20 >=20 > No problems. The changes look pretty good. I think we should be able=20 > to accommodate find without adding the new TestCase member, though.=20 > Instead we can reuse res_len. Feel free to rename it to reflect its=20 > dual purpose. >=20 > One other request: could you please change all occurrences of charT in > the comments to read value_type and remove the formal argument? >=20 > E.g., change: >=20 > find (const charT* s) >=20 > to >=20 > find (const value_type*) >=20 > With these changes please go ahead and commit. >=20 > [...] >=20 >>And there is small question - does stdcxx support 16-bit >>architectures? >=20 >=20 > It should, even though we're not testing on any at the moment. >=20 >=20 >>If yes we should modify MemberId enum elements to keep them less than >>1 << 16. >=20 >=20 > The underlying type for a C++ emum is required to be wide enough to=20 > fit the largest enumerator regardless of the hardware so this should=20 > not be a concern on conforming implementations. >=20 > Martin