[Patch] Fix libstdc++/15002 (continued)

Martin Sebor sebor@roguewave.com
Fri Apr 23 15:58:00 GMT 2004


Pétur Runólfsson wrote:

> Paolo Carlini wrote: 
> 
>>Pétur, do you like the final result?
> 
> 
> Yes :-)
> 
> 
>>Regtesting is OK,
> 
> 
> Hmmm... the existing tests for getline all seem to use stringbuf. This
> means that getline will always go exactly once through the loop, and
> always take the if (...) branch. It's probably a good idea to add a new
> test.

You'll never be able to adequately exercise the functions using
another library component (not to mention that the test results
could be affected by bugs in this other component). The approach
that's worked well for us is to write your own test streambuf.
You can then precisely control the behavior of such a streambuf,
including the sizes of each of the sequences, throwing exceptions
at any point, forcing failures, etc.

Martin



More information about the Libstdc++ mailing list