1 #include <stdio.h>
2 
ferror_entry(void)3 static int ferror_entry(void)
4 {
5     int c;
6     putc( 'c', stdin );
7     if( ferror( stdin ) )
8     {
9         clearerr( stdin );
10     }
11     else
12     {
13         return -1;
14     }
15     return 0;
16 }
17 
18 #include <utest.h>
test_ferror(void)19 static void test_ferror(void)
20 {
21     uassert_int_equal(ferror_entry(), 0);
22 }
testcase(void)23 static void testcase(void)
24 {
25     UTEST_UNIT_RUN(test_ferror);
26 }
27 UTEST_TC_EXPORT(testcase, "posix.stdio_h.ferror.c", RT_NULL, RT_NULL, 10);
28 
29