Make tests less istreambuf_iterator implementation dependent

Jonathan Wakely jwakely@redhat.com
Thu Sep 28 21:56:00 GMT 2017


On 28/09/17 21:59 +0200, François Dumont wrote:
>On 28/09/2017 14:12, Jonathan Wakely wrote:
>>On 27/09/17 22:16 +0200, François Dumont wrote:
>>>Hi
>>>
>>>    I just committed attached patch as trivial.
>>>
>>>    Those tests were highly istreambuf_iterator implementation, it 
>>>is the result of the call to money_get<>::get which is pointing 
>>>immediately beyond the last character recognized to quote Standard 
>>>words.
>>
>>But according to the standard's specification for istreambuf_iterator
>>it makes no difference, because both iterators point to the same
>>streambuf and share the state.
>>
>>
>Simply adding a:
>
>VERIFY( *ibeg2 == '0' );
>
>before calling money_get<>::get method would have broken the test.
>
>The current istreambuf_iterator implementation capture the current 
>streambuf state each time it is tested for eof or evaluated. This is 
>why I considered those tests as fragile.

Yes, and I think that's non-conforming.

As I said in the other thread, I'd really like to see references to
the standard used to justify any changes to our istreambuf_iterator.




More information about the Gcc-patches mailing list