Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9b7b9fa0
Commit
9b7b9fa0
authored
Apr 11, 2019
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintab32/tests: Add WTInfoA tests.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
810201cf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
context.c
dlls/wintab32/tests/context.c
+64
-0
No files found.
dlls/wintab32/tests/context.c
View file @
9b7b9fa0
...
...
@@ -32,8 +32,11 @@ static const UINT Y = 0;
static
const
UINT
WIDTH
=
200
;
static
const
UINT
HEIGHT
=
200
;
static
LOGCONTEXTA
glogContext
;
static
HCTX
(
WINAPI
*
pWTOpenA
)(
HWND
,
LPLOGCONTEXTA
,
BOOL
);
static
BOOL
(
WINAPI
*
pWTClose
)(
HCTX
);
static
UINT
(
WINAPI
*
pWTInfoA
)(
UINT
,
UINT
,
void
*
);
static
HMODULE
load_functions
(
void
)
{
...
...
@@ -50,6 +53,7 @@ static HMODULE load_functions(void)
}
if
(
GET_PROC
(
WTOpenA
)
&&
GET_PROC
(
WTInfoA
)
&&
GET_PROC
(
WTClose
)
)
{
return
hWintab
;
...
...
@@ -135,6 +139,65 @@ static void test_WTOpenContextValidation(void)
wintab_destroy_window
(
defaultWindow
);
}
static
void
test_WTInfoA
(
void
)
{
char
name
[
LCNAMELEN
];
UINT
ret
;
AXIS
value
;
AXIS
orientation
[
3
];
glogContext
.
lcOptions
|=
CXO_SYSTEM
;
ret
=
pWTInfoA
(
WTI_DEFSYSCTX
,
0
,
&
glogContext
);
if
(
!
ret
)
{
skip
(
"No tablet connected
\n
"
);
return
;
}
ok
(
ret
==
sizeof
(
LOGCONTEXTA
),
"incorrect size
\n
"
);
ok
(
glogContext
.
lcOptions
&
CXO_SYSTEM
,
"Wrong options 0x%08x
\n
"
,
glogContext
.
lcOptions
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_NAME
,
name
);
trace
(
"DVC_NAME %s
\n
"
,
name
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_X
,
&
value
);
ok
(
ret
==
sizeof
(
AXIS
),
"Wrong DVC_X size %d
\n
"
,
ret
);
trace
(
"DVC_X %d, %d, %d
\n
"
,
value
.
axMin
,
value
.
axMax
,
value
.
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_Y
,
&
value
);
ok
(
ret
==
sizeof
(
AXIS
),
"Wrong DVC_Y size %d
\n
"
,
ret
);
trace
(
"DVC_Y %d, %d, %d
\n
"
,
value
.
axMin
,
value
.
axMax
,
value
.
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_Z
,
&
value
);
todo_wine
ok
(
ret
==
sizeof
(
AXIS
),
"Wrong DVC_Z size %d
\n
"
,
ret
);
trace
(
"DVC_Z %d, %d, %d
\n
"
,
value
.
axMin
,
value
.
axMax
,
value
.
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_NPRESSURE
,
&
value
);
ok
(
ret
==
sizeof
(
AXIS
),
"Wrong DVC_NPRESSURE, size %d
\n
"
,
ret
);
trace
(
"DVC_NPRESSURE %d, %d, %d
\n
"
,
value
.
axMin
,
value
.
axMax
,
value
.
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_TPRESSURE
,
&
value
);
todo_wine
ok
(
ret
==
sizeof
(
AXIS
),
"Wrong DVC_TPRESSURE, size %d
\n
"
,
ret
);
trace
(
"DVC_TPRESSURE %d, %d, %d
\n
"
,
value
.
axMin
,
value
.
axMax
,
value
.
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_ORIENTATION
,
&
orientation
);
ok
(
ret
==
sizeof
(
AXIS
)
*
3
,
"Wrong DVC_ORIENTATION, size %d
\n
"
,
ret
);
trace
(
"DVC_ORIENTATION0 %d, %d, %d
\n
"
,
orientation
[
0
].
axMin
,
orientation
[
0
].
axMax
,
orientation
[
0
].
axUnits
);
trace
(
"DVC_ORIENTATION1 %d, %d, %d
\n
"
,
orientation
[
1
].
axMin
,
orientation
[
1
].
axMax
,
orientation
[
1
].
axUnits
);
trace
(
"DVC_ORIENTATION2 %d, %d, %d
\n
"
,
orientation
[
2
].
axMin
,
orientation
[
2
].
axMax
,
orientation
[
2
].
axUnits
);
ret
=
pWTInfoA
(
WTI_DEVICES
,
DVC_ROTATION
,
&
orientation
);
if
(
ret
)
{
trace
(
"DVC_ROTATION0 %d, %d, %d
\n
"
,
orientation
[
0
].
axMin
,
orientation
[
0
].
axMax
,
orientation
[
0
].
axUnits
);
trace
(
"DVC_ROTATION1 %d, %d, %d
\n
"
,
orientation
[
1
].
axMin
,
orientation
[
1
].
axMax
,
orientation
[
1
].
axUnits
);
trace
(
"DVC_ROTATION2 %d, %d, %d
\n
"
,
orientation
[
2
].
axMin
,
orientation
[
2
].
axMax
,
orientation
[
2
].
axUnits
);
}
else
trace
(
"DVC_ROTATION not supported
\n
"
);
}
START_TEST
(
context
)
{
HMODULE
hWintab
=
load_functions
();
...
...
@@ -146,6 +209,7 @@ START_TEST(context)
}
test_WTOpenContextValidation
();
test_WTInfoA
();
FreeLibrary
(
hWintab
);
}
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