shell32/tests: Add test for GetLastError in shlfileop

Dmitry Timoshkov dmitry at baikal.ru
Mon Jan 27 22:43:42 CST 2014


Zhenbo Li <litimetal at gmail.com> wrote:

>      ret = SHFileOperationA(&shfo);
>      todo_wine
>      ok(ret == 1026 ||
>         ret == ERROR_FILE_NOT_FOUND || /* Vista */
>         broken(ret == ERROR_SUCCESS), /* NT4 */
>         "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", ret);
> +    todo_wine
> +    ok(GetLastError() == 0 ||
> +        broken(GetLastError()==ERROR_FILE_NOT_FOUND), /* win 2000 */
> +        "gle = %d\n", GetLastError() );

'ret == ERROR_SUCCESS (0)' case is marked as broken above, so using broken
for 'GetLastError() == 0' instead of ERROR_FILE_NOT_FOUND would match that
behaviour. Same comment applies for other added tests.

In general I don't think that adding last error tests for SHFileOperation
is very useful because 1) this API returns error codes directly 2) according
to the tests both returned error codes and set last error values differ in
almost every Windows version, so it's very unlikely that there is an app
that depends on this.

-- 
Dmitry.



More information about the wine-devel mailing list