]> pd.if.org Git - pdclib/commitdiff
Testdriver fixes.
authorsolar <unknown>
Wed, 14 Jun 2006 05:10:07 +0000 (05:10 +0000)
committersolar <unknown>
Wed, 14 Jun 2006 05:10:07 +0000 (05:10 +0000)
functions/stdio/fclose.c
functions/stdio/fopen.c

index f633de3e8cf1364cf7583dfa52e635e600fe4d58..9ddff44de929f52442d3cdc3a967954fcd0373ca 100644 (file)
@@ -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." );
index 9a01fe3debc8f225a5bdd1244ba85814355589f1..4a74e1776ddcc74973e2fb4981d555c19cbd4fa8 100644 (file)
@@ -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;