Ok, trying again

Jakob Eriksson jakov at vmlinux.org
Mon Nov 1 10:24:41 CST 2004


*src/wine/dlls/msvcrt/tests


*
jakov at toto:~/src/wine/dlls/msvcrt/tests$ cvs diff -u file.c
Index: file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/tests/file.c,v
retrieving revision 1.10
diff -u -r1.10 file.c
--- file.c      3 Sep 2004 01:05:30 -0000       1.10
+++ file.c      1 Nov 2004 16:24:06 -0000
@@ -306,7 +306,25 @@
   ok(res[strlen(res)-1] != '.', "second call - last character is a dot\n");
 }

+static void test_access( void )
+{
+    FILE *fp;
+
+    const char filename[] = "tmpfile.tst";
+    ok(-1 == _access(filename, 0), "This file should not exist yet.\n");
+    ok(ENOENT == errno, "and errno should be ENOENT but it is %d.\n", 
errno);
+
+    fp = fopen(filename, "w");
+    if (NULL == fp) return;
+    fclose(fp);

+    ok(0 == _access(filename, 0), "Now the file should exist.\n");
+    ok(0 == _access(filename, 2), "We should have write permission, 
after all I created it. errno=%d\n", errno);
+    ok(0 == _access(filename, 4), "We should have read permission. 
errno=%d\n", errno);
+    ok(0 == _access(filename, 6), "We should also be able to check for 
read and write permission. errno=%d\n", errno);
+
+    _unlink(filename);
+}

 START_TEST(file)
 {
@@ -321,6 +339,7 @@
         return;
     }

+    test_access();
     test_fdopen();
     test_fileops();
     test_fgetwc();




More information about the wine-patches mailing list