1 #include <stdio.h> 2 remove_entry(void)3static int remove_entry(void) 4 { 5 FILE *stream; 6 stream = fopen("fopen_file.txt","w"); 7 if(stream) 8 { 9 fclose(stream); 10 remove("fopen_file.txt"); 11 stream = fopen("fopen_file.txt","r"); 12 if(stream) 13 { 14 fclose(stream); 15 return -1; 16 } 17 } 18 else 19 { 20 return -1; 21 } 22 return 0; 23 } 24 25 #include <utest.h> test_remove(void)26static void test_remove(void) 27 { 28 uassert_int_equal(remove_entry(), 0); 29 } testcase(void)30static void testcase(void) 31 { 32 UTEST_UNIT_RUN(test_remove); 33 } 34 UTEST_TC_EXPORT(testcase, "rtt_posix_testcase.stdio_h."__FILE__, RT_NULL, RT_NULL, 10); 35 36