kernel file test refinements

Ferenc Wagner wferi at afavant.elte.hu
Fri Oct 17 14:22:58 CDT 2003


Account for unique NT4 behaviour.
Better error message.

Index: file.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/file.c,v
retrieving revision 1.23
diff -u -r1.23 file.c
--- file.c	25 Sep 2003 20:29:41 -0000	1.23
+++ file.c	17 Oct 2003 19:19:27 -0000
@@ -195,6 +195,7 @@
     char buffer[10000];
     WIN32_FIND_DATAA search_results;
     char slashname[] = "testfi/";
+    int err;
     HANDLE find;
 
     filehandle = _lcreat( filename, 0 );
@@ -262,12 +263,11 @@
     ok( DeleteFileA( filename ) != 0, "DeleteFile failed (%ld)", GetLastError(  ) );
 
     filehandle=_lcreat (slashname, 0); /* illegal name */
-    if (HFILE_ERROR != filehandle || (GetLastError() != ERROR_INVALID_NAME && GetLastError() != ERROR_PATH_NOT_FOUND))
-    {
-      todo_wine {
-        ok (0, "creating file \"%s\" should fail with error 123 or 3, (err=%ld)", slashname, GetLastError ());
-      }
-
+    if (HFILE_ERROR==filehandle) {
+      err=GetLastError ();
+      ok (err==ERROR_INVALID_NAME || err==ERROR_PATH_NOT_FOUND,
+          "creating file \"%s\" failed with error %ld", slashname, err);
+    } else { /* only NT succeeds */
       _lclose(filehandle);
       find=FindFirstFileA (slashname, &search_results);
       if (INVALID_HANDLE_VALUE==find)
@@ -906,7 +906,7 @@
     err = GetLastError();
     ok ( handle == INVALID_HANDLE_VALUE , "FindFirstFile on Root directory should Fail");
     if (handle == INVALID_HANDLE_VALUE)
-      ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number\n");
+      ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err);
     handle = FindFirstFileA("C:\\*",&search_results);
     ok ( handle != INVALID_HANDLE_VALUE, "FindFirstFile on C:\\* should succeed" );
     ok ( FindClose(handle) == TRUE, "Failed to close handle");



More information about the wine-patches mailing list