<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 22, 2024 at 4:15 PM Florian Weimer <<a href="mailto:fweimer@redhat.com">fweimer@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Frédéric Bérat:<br>
<br>
> + TEST_VERIFY_EXIT (fstat (files[to_check].fd, &stats) >= 0);<br>
> + TEST_VERIFY_EXIT (stats.st_size == 3);<br>
<br>
I think we should add one more test here:<br>
<br>
TEST_COMPARE (lseek (files[to_check].fd, 0, SEEK_CUR), 3);<br>
<br>
Is there a reason why you do not test the behavior on read-only and<br>
read-write streams? Even for read-only streams and read-write streams<br>
that are currently reading, there is an observable file position update<br>
on the underlying file description (just like above for streams written<br>
to), and any pending ungetc calls are cancelled.<br></blockquote><div><br></div><div>I actually assumed it was already covered by unget{w}c tests. But I may have been wrong.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I think fflush (NULL) currently does not flush read-only streams at<br>
least, so we do have bugs here.<br></blockquote><div><br></div><div>Ok, I'll have a look.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks,<br>
Florian<br>
<br>
</blockquote></div></div>