X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fclearerr.c;h=af25029032f1fc4d79ec89654bb4bd690a81592e;hp=810e62d7606d99f79613df9faa97ec520f13819d;hb=6c8c4f80e32177f27f89b4aff3b7568a7afd4041;hpb=33ed95661442997b6fcafae16d9e0ab6871b058a diff --git a/functions/stdio/clearerr.c b/functions/stdio/clearerr.c index 810e62d..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( "testing/testfile" ); - TESTCASE( ( fh = fopen( "testing/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( "testing/testfile" ); return TEST_RESULTS; }