[WINESYNC] setupapi/tests: Add error tests for SetupDiDestroyDeviceInfoList.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f9028142d1e57322f893d7e47d846f72a8c6c72c by Jeff Smith <whydoubt@gmail.com>
This commit is contained in:
winesync 2023-09-14 21:21:50 +02:00 committed by Hermès Bélusca-Maïto
parent 61ac1e6183
commit 562c32e489
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 33 additions and 9 deletions

View file

@ -2712,7 +2712,10 @@ static void test_class_installer(void)
ok(*coinst_last_message == DIF_REMOVE, "Got unexpected message %#x.\n", *coinst_last_message);
*coinst_callback_count = 0;
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2744,7 +2747,10 @@ static void test_class_installer(void)
ok(GetLastError() == 0xdeadc0de, "Got unexpected error %#x.\n", GetLastError());
ok(!device_is_registered(set, &device), "Expected device not to be registered.\n");
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* Test returning ERROR_DI_DO_DEFAULT. */
@ -2770,7 +2776,10 @@ static void test_class_installer(void)
ok(ret, "Failed to call class installer, error %#x.\n", GetLastError());
ok(!device_is_registered(set, &device), "Expected device not to be registered.\n");
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* The default entry point is ClassInstall(). */
@ -2790,7 +2799,10 @@ static void test_class_installer(void)
ok(*coinst_last_message == DIF_ALLOW_INSTALL, "Got unexpected message %#x.\n", *coinst_last_message);
*coinst_callback_count = 0;
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2858,7 +2870,10 @@ static void test_class_coinstaller(void)
ok(*coinst_last_message == DIF_REMOVE, "Got unexpected message %#x.\n", *coinst_last_message);
*coinst_callback_count = 0;
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
todo_wine ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
todo_wine ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2887,7 +2902,10 @@ static void test_class_coinstaller(void)
ok(GetLastError() == 0xdeadc0de, "Got unexpected error %#x.\n", GetLastError());
ok(!device_is_registered(set, &device), "Expected device not to be registered.\n");
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* The default entry point is CoDeviceInstall(). */
@ -2910,7 +2928,10 @@ static void test_class_coinstaller(void)
ok(*coinst_last_message == DIF_ALLOW_INSTALL, "Got unexpected message %#x.\n", *coinst_last_message);
*coinst_callback_count = 0;
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2958,7 +2979,10 @@ static void test_call_class_installer(void)
ok(ret, "Failed to call class installer, error %#x.\n", GetLastError());
ok(!device_is_registered(set, &device), "Expected device not to be registered.\n");
SetupDiDestroyDeviceInfoList(set);
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
load_resource("coinst.dll", "C:\\windows\\system32\\winetest_coinst.dll");

View file

@ -10,4 +10,4 @@ files:
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
tags:
wine: cfde18c4904cd76eff40336e064cba86b9831633
wine: f9028142d1e57322f893d7e47d846f72a8c6c72c