You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2005/12/01 01:33:10 UTC

Re: questions about the lib.alg.copy test

Anton Pevtsov wrote:
> I am porting the lib.alg.copy test to new test driver and I have a
> couple of questions about it:

Sorry I missed this email...

> 
> 1. Current test version contains calls to to_string function and uses
> the tempstr class. This class is defined in the "test.h" header which
> should not be included into new test versions. Are these function and
> class obsolete or is tere a way to use them in new test versions?

Yes, the to_string() helper function is absent from the new driver.
There is no equivalent for class X, but the best way to handle it,
I think, is along the same lines as in 25.adjacent.find.cpp, i.e.,
use printable characters instead of integers as values for X.val_.
Then we can easily print out the sequence(s) in diagnostics.

http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/tests/algorithms/25.adjacent.find.cpp

> 
> 2. The copy algorithm can work in case when the destination range
> overlaps the source range (of course, first position of the source range
> should not be contained in the destination range). Current version
> doesn't contain special test for this case, but I prefer to have such
> test. What do you think about it?

The requirement in 25.2.1, p3 is that "result shall not be in the
range [first, last)." The algorithm doesn't detect violations of
this requirement but it probably should in debug mode. This would
be a useful enhancement in general. Let me file an enhancement for
it.

Martin

Re: questions about the lib.alg.copy test

Posted by Martin Sebor <se...@roguewave.com>.
Martin Sebor wrote:
> Anton Pevtsov wrote:
[...]
>> 2. The copy algorithm can work in case when the destination range
>> overlaps the source range (of course, first position of the source range
>> should not be contained in the destination range). Current version
>> doesn't contain special test for this case, but I prefer to have such
>> test. What do you think about it?
> 
> 
> The requirement in 25.2.1, p3 is that "result shall not be in the
> range [first, last)." The algorithm doesn't detect violations of
> this requirement but it probably should in debug mode. This would
> be a useful enhancement in general. Let me file an enhancement for
> it.

Here's the issue: http://issues.apache.org/jira/browse/STDCXX-78

Martin