stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: MyStreambuf class is incomplete
Date Thu, 19 Jul 2007 15:39:25 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [] On Behalf Of Martin Sebor
>> Sent: Wednesday, July 18, 2007 7:16 AM
>> To:
>> Subject: Re: MyStreambuf class is incomplete
>> Farid Zaripov wrote:
>>>   The throw_when_ mebmer of the MyStreambuf class 
>> (rw_streambuf.h line
>>> 183) is
>>> not initialized at the moment in class ctor's (only 
>> zero'ed), but used 
>>> in
>>> MyStreambuf::test() (lines 472, 483). I suppose that this class 
>>> designed to initialize throw_when_ within test functions. 
>> But for now 
>>> the all iostream tests doesn't do it.
>>> Maybe we just remove this mebmer at all? The patch is ready :)
>> I'm not dead set against removing it but if it ain't broke...?
>> Is it actually causing problems or are you just cleaning things up?
>   It causing problems because the tests are uses fail_when parameter to
> set when
> MyStreambuf should to throw, but MyStreambuf throws only if throw_when_
> [inx] == callno.
> So we should to apply my patch (remove throw_when_ and throw when
> fail_when_ == callno,
> or modify all tests to set throw_when_[] array.

I think I remember now. IIRC, the intent behind the throw_when_ array
is to make it possible to induce exceptions only from specific functions
without accidentally making some other function called from the first
throw instead. The purpose of the fail_when member is to make the tested
function fail after that many calls. So I think we need to keep the
array and fix the tests, otherwise we might cause failures because of
exceptions being thrown by the wrong functions. Don't you think?


View raw message