]> pd.if.org Git - pdclib.old/blobdiff - platform/posix/functions/_PDCLIB/rename.c
* platform/example is now a "stub" platform - it should compile anywhere, but
[pdclib.old] / platform / posix / functions / _PDCLIB / rename.c
similarity index 95%
rename from platform/example_cygwin/functions/_PDCLIB/rename.c
rename to platform/posix/functions/_PDCLIB/rename.c
index db38afdfc91898a8fbf445c08403ea1248f8b07c..a37eeb3464ed74a22d30a4ee4fbd7280479b1a8c 100644 (file)
@@ -111,12 +111,14 @@ int main( void )
     TESTCASE( fputc( 'x', file ) == 'x' );
     TESTCASE( fclose( file ) == 0 );
     /* check that file 1 exists */
-    TESTCASE( fopen( testfile1, "r" ) != NULL );
+    TESTCASE( ( file = fopen( testfile1, "r" ) ) != NULL );
+    TESTCASE( fclose( file ) == 0 );
     /* rename file 1 to file 2 */
     TESTCASE( _PDCLIB_rename( testfile1, testfile2 ) == 0 );
     /* check that file 2 exists, file 1 does not */
     TESTCASE( fopen( testfile1, "r" ) == NULL );
-    TESTCASE( fopen( testfile2, "r" ) != NULL );
+    TESTCASE( ( file = fopen( testfile2, "r" ) ) != NULL );
+    TESTCASE( fclose( file ) == 0 );
     /* create another file 1 */
     TESTCASE( ( file = fopen( testfile1, "w" ) ) != NULL );
     TESTCASE( fputc( 'x', file ) == 'x' );