Rémi Bernon : setupapi/tests: Add possible test_need_media results for Win10.
Alexandre Julliard
julliard at winehq.org
Thu Jan 27 15:36:18 CST 2022
Module: wine
Branch: master
Commit: 68b83a8a093d59d9ee085574c4c1ef64e6b28807
URL: https://source.winehq.org/git/wine.git/?a=commit;h=68b83a8a093d59d9ee085574c4c1ef64e6b28807
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Thu Jan 27 13:30:04 2022 +0100
setupapi/tests: Add possible test_need_media results for Win10.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/setupapi/tests/install.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c
index c085b724b59..758a0761037 100644
--- a/dlls/setupapi/tests/install.c
+++ b/dlls/setupapi/tests/install.c
@@ -1120,7 +1120,7 @@ static void test_install_files_queue(void)
ok(ret, "Failed to delete INF file, error %u.\n", GetLastError());
}
-static unsigned int got_need_media, got_copy_error;
+static unsigned int got_need_media, got_copy_error, got_start_copy;
static unsigned int testmode;
static UINT WINAPI need_media_cb(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
@@ -1332,6 +1332,7 @@ static UINT WINAPI need_media_newpath_cb(void *context, UINT message, UINT_PTR p
else
return FILEOP_SKIP;
}
+ else if (message == SPFILENOTIFY_STARTCOPY) got_start_copy++;
return SetupDefaultQueueCallbackA(context, message, param1, param2);
}
@@ -1901,7 +1902,7 @@ static void test_need_media(void)
ok(delete_file("dst/three.txt"), "Destination file should exist.\n");
testmode = 6;
- got_need_media = got_copy_error = 0;
+ got_need_media = got_copy_error = got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
copy_params.QueueHandle = queue;
@@ -1915,9 +1916,10 @@ static void test_need_media(void)
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
- ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
+ if (got_start_copy) ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
+ else ok(!file_exists("dst/one.txt"), "Destination file should not exist.\n");
- got_need_media = got_copy_error = 0;
+ got_need_media = got_copy_error = got_start_copy = 0;
queue = SetupOpenFileQueue();
ok(queue != INVALID_HANDLE_VALUE, "Failed to open queue, error %#x.\n", GetLastError());
copy_params.LayoutInf = hinf;
@@ -1928,7 +1930,8 @@ static void test_need_media(void)
run_queue(queue, need_media_newpath_cb);
ok(got_need_media == 1, "Got %u callbacks.\n", got_need_media);
ok(!got_copy_error, "Got %u copy errors.\n", got_copy_error);
- ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
+ if (got_start_copy) ok(delete_file("dst/one.txt"), "Destination file should exist.\n");
+ else ok(!file_exists("dst/one.txt"), "Destination file should not exist.\n");
}
else
SetupCloseFileQueue(queue);
@@ -1963,7 +1966,7 @@ static void test_close_queue(void)
SetupTermDefaultQueueCallback(context);
}
-static unsigned int got_start_copy, start_copy_ret;
+static unsigned int start_copy_ret;
static UINT WINAPI start_copy_cb(void *context, UINT message, UINT_PTR param1, UINT_PTR param2)
{
More information about the wine-cvs
mailing list