This is the mail archive of the
mailing list for the libstdc++ project.
Re: Make tests less istreambuf_iterator implementation dependent
- From: François Dumont <frs dot dumont at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Sep 2017 21:59:44 +0200
- Subject: Re: Make tests less istreambuf_iterator implementation dependent
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <20170928121213.GM4582@redhat.com>
On 28/09/2017 14:12, Jonathan Wakely wrote:
On 27/09/17 22:16 +0200, François Dumont wrote:
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
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.