Paul Vriens : setupapi/tests: Fix some test failures on W2K.
Alexandre Julliard
julliard at winehq.org
Wed Jun 11 13:42:39 CDT 2008
Module: wine
Branch: master
Commit: 5cd4cbc49c6bbafca67a511bea60e6801aff53b3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5cd4cbc49c6bbafca67a511bea60e6801aff53b3
Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date: Wed Jun 11 14:57:42 2008 +0200
setupapi/tests: Fix some test failures on W2K.
---
dlls/setupapi/tests/devinst.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index f00de28..7c0c182 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -814,6 +814,8 @@ static void testGetDeviceInterfaceDetail(void)
{
static const char path[] =
"\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}";
+ static const char path_w2k[] =
+ "\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}\\";
LPBYTE buf = HeapAlloc(GetProcessHeap(), 0, size);
SP_DEVICE_INTERFACE_DETAIL_DATA_A *detail =
(SP_DEVICE_INTERFACE_DETAIL_DATA_A *)buf;
@@ -845,14 +847,19 @@ static void testGetDeviceInterfaceDetail(void)
size, &size, NULL);
ok(ret, "SetupDiGetDeviceInterfaceDetailA failed: %d\n",
GetLastError());
- ok(!lstrcmpiA(path, detail->DevicePath), "Unexpected path %s\n",
- detail->DevicePath);
+ ok(!lstrcmpiA(path, detail->DevicePath) ||
+ !lstrcmpiA(path_w2k, detail->DevicePath), "Unexpected path %s\n",
+ detail->DevicePath);
/* Check SetupDiGetDeviceInterfaceDetailW */
if (pSetupDiGetDeviceInterfaceDetailW)
{
ret = pSetupDiGetDeviceInterfaceDetailW(set, &interfaceData, NULL, 0, &size, NULL);
- ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got error code: %d\n", GetLastError());
- ok(expectedsize == size, "SetupDiGetDeviceInterfaceDetailW returned wrong reqsize: expected %d, got %d\n", expectedsize, size);
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+ "Expected ERROR_INSUFFICIENT_BUFFER, got error code: %d\n", GetLastError());
+ ok(expectedsize == size ||
+ (expectedsize + sizeof(WCHAR)) == size /* W2K adds a backslash */,
+ "SetupDiGetDeviceInterfaceDetailW returned wrong reqsize, got %d\n",
+ size);
}
else
skip("SetupDiGetDeviceInterfaceDetailW is not available\n");
@@ -1097,6 +1104,8 @@ static void testRegisterAndGetDetail(void)
{
static const char path[] =
"\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}";
+ static const char path_w2k[] =
+ "\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}\\";
PSP_DEVICE_INTERFACE_DETAIL_DATA_A detail = NULL;
detail = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)HeapAlloc(GetProcessHeap(), 0, dwSize);
@@ -1111,8 +1120,9 @@ static void testRegisterAndGetDetail(void)
* as all the tests are cleaned up correctly this has to be (or should be) fixed
*/
todo_wine
- ok(!lstrcmpiA(path, detail->DevicePath), "Unexpected path %s\n",
- detail->DevicePath);
+ ok(!lstrcmpiA(path, detail->DevicePath) ||
+ !lstrcmpiA(path_w2k, detail->DevicePath), "Unexpected path %s\n",
+ detail->DevicePath);
HeapFree(GetProcessHeap(), 0, detail);
}
}
More information about the wine-cvs
mailing list