This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]