mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-21 07:33:30 +08:00
Test the __fpending function.
This ensures that if there is an error in the definition of the PENDING_OUTPUT_N_BYTES expression, we'll find about it right away; that value is used only in the rare event that close_stdout's fclose fails with EBADF.
This commit is contained in:
parent
a2b300f156
commit
ff13a286c7
24
lib/t-fpending.c
Normal file
24
lib/t-fpending.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* Ensure that __fpending works. */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "__fpending.h"
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (__fpending (stdout) != 0)
|
||||
abort ();
|
||||
|
||||
fputs ("foo", stdout);
|
||||
if (__fpending (stdout) != 3)
|
||||
abort ();
|
||||
|
||||
fflush (stdout);
|
||||
if (__fpending (stdout) != 0)
|
||||
abort ();
|
||||
|
||||
exit (0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user