1 #include <stdio.h> 2 fdopen_entry(void)3static int fdopen_entry(void) 4 { 5 int stdin_no = fileno(stdin); 6 int stdout_no = fileno(stdout); 7 int stderr_no = fileno(stderr); 8 9 if((stdin_no == 0) && (stdout_no == 1) && (stderr_no == 2)) 10 { 11 return 0; 12 } 13 return -1; 14 } 15 16 #include <utest.h> test_fdopen(void)17static void test_fdopen(void) 18 { 19 uassert_int_equal(fdopen_entry(), 0); 20 } testcase(void)21static void testcase(void) 22 { 23 UTEST_UNIT_RUN(test_fdopen); 24 } 25 UTEST_TC_EXPORT(testcase, "posix.stdio_h.fileno.c", RT_NULL, RT_NULL, 10); 26 27