From: Zhenbo Li Subject: shell32/tests: Use GetVersion() to skip a test on Vista Message-Id: <52A04BD9.5000800@gmail.com> Date: Thu, 05 Dec 2013 17:48:09 +0800 There are few lines in the code: + if (ret != ERROR_FILE_NOT_FOUND) + { + /* Vista would throw up a dialog box that we can't suppress */ As this problem only exists in Vista && Windows 2008, so I think use GetVersion() is a better idea. --- dlls/shell32/tests/shlfileop.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 14ace24..ac50b7f 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -631,15 +631,18 @@ static void test_delete(void) /* delete a dir, and then a file inside the dir, same as * deleting a nonexistent file */ - if (ret != ERROR_FILE_NOT_FOUND) + DWORD win_version; + win_version = LOWORD(GetVersion()); + if ((DWORD)(LOBYTE(win_version)) != 6) { - /* Vista would throw up a dialog box that we can't suppress */ + /* Vista and Win2008 would throw up a dialog box that we can't suppress, and cause Timeout */ init_shfo_tests(); shfo.pFrom = "testdir2\0testdir2\\one.txt\0"; ret = SHFileOperationA(&shfo); - ok(ret == ERROR_PATH_NOT_FOUND || - broken(ret == ERROR_SUCCESS), /* NT4 */ - "Expected ERROR_PATH_NOT_FOUND, got %d\n", ret); + ok(ret == ERROR_PATH_NOT_FOUND || /* XP */ + broken(ret == ERROR_SUCCESS) || /* NT4 */ + ret == DE_INVALIDFILES, /* Win 7 or 8 */ + "Expected ERROR_PATH_NOT_FOUND or DE_INVALIDFILES, got 0x%x\n", ret); ok(!dir_exists("testdir2"), "Expected testdir2 to not exist\n"); ok(!file_exists("testdir2\\one.txt"), "Expected testdir2\\one.txt to not exist\n"); }