Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4e9b306e
Commit
4e9b306e
authored
Nov 21, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Remove workarounds in testRegisterDeviceInfo().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16eb2b26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
34 deletions
+34
-34
devinst.c
dlls/setupapi/tests/devinst.c
+34
-34
No files found.
dlls/setupapi/tests/devinst.c
View file @
4e9b306e
...
...
@@ -535,52 +535,52 @@ static void test_get_device_instance_id(void)
SetupDiDestroyDeviceInfoList
(
set
);
}
static
void
test
RegisterDeviceI
nfo
(
void
)
static
void
test
_register_device_i
nfo
(
void
)
{
static
const
WCHAR
bogus
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'E'
,
'n'
,
'u'
,
'm'
,
'\\'
,
'U'
,
'S'
,
'B'
,
'\\'
,
'B'
,
'O'
,
'G'
,
'U'
,
'S'
,
0
};
SP_DEVINFO_DATA
device
=
{
0
};
BOOL
ret
;
HDEVINFO
set
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiRegisterDeviceInfo
(
NULL
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
set
=
pSetupDiCreateDeviceInfoList
(
&
guid
,
NULL
);
ok
(
set
!=
NULL
,
"SetupDiCreateDeviceInfoList failed: %d
\n
"
,
GetLastError
());
if
(
set
)
{
SP_DEVINFO_DATA
devInfo
=
{
0
};
ret
=
SetupDiRegisterDeviceInfo
(
NULL
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiRegisterDeviceInfo
(
set
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiRegisterDeviceInfo
(
set
,
&
devInfo
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
devInfo
.
cbSize
=
sizeof
(
devInfo
);
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiRegisterDeviceInfo
(
set
,
&
devInfo
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
set
=
SetupDiCreateDeviceInfoList
(
&
guid
,
NULL
);
ok
(
set
!=
NULL
,
"Failed to create device list, error %#x.
\n
"
,
GetLastError
());
ret
=
pSetupDiCreateDeviceInfoA
(
set
,
"USB
\\
BOGUS
\\
0000"
,
&
guid
,
NULL
,
NULL
,
0
,
&
devInfo
);
ok
(
ret
,
"SetupDiCreateDeviceInfoA failed: %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SetupDiRegisterDeviceInfo
(
set
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
ret
=
pSetupDiRegisterDeviceInfo
(
set
,
&
devInfo
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"SetupDiRegisterDeviceInfo failed: %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
SetupDiRegisterDeviceInfo
(
set
,
&
device
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
ret
=
pSetupDiRemoveDevice
(
set
,
&
devInfo
);
todo_wine
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
pSetupDiDestroyDeviceInfoList
(
set
);
device
.
cbSize
=
sizeof
(
device
);
SetLastError
(
0xdeadbeef
);
ret
=
SetupDiRegisterDeviceInfo
(
set
,
&
device
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
ret
=
SetupDiCreateDeviceInfoA
(
set
,
"USB
\\
BOGUS
\\
0000"
,
&
guid
,
NULL
,
NULL
,
0
,
&
device
);
ok
(
ret
,
"Failed to create device, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiRegisterDeviceInfo
(
set
,
&
device
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"Failed to register device, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiRemoveDevice
(
set
,
&
device
);
todo_wine
ok
(
ret
,
"Failed to remove device, error %#x.
\n
"
,
GetLastError
());
SetupDiDestroyDeviceInfoList
(
set
);
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
static
void
testCreateDeviceInterface
(
void
)
...
...
@@ -1517,7 +1517,7 @@ START_TEST(devinst)
test_install_class
();
test_device_info
();
test_get_device_instance_id
();
test
RegisterDeviceI
nfo
();
test
_register_device_i
nfo
();
testCreateDeviceInterface
();
testGetDeviceInterfaceDetail
();
testDevRegKey
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment