stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: Tests for lib.string::find methods
Date Tue, 02 May 2006 15:25:17 GMT
I committed the changes with the style change you have suggested.

Martin Sebor wrote:
> If the get_calls() helper is only being used in one test I'd be
inclined to leave it where it is. If and when we start using it in other
> tests we should probably move it to the common header as you suggest.

The get_calls will be used in test for append, assign, insert, replace
and all find methods tests. So I suggest to move it to rw_char.h.
The modified tests (append, assign, insert, replace, operator +=) and
this change are here:
http://people.apache.org/~antonp/stdcxx05022006a/

The change log:

2006-05-02  Anton Pevtsov  <antonp@moscow.vdiweb.com>

	* rw_char.h (get_calls): New functions to retrieve 
	the pointer to n_calls array if it is defined for traits type.
	* 21.string.append.cpp (get_calls): Moved to rw_char.h
	* 21.string.assign.cpp (test_assign): Added verification
	that Traits::length() is used.
	* 21.string.insert.cpp: Same
	* 21.string.op.plus.equal.cpp: Same
	* 21.string.replace.cpp: Same


Are these changes ok to commit?

I tried to add the same code to find methods to verify that
Traits::length() and Traits::eq() are used. 
And I found that find method uses Traits::compare() instead of
Traits::eq(). Is this correct?


Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Tuesday, May 02, 2006 04:30
To: stdcxx-dev@incubator.apache.org
Subject: Re: Tests for lib.string::find methods


Anton Pevtsov wrote:
> OK, I removed the nres member and renamed res_len to nres. Here is new

> version: http://people.apache.org/~antonp/stdcxx04282006/

Great! Looks good!

One minor request regarding formatting for readability. In declarations
of the test case arrays I find the following
style:

     static const TestCase
     ptr_test_cases[] = {
         ...
     };

more legible than this one:

     static const TestCase ptr_test_cases[] = {
         ...
     };

If you agree, could you please adopt that style?

> 
> 
> 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? 

If the get_calls() helper is only being used in one test I'd be inclined
to leave it where it is. If and when we start using it in other tests we
should probably move it to the common header as you suggest.

[...]
> May I commit these changes and add new tests to svn?

With the formatting change (and assuming you agree with the style
change), okay to commit. Please commit the new tests separately from
changes to any existing files.

Thanks
Martin

Mime
View raw message