X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Frename.c;h=3f9152dca7a5d2fb07f1eaa0b558910f040ceb2e;hp=f3ff01ee604a44ba46fc65c4802d8c17ef22ba9a;hb=393020b6e48719d27699dea6b29e53025bbd5123;hpb=f408c1fd633015089d2a0fc6bc31c9f61eeae0a9 diff --git a/functions/stdio/rename.c b/functions/stdio/rename.c index f3ff01e..3f9152d 100644 --- a/functions/stdio/rename.c +++ b/functions/stdio/rename.c @@ -20,8 +20,6 @@ int rename( const char * old, const char * new ) #endif #ifdef TEST -/* TODO: Work around the following undef */ -#undef SEEK_SET #include <_PDCLIB_test.h> #include @@ -31,7 +29,9 @@ int main( void ) /* TODO: Extend to internal testing (buffer etc.) */ char filename1[] = "touch testfile1"; char filename2[] = "testfile2"; - /* check that neither file exists */ + remove( filename1 + 6 ); + remove( filename2 ); + /* make sure that neither file exists */ TESTCASE( fopen( filename1 + 6, "r" ) == NULL ); TESTCASE( fopen( filename2, "r" ) == NULL ); /* rename file 1 to file 2 - expected to fail */ @@ -68,3 +68,4 @@ int main( void ) } #endif +