]> pd.if.org Git - pdclib.old/blobdiff - functions/stdio/rename.c
rename: test driver checked for rv == -1 on failure. Standard defines failure as...
[pdclib.old] / functions / stdio / rename.c
index 409005f933776055198186e34713cf6f1ab9bd3f..987b78a5906cb6f1b259468953beac60f2ff126c 100644 (file)
@@ -46,7 +46,7 @@ int main( void )
     TESTCASE( fopen( testfile1, "r" ) == NULL );
     TESTCASE( fopen( testfile2, "r" ) == NULL );
     /* rename file 1 to file 2 - expected to fail */
-    TESTCASE( rename( testfile1, testfile2 ) == -1 );
+    TESTCASE( rename( testfile1, testfile2 ) != 0 );
     /* create file 1 */
     TESTCASE( ( file = fopen( testfile1, "w" ) ) != NULL );
     TESTCASE( fputs( "x", file ) != EOF );
@@ -71,10 +71,10 @@ int main( void )
        _PDCLIB_rename() itself.
     */
     /* NOREG as glibc overwrites existing destination file. */
-    TESTCASE_NOREG( rename( testfile1, testfile2 ) == -1 );
+    TESTCASE_NOREG( rename( testfile1, testfile2 ) != 0 );
     /* remove both files */
-    remove( testfile1 );
-    remove( testfile2 );
+    TESTCASE( remove( testfile1 ) == 0 );
+    TESTCASE( remove( testfile2 ) == 0 );
     /* check that they're gone */
     TESTCASE( fopen( testfile1, "r" ) == NULL );
     TESTCASE( fopen( testfile2, "r" ) == NULL );