Followup of 0eab97ffa8.
Usually version checks have to be avoided, but this modifies a pre-existing version check to skip that single test just with Windows 7.
[Test pattern page.](https://test.winehq.org/data/patterns.html#shell32:shlfileop)
[Testbot run with this patch included.](https://testbot.winehq.org/JobDetails.pl?Key=157955)
CC: @zhui
-- v3: shell32/tests: Avoid hang in test_rename.
From: Bernhard Übelacker bernhardu@mailbox.org
Followup of 0eab97ffa8. --- dlls/shell32/tests/shlfileop.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index d69995d06eb..f962c12f8e6 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -730,6 +730,13 @@ static void test_delete(void) ok(!dir_exists("testdir2\nested"), "Expected testdir2\nested to not exist\n"); }
+static BOOL is_below_windows8(void) +{ + INT_PTR rc; + rc = (INT_PTR)ShellExecuteA(NULL, "averb", "shlproto://foo/bar", NULL, NULL, SW_HIDE); + return rc == SE_ERR_ACCESSDENIED; +} + /* tests the FO_RENAME action */ static void test_rename(void) { @@ -831,9 +838,14 @@ static void test_rename(void) check_file_operation(FO_RENAME, FOF_NO_UI, "test1.txt\0", "test2.txt\0", ERROR_SUCCESS, FALSE, FALSE, FALSE); - check_file_operation(FO_RENAME, FOF_NO_UI, - "testdir2\0", "testdir4\0", - ERROR_SUCCESS, FALSE, TRUE, FALSE); + if (!is_below_windows8()) /* Hangs with Windows 7 */ + { + check_file_operation(FO_RENAME, FOF_NO_UI, + "testdir2\0", "testdir4\0", + ERROR_SUCCESS, FALSE, TRUE, FALSE); + } + else + win_skip("Skip FO_RENAME with already existing target directory.\n");
/* Empty source or target. */ clean_after_shfo_tests();
v3: - Undo the changes to is_old_shell32. - Use ShellExecuteA to decide skipping the test.
On Wed Jun 4 13:37:57 2025 +0000, Alexandre Julliard wrote:
Usually version checks have to be avoided, but this modifies a
pre-existing version check to skip that single test just with Windows 7. Not really, the previous code was testing features, not the dll version. Please try to do it that way too.
Sorry for the delay, I did first not really find something useful, therefore v2 with kind of unrelated check. Then I looked through the tests and found a difference starting with Windows 8, which I use now in v3.