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: svn commit: r418319 - /incubator/stdcxx/trunk/tests/strings/21.string.io.cpp
Date Mon, 03 Jul 2006 15:44:00 GMT
Martin, I have a question about the exceptions thrown from the streambuf
virtual functions. The standard says (27.5.2.4.3 p1) that "underflow or
uflow might fail by throwing exception prematurely" but the exception
type is not specified. Shall we throw something just to verify the
exception safety or shall we throw some specific exception? Also the
exception type looks depending on the streambuf implementation...

Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Saturday, July 01, 2006 05:12
To: stdcxx-dev@incubator.apache.org
Subject: Re: svn commit: r418319 -
/incubator/stdcxx/trunk/tests/strings/21.string.io.cpp


antonp@apache.org wrote:
> Author: antonp
> Date: Fri Jun 30 09:22:31 2006
> New Revision: 418319
> 
> URL: http://svn.apache.org/viewvc?rev=418319&view=rev
> Log:
> 2006-06-30  Anton Pevtsov  <antonp@moscow.vdiweb.com>
> 
> 	STDCXX-4
> 	* 21.string.io.cpp: New test exercising lib.string.io.
> 
> Added:
>     incubator/stdcxx/trunk/tests/strings/21.string.io.cpp   (with
props)

I've been studying the test and made a few very minor tweaks to the test
here: http://svn.apache.org/viewvc?rev=418426&view=rev.

I believe the test needs to be enhanced to exercise exceptions thrown
from the streambuf virtual functions. We should probably do this in a
loop analogously to the other string tests that induce a bad_alloc or
some similar kind of exception during the operation. One tricky thing
with this approach, I suspect, might be getting right the expected
contents of the string argument for the extractors. If it turns out to
be too hard to do an alternative approach would be to specify for each
test case at which point an exception should be thrown and hardcode the
result.

Martin

Mime
View raw message