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
1bba9674
Commit
1bba9674
authored
May 25, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
May 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for GetRawInputDeviceList.
parent
e1de0eea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
input.c
dlls/user32/tests/input.c
+52
-0
No files found.
dlls/user32/tests/input.c
View file @
1bba9674
...
...
@@ -77,6 +77,7 @@ static struct {
static
UINT
(
WINAPI
*
pSendInput
)
(
UINT
,
INPUT
*
,
size_t
);
static
int
(
WINAPI
*
pGetMouseMovePointsEx
)
(
UINT
,
LPMOUSEMOVEPOINT
,
LPMOUSEMOVEPOINT
,
int
,
DWORD
);
static
UINT
(
WINAPI
*
pGetRawInputDeviceList
)
(
PRAWINPUTDEVICELIST
,
PUINT
,
UINT
);
#define MAXKEYEVENTS 12
#define MAXKEYMESSAGES MAXKEYEVENTS
/* assuming a key event generates one
...
...
@@ -160,6 +161,7 @@ static void init_function_pointers(void)
GET_PROC
(
SendInput
)
GET_PROC
(
GetMouseMovePointsEx
)
GET_PROC
(
GetRawInputDeviceList
)
#undef GET_PROC
}
...
...
@@ -1486,6 +1488,51 @@ static void test_GetMouseMovePointsEx(void)
#undef MYERROR
}
static
void
test_GetRawInputDeviceList
(
void
)
{
RAWINPUTDEVICELIST
devices
[
32
];
UINT
ret
,
devcount
,
odevcount
;
DWORD
err
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
0
);
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_INVALID_PARAMETER
,
"expected 87, got %d
\n
"
,
err
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
sizeof
(
devices
[
0
]));
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_NOACCESS
,
"expected 998, got %d
\n
"
,
err
);
devcount
=
0
;
ret
=
pGetRawInputDeviceList
(
NULL
,
&
devcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
==
0
,
"expected 0, got %d
\n
"
,
ret
);
ok
(
devcount
>
0
,
"expected non-zero
\n
"
);
SetLastError
(
0xdeadbeef
);
devcount
=
0
;
ret
=
pGetRawInputDeviceList
(
devices
,
&
devcount
,
sizeof
(
devices
[
0
]));
err
=
GetLastError
();
ok
(
ret
==
-
1
,
"expected -1, got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ERROR_INSUFFICIENT_BUFFER
,
"expected 122, got %d
\n
"
,
err
);
ok
(
devcount
>
0
,
"expected non-zero
\n
"
);
/* devcount contain now the correct number of devices */
ret
=
pGetRawInputDeviceList
(
devices
,
&
devcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
>
0
,
"expected non-zero
\n
"
);
/* check if variable changes from larger to smaller value */
devcount
=
odevcount
=
sizeof
(
devices
)
/
sizeof
(
devices
[
0
]);
ret
=
pGetRawInputDeviceList
(
devices
,
&
odevcount
,
sizeof
(
devices
[
0
]));
ok
(
ret
>
0
,
"expected non-zero
\n
"
);
ok
(
devcount
==
odevcount
,
"expected %d, got %d
\n
"
,
devcount
,
odevcount
);
}
static
void
test_key_map
(
void
)
{
HKL
kl
=
GetKeyboardLayout
(
0
);
...
...
@@ -2353,4 +2400,9 @@ START_TEST(input)
test_GetMouseMovePointsEx
();
else
win_skip
(
"GetMouseMovePointsEx is not available
\n
"
);
if
(
pGetRawInputDeviceList
)
test_GetRawInputDeviceList
();
else
win_skip
(
"GetRawInputDeviceList is not available
\n
"
);
}
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