The following modifications are needed to make the file tests pass under Windows NT 4.0 SP6. I can not test other versions, please write back if anything is wrong.
Feri.
Index: dlls/kernel/tests/file.c =================================================================== RCS file: /home/wine/wine/dlls/kernel/tests/file.c,v retrieving revision 1.17 diff -u -r1.17 file.c --- dlls/kernel/tests/file.c 19 May 2003 21:50:32 -0000 1.17 +++ dlls/kernel/tests/file.c 25 May 2003 00:02:10 -0000 @@ -521,7 +521,7 @@ ok(ret != 0, "GetTempFileNameA error %ld", GetLastError());
ret = CopyFileA(source, dest, TRUE); - ok(!ret && GetLastError() == ERROR_FILE_EXISTS, + ok(!ret && GetLastError() == ERROR_SUCCESS, "CopyFileA: unexpected error %ld\n", GetLastError());
ret = CopyFileA(source, dest, FALSE); @@ -553,7 +553,7 @@ ok(ret != 0, "GetTempFileNameW error %ld", GetLastError());
ret = CopyFileW(source, dest, TRUE); - ok(!ret && GetLastError() == ERROR_FILE_EXISTS, + ok(!ret && GetLastError() == ERROR_SUCCESS, "CopyFileW: unexpected error %ld\n", GetLastError());
ret = CopyFileW(source, dest, FALSE); @@ -582,8 +582,8 @@
hFile = CreateFileA(filename, GENERIC_READ, 0, NULL, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); - ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS, - "CREATE_NEW should fail if file exists and last error value should be ERROR_FILE_EXISTS"); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SUCCESS, + "CREATE_NEW should fail if file exists and last error value should be ERROR_SUCCESS");
ret = DeleteFileA(filename); ok(ret, "DeleteFileA: error %ld\n", GetLastError()); @@ -608,8 +608,8 @@
hFile = CreateFileW(filename, GENERIC_READ, 0, NULL, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); - ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS, - "CREATE_NEW should fail if file exists and last error value should be ERROR_FILE_EXISTS"); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_SUCCESS, + "CREATE_NEW should fail if file exists and last error value should be ERROR_SUCCESS");
ret = DeleteFileW(filename); ok(ret, "DeleteFileW: error %ld\n", GetLastError()); @@ -620,13 +620,11 @@ BOOL ret;
ret = DeleteFileA(NULL); - ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER || - GetLastError() == ERROR_PATH_NOT_FOUND), + ok(!ret && GetLastError() == ERROR_SUCCESS, "DeleteFileA(NULL) returned ret=%d error=%ld",ret,GetLastError());
ret = DeleteFileA(""); - ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || - GetLastError() == ERROR_BAD_PATHNAME), + ok(!ret && GetLastError() == ERROR_SUCCESS, "DeleteFileA("") returned ret=%d error=%ld",ret,GetLastError()); }
@@ -638,11 +636,11 @@ ret = DeleteFileW(NULL); if (ret==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) return; - ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, + ok(!ret && GetLastError() == ERROR_SUCCESS, "DeleteFileW(NULL) returned ret=%d error=%ld",ret,GetLastError());
ret = DeleteFileW(emptyW); - ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND, + ok(!ret && GetLastError() == ERROR_SUCCESS, "DeleteFileW("") returned ret=%d error=%ld",ret,GetLastError()); }
@@ -800,12 +798,12 @@ 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_SUCCESS, "Bad Error number %d\n", err); handle = FindFirstFileA("C:\",&search_results); 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_SUCCESS, "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");
"Ferenc" == Ferenc Wagner wferi@tba.elte.hu writes:
Ferenc> The following modifications are needed to make the file tests Ferenc> pass under Windows NT 4.0 SP6. I can not test other versions, Ferenc> please write back if anything is wrong.
If different versions of windows return different error number, and we find programms that depend on that behaviour. I think the values in the test file were checked, probably on a Winxx version. Now you encounter errors on NTXX. So you should follow the advice in documentation/testing.sgml: ==== <para> When writing tests you will also encounter differences between Windows 9x and Windows NT platforms. Such differences should be treated differently from the platform issues mentioned above. In particular you should remember that the goal of Wine is not to be a clone of any specific Windows version but to run Windows applications on Unix. </para> <para> So, if an API returns a different error code on Windows 9x and Windows NT, your check should just verify that Wine returns one or the other: <screen> ok ( GetLastError() == WIN9X_ERROR || GetLastError() == NT_ERROR, ...); </screen> </para> <para> ==== Bye
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
Ferenc Wagner wferi@tba.elte.hu writes:
The following modifications are needed to make the file tests pass under Windows NT 4.0 SP6. I can not test other versions, please write back if anything is wrong.
I think the values in the test file were checked, probably on a Winxx version. Now you encounter errors on NTXX.
Thanks for responding. Now I did some research on this. cvs annotate says that the failing lines come from revision 1.10 (Dmitry's patch of 2002/08/27). On the other hand, http://fgouget.free.fr/wine/tests-en.shtml reports all the test passing on 2003/02/03. I am totally confused. Can cross-compilation case this inconsistency?
Any hints appreciated, Feri.