kernel32/tests: Remove some expected values for test_DeleteFileA()
Zhenbo Li
litimetal at gmail.com
Thu Dec 12 07:48:25 CST 2013
2013/12/12 Dmitry Timoshkov <dmitry at baikal.ru>:
>
> Usually there was a reason why there are so many different results
> in ok() statements, it would be a good idea to check git history and
> find out that reasons it out instead of simply declaring them as
> confusing and removing them altogether.
Thank you, it's quite a good idea.
My patch is related to 3 parts:
PART 1
>
> ret = DeleteFileA(NULL);
>- ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
>- GetLastError() == ERROR_PATH_NOT_FOUND),
>+ ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
> "DeleteFileA(NULL) returned ret=%d error=%d\n",ret,GetLastError());
>
The old code came from commit e948ad1fc7e18a2
Author: Francois Gouget <fgouget at free.fr> 2002-12-12 11:54:01
Committer: Alexandre Julliard <julliard at winehq.org> 2002-12-12 11:54:01
+ ret = DeleteFileA(NULL);
+ ok(!ret && (GetLastError() == ERROR_INVALID_PARAMETER ||
+ GetLastError() == ERROR_PATH_NOT_FOUND),
+ "DeleteFileA(NULL) returned ret=%d error=%ld",ret,GetLastError());
PART 2
> ret = DeleteFileA("");
>- ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND ||
>- GetLastError() == ERROR_BAD_PATHNAME),
>+ ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
> "DeleteFileA(\"\") returned ret=%d error=%d\n",ret,GetLastError());
The old code came from commit e948ad1fc7e18a2
Author: Francois Gouget <fgouget at free.fr> 2002-12-12 11:54:01
Committer: Alexandre Julliard <julliard at winehq.org> 2002-12-12 11:54:01
He added ERROR_BAD_PATHNAME
As Francois mentioned, he "Adapt the DeleteFileA error code checks to
take into account variations
between Win9x and NT."
PART 3
>
> ret = DeleteFileA("nul");
>- ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND ||
>- GetLastError() == ERROR_INVALID_PARAMETER ||
>- GetLastError() == ERROR_ACCESS_DENIED ||
>- GetLastError() == ERROR_INVALID_FUNCTION),
>+ ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
> "DeleteFileA(\"nul\") returned ret=%d error=%d\n",ret,GetLastError());
>
> GetTempPathA(MAX_PATH, temp_path);
The old code was related to 2 commits
commit c49b9485
Author: Jakob Eriksson <jakov at vmlinux.org> 2004-04-28 11:52:02
Committer: Alexandre Julliard <julliard at winehq.org> 2004-04-28 11:52:02
ERROR_INVALID_PARAMETER and ERROR_ACCESS_DENIED were added.
and commit 6cb97534
Author: Jacek Caban <jack at itma.pwr.wroc.pl> 2005-06-27 17:49:26
Committer: Alexandre Julliard <julliard at winehq.org> 2005-06-27 17:49:26
ERROR_INVALID_FUNCTION was added for NT4
As they only exist in old WIndows versions, should we still keep them
in testcases? Or make them as broken?
Appreciate your reply.
--
Have a nice day!
Zhenbo Li
More information about the wine-devel
mailing list