X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=platform%2Fposix%2Ffunctions%2F_PDCLIB%2Frename.c;fp=platform%2Fexample_cygwin%2Ffunctions%2F_PDCLIB%2Frename.c;h=a37eeb3464ed74a22d30a4ee4fbd7280479b1a8c;hp=db38afdfc91898a8fbf445c08403ea1248f8b07c;hb=a38d56a6a13dbb89022b5448d2d5247f3f99ea41;hpb=81f4c957d2f820d9340d90d5b650cbbed054caa0 diff --git a/platform/example_cygwin/functions/_PDCLIB/rename.c b/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 db38afd..a37eeb3 100644 --- a/platform/example_cygwin/functions/_PDCLIB/rename.c +++ b/platform/posix/functions/_PDCLIB/rename.c @@ -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' );