Module: wine Branch: master Commit: f9028142d1e57322f893d7e47d846f72a8c6c72c URL: https://source.winehq.org/git/wine.git/?a=commit;h=f9028142d1e57322f893d7e47...
Author: Jeff Smith whydoubt@gmail.com Date: Wed Jul 29 09:29:24 2020 -0500
setupapi/tests: Add error tests for SetupDiDestroyDeviceInfoList.
Signed-off-by: Jeff Smith whydoubt@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/setupapi/tests/devinst.c | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index cb77fdf3c4..58b6303608 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -2708,7 +2708,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); @@ -2740,7 +2743,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. */
@@ -2766,7 +2772,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(). */
@@ -2786,7 +2795,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); @@ -2854,7 +2866,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); @@ -2883,7 +2898,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(). */
@@ -2906,7 +2924,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); @@ -2954,7 +2975,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");