From: solar Date: Wed, 14 Jun 2006 05:10:07 +0000 (+0000) Subject: Testdriver fixes. X-Git-Tag: v0.5~160 X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=3437cc901226c8af121a5a126ee6d5295dc835c7 Testdriver fixes. --- diff --git a/functions/stdio/fclose.c b/functions/stdio/fclose.c index f633de3..9ddff44 100644 --- a/functions/stdio/fclose.c +++ b/functions/stdio/fclose.c @@ -51,7 +51,6 @@ int fclose( struct _PDCLIB_file_t * stream ) int main( void ) { #ifndef REGTEST - /* FIXME: This is basically fopen() checking. Flushing and buffer-freeing is not checked. */ struct _PDCLIB_file_t * file1; struct _PDCLIB_file_t * file2; TESTCASE( _PDCLIB_filelist == NULL ); @@ -66,7 +65,7 @@ int main( void ) TESTCASE( fclose( file1 ) == 0 ); TESTCASE( _PDCLIB_filelist == file2 ); TESTCASE( fclose( file2 ) == 0 ); - TESTCASE( _PDCLIB_filelist == NULL ); /* FIXME: fails */ + TESTCASE( _PDCLIB_filelist == NULL ); system( "rm testfile1 testfile2" ); #else puts( " NOTEST fclose() test driver is PDCLib-specific." ); diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 9a01fe3..4a74e17 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -82,6 +82,7 @@ struct _PDCLIB_file_t * fopen( const char * _PDCLIB_restrict filename, const cha _PDCLIB_filelist = rc; /* Setting buffer, and mark as internal. TODO: Check for unbuffered? */ if ( ( rc->buffer = malloc( BUFSIZ ) ) == NULL ) goto fail; + rc->bufsize = BUFSIZ; rc->status |= ( _PDCLIB_LIBBUFFER | _PDCLIB_VIRGINSTR ); /* TODO: Setting mbstate */ return rc;