Switched to tmpfile() where appropriate.
[fw/pdclib] / functions / stdio / ftell.c
index 9ca449fe54a155d14bb747f0dca137aac8ede6c5..892c7b282b043f373da705166936886b81d52a13 100644 (file)
@@ -13,7 +13,7 @@
 
 long int ftell( struct _PDCLIB_file_t * stream )
 {
-    /* TODO: A bit too fuzzy in the head now. stream->ungetidx should be in here
+    /* FIXME: A bit too fuzzy in the head now. stream->ungetidx should be in here
              somewhere.
     */
     if ( stream->pos.offset > ( LONG_MAX - stream->bufidx ) )
@@ -44,12 +44,11 @@ int main( void )
     */
     /* The following functions delegate their tests to here:
        fgetc fflush rewind fputc ungetc fseek
-       flushbuffer seek fillbuffer
+       flushbuffer seek fillbuffer prepread prepwrite
     */
     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;
 }