X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Ffseek.c;h=ab6679bfb7ae590336b16abcb722ecd66971bfc6;hp=d74d55292279cd03f4bdc9a7129d0751b66d9f4a;hb=a7a8d2f1c85c2d7760d4d3479e90466cc3a81b04;hpb=afde3daa4992d49e190a6e8677e7317e0d367c59 diff --git a/functions/stdio/fseek.c b/functions/stdio/fseek.c index d74d552..ab6679b 100644 --- a/functions/stdio/fseek.c +++ b/functions/stdio/fseek.c @@ -38,7 +38,7 @@ int fseek( struct _PDCLIB_file_t * stream, long offset, int whence ) int main( void ) { FILE * fh; - TESTCASE( ( fh = fopen( testfile, "wb+" ) ) != NULL ); + TESTCASE( ( fh = tmpfile() ) != NULL ); TESTCASE( fwrite( teststring, 1, strlen( teststring ), fh ) == strlen( teststring ) ); /* General functionality */ TESTCASE( fseek( fh, -1, SEEK_END ) == 0 ); @@ -79,7 +79,6 @@ int main( void ) TESTCASE( fseek( fh, -5, SEEK_SET ) == -1 ); TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( fclose( fh ) == 0 ); - remove( testfile ); return TEST_RESULTS; }