stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: Tests for lib.string::find methods
Date Wed, 03 May 2006 01:15:07 GMT
Anton Pevtsov wrote:
> 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:

Okay, in that case moving to the common header sounds like a most
reasonable plan :) We do need to rename the function according to
the naming convention, though, and perhaps even make the name more
descriptive (and less general). How does something like
rw_get_call_counters() sound?

> Are these changes ok to commit?

Yes, with the naming change.

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

I don't think it's incorrect since compare() must be implemented
as if by calling eq(), although the standard should probably not
mandate one or the other. The way it's done in our implementation,
however, is probably going to be extremely inefficient. There are
much better algorithms than this naive method. We need an issue
for the efficiency side of things at the very least (I suspect
the efficient algorithm will end up using eq() directly).


View raw message