X-Git-Url: https://git.gag.com/?p=fw%2Fpdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fftell.c;h=892c7b282b043f373da705166936886b81d52a13;hp=09dd17fe189113739befd74e293b4229b57b8738;hb=f2c41eedc0c43f9ea65c8e0fac0b642cb7a74b68;hpb=a8f367a73f490043c0f0ac21a444d9f251f3e8cc diff --git a/functions/stdio/ftell.c b/functions/stdio/ftell.c index 09dd17f..892c7b2 100644 --- a/functions/stdio/ftell.c +++ b/functions/stdio/ftell.c @@ -48,8 +48,7 @@ int main( void ) */ char * buffer = (char*)malloc( 4 ); FILE * fh; - remove( testfile ); - TESTCASE( ( fh = fopen( testfile, "w+" ) ) != NULL ); + TESTCASE( ( fh = tmpfile() ) != NULL ); TESTCASE( setvbuf( fh, buffer, _IOLBF, 4 ) == 0 ); TESTCASE( fputc( '1', fh ) == '1' ); TESTCASE( fputc( '2', fh ) == '2' ); @@ -75,9 +74,8 @@ int main( void ) TESTCASE_NOREG( fh->bufidx == 0 ); /* Reading back first character after rewind for basic read check */ TESTCASE( fgetc( fh ) == '1' ); - TESTCASE( fclose( fh ) == 0 ); /* TODO: t.b.c. */ - remove( testfile ); + TESTCASE( fclose( fh ) == 0 ); return TEST_RESULTS; }