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: rw_match() bug
Date Wed, 28 Jun 2006 13:44:43 GMT
The char.cpp.diff contains differences to the char.cpp test and vice
versa. Except this the changes looks good, so I started to modify the
rest of the tests.
The results are here (including the diffs to char.cpp and replace test
for the consistence):
http://people.apache.org/~antonp/stdcxx06282006/

I have not modified "find" (find, rfind, find_first_of, etc) tests yet.
 Also the compare test may be left as is.


Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Wednesday, June 28, 2006 05:08
To: stdcxx-dev@incubator.apache.org
Subject: Re: rw_match() bug


Martin Sebor wrote:
[...]
> The only way to make rw_match() safe w/o changing the interface of the

> function is to pass in the actual length of one of the strings as the 
> third argument and encode the length of the other in the string 
> itself.

I implemented the new "directive" and modified the replace test to see
how much work it is. It's not too bad. I had to change a whole bunch of
test cases but it was a simple search and replace. The "hardest" part
was fixing the formatting (the NUL character directive is wider than
simple '\0').

While I did this I decided to generalize the directive to handle Unicode
characters (i.e., <Uxxx...> where xxx is an arbitrarily long sequence of
hex digits denoting the value of a Unicode character; e.g., <U0> is the
same as \0, as are <U00>, <U000>, and <U0000>, etc.). This will come in
handy when testing iostreams and locale (codecvt).

The patches for char.cpp and 21.string.replace.cpp as well as one for
the 0.char.cpp test are attached. I haven't committed anything yet
because it would break all the other tests. If it looks good to you
would you mind starting to change the rest of the string tests according
to replace? You can just post whatever you've got by the end of your day
and I'll pick up where you leave off and commit the whole thing (or, if
you manage to do them all, feel free to commit it yourself).

Thanks
Martin

Mime
View raw message