incubator-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: Re: test for 21.string.copy
Date Mon, 27 Mar 2006 15:20:03 GMT
The attached file contains the test updated according to your notes.

Martin Sebor's wrote:

> <>> Second, in the test function, I would like to use rw_match() instead

> <>of Traits::compare() to verify that the contents of the buffer match the
> expected result. This will let us avoid widening the expected
> result and enable us to display the offset of the first mismatched
> character (if any) in the rw_assert() diagnostic message.

Ok, but I have a note: rw_match compares symbols only, so it is possible
that two UserChar's with different .f and equal .c parts will be interpreted
as equal. Currently this affects nothing, but it might become a problem.<>

Martin Sebor's wrote:

> <>> Oh, and one minor nit :) If you could move the indented #ifndef

> <>reprocessor directives to the left margin that would be great :)
> I am not sure that I understand what exact did you mean under the "left
> margin" here - 0 or 4 spaces left?


Thanks,
Anton Pevtsov

> <>-----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Sunday, March 26, 2006 01:48
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: test for 21.string.copy
>
>
> Anton Pevtsov wrote:

>> The latest version of the test is attached. I plan to commit it to the
>  
>

>> svn, ok?
>  
>

Actually, there are a few more simplifying improvements that I think we
still ought to make. First, we can use the third argument to copy
(pos) to distinguish between the two overloads. When pos is negative
(say, -1) the two argument overload will be invoked. Otherwise, the test
function will invoke the three-argument overload. That will allow us to
eliminate the (redunant) function tag CTag.

Second, in the test function, I would like to use rw_match() instead of
Traits::compare() to verify that the contents of the buffer match the
expected result. This will let us avoid widening the expected result and
enable us to display the offset of the first mismatched character (if
any) in the rw_assert() diagnostic message.

Lastly, in the test_cases array, I think the order of data should match
the order of function arguments (i.e., controlled sequence, n, the
second argument to copy, and pos, the third argument which should be -1
for the test cases exercising the two-argument overload of the member
function).

Oh, and one minor nit  :)  If you could move the indented #ifndef
reprocessor directives to the left margin that would be great  :) 

Thanks!
Martin


Mime
View raw message