X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=functions%2Fstdio%2Fclearerr.c;h=af25029032f1fc4d79ec89654bb4bd690a81592e;hb=f2c41eedc0c43f9ea65c8e0fac0b642cb7a74b68;hp=922f6ab9d239e18cbf5eea9d959d0102c10d9f54;hpb=6859a5344974db8225118d31bea8cbbffa47e540;p=fw%2Fpdclib diff --git a/functions/stdio/clearerr.c b/functions/stdio/clearerr.c index 922f6ab..af25029 100644 --- a/functions/stdio/clearerr.c +++ b/functions/stdio/clearerr.c @@ -23,8 +23,7 @@ void clearerr( struct _PDCLIB_file_t * stream ) int main( void ) { FILE * fh; - remove( "testfile" ); - TESTCASE( ( fh = fopen( "testfile", "w+" ) ) != NULL ); + TESTCASE( ( fh = tmpfile() ) != NULL ); /* Flags should be clear */ TESTCASE( ! ferror( fh ) ); TESTCASE( ! feof( fh ) ); @@ -46,7 +45,6 @@ int main( void ) TESTCASE( ! ferror( fh ) ); TESTCASE( ! feof( fh ) ); TESTCASE( fclose( fh ) == 0 ); - remove( "testfile" ); return TEST_RESULTS; }