stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Pevtsov <ant...@moscow.vdiweb.com>
Subject test for 21.string::replace
Date Thu, 16 Mar 2006 16:34:56 GMT
The attached file contains new version of the test for string::replace.
You might want to add tests cases to be sure that the test covers all
possible cases.

And there are two issues with this test:

1. It contains workaround for empty strings with UserChars formatting
output.
The cause is in the implementation of the %{#*S} directive: it tries to
cast basic_string<UserChar, ... > to string<char, ...> then gets
incorrect string size and finally fails. As a stub it is possible to
ignore "unknown" strings, but some callback for this case will be more
useful. What do you think about it?

2. There is no test case which results in the length_error exception
thrown by replace. The possible way to test this case requires the huge
string with length about SIZE_MAX / 2 and I think this not good idea. I
think we can try to use our own "string" class with modified size()
method to emulate this case, but will this be the appropriate test?


With best wishes,
Anton Pevtsov


Mime
View raw message