[Patch] Tweak unbuffered overflow, provide unbuffered seek testcases
Paolo Carlini
pcarlini@unitus.it
Wed Jun 11 21:28:00 GMT 2003
Hi,
you will find attached the seekoff/pos testcases split into
buffered/unbuffered (and very slightly enlarged).
Unfortunately seekpos testing revealed that unbuffered
overflow has to be slightly more complicated than we hoped, as
this excerpt from seekpos/char/4-io.cc shows:
c1 = fb_03.snextc(); //current in pointer +1
VERIFY( c1 == 't' );
c2 = fb_03.sputc('\n'); //test current out pointer
Before actually doing unbuffered sputc (overflow, that is), we
must rewind -1, since the last underflow (upon snextc) led to
a file descriptor one position after 't'. Note that the
same rewind action is needed in the buffered case.
A minor nit: a new unbuffered sputbackc of a couple of days ago
(which I erroneously tweaked from the buffered version) had to
be also patched to the correct version.
Tested x86-linux.
Ok with everyone?
Paolo.
P.S. I have not even attempted a major rewrote of overflow trying to
unify the buffered and unbuffered cases: this way I don't risk to
broke the much more important buffered case ;) Perhaps later...
//////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_seek_over
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030611/910f154d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_seek_over
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030611/910f154d/attachment-0001.ksh>
More information about the Libstdc++
mailing list