X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fposix%2Ffunctions%2F_PDCLIB%2Frename.c;fp=platform%2Fexample_cygwin%2Ffunctions%2F_PDCLIB%2Frename.c;h=a37eeb3464ed74a22d30a4ee4fbd7280479b1a8c;hb=a18343e497615802f47e0f6876b5bed73af674e0;hp=db38afdfc91898a8fbf445c08403ea1248f8b07c;hpb=b76c255d42904c10ce65f884429b4bf2f9b4f4a4;p=pdclib 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' );