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
9501a3d5
Commit
9501a3d5
authored
Sep 22, 2020
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Sep 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add display orientation tests.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a62ae1bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
monitor.c
dlls/user32/tests/monitor.c
+64
-0
No files found.
dlls/user32/tests/monitor.c
View file @
9501a3d5
...
@@ -938,6 +938,70 @@ static void test_ChangeDisplaySettingsEx(void)
...
@@ -938,6 +938,70 @@ static void test_ChangeDisplaySettingsEx(void)
}
}
}
}
/* Test changing each adapter to every supported display orientation */
for
(
device
=
0
;
device
<
device_count
;
++
device
)
{
memset
(
&
dm
,
0
,
sizeof
(
dm
));
dm
.
dmSize
=
sizeof
(
dm
);
res
=
EnumDisplaySettingsA
(
devices
[
device
].
name
,
ENUM_CURRENT_SETTINGS
,
&
dm
);
ok
(
res
,
"EnumDisplaySettingsA %s failed, error %#x.
\n
"
,
devices
[
device
].
name
,
GetLastError
());
memset
(
&
dm2
,
0
,
sizeof
(
dm2
));
dm2
.
dmSize
=
sizeof
(
dm2
);
for
(
mode
=
0
;
EnumDisplaySettingsExA
(
devices
[
device
].
name
,
mode
,
&
dm2
,
EDS_ROTATEDMODE
);
++
mode
)
{
if
(
dm2
.
dmBitsPerPel
!=
dm
.
dmBitsPerPel
||
dm2
.
dmDisplayFrequency
!=
dm
.
dmDisplayFrequency
)
continue
;
if
((
dm2
.
dmDisplayOrientation
==
DMDO_DEFAULT
||
dm2
.
dmDisplayOrientation
==
DMDO_180
)
&&
(
dm2
.
dmPelsWidth
!=
dm
.
dmPelsWidth
||
dm2
.
dmPelsHeight
!=
dm
.
dmPelsHeight
))
continue
;
if
((
dm2
.
dmDisplayOrientation
==
DMDO_90
||
dm2
.
dmDisplayOrientation
==
DMDO_270
)
&&
(
dm2
.
dmPelsWidth
!=
dm
.
dmPelsHeight
||
dm2
.
dmPelsHeight
!=
dm
.
dmPelsWidth
))
continue
;
res
=
ChangeDisplaySettingsExA
(
devices
[
device
].
name
,
&
dm2
,
NULL
,
CDS_RESET
,
NULL
);
if
(
res
!=
DISP_CHANGE_SUCCESSFUL
)
{
win_skip
(
"Failed to change %s to mode %d.
\n
"
,
devices
[
device
].
name
,
mode
);
continue
;
}
ok
(
res
==
DISP_CHANGE_SUCCESSFUL
,
"ChangeDisplaySettingsExA %s mode %d returned unexpected %d.
\n
"
,
devices
[
device
].
name
,
mode
,
res
);
flush_events
();
expect_dm
(
dm2
,
devices
[
device
].
name
,
mode
);
/* EnumDisplaySettingsEx without EDS_ROTATEDMODE reports modes with current orientation */
memset
(
&
dm3
,
0
,
sizeof
(
dm3
));
dm3
.
dmSize
=
sizeof
(
dm3
);
for
(
i
=
0
;
EnumDisplaySettingsExA
(
devices
[
device
].
name
,
i
,
&
dm3
,
0
);
++
i
)
{
ok
(
dm3
.
dmDisplayOrientation
==
dm2
.
dmDisplayOrientation
,
"Expected %s display mode %d orientation %d, got %d.
\n
"
,
devices
[
device
].
name
,
i
,
dm2
.
dmDisplayOrientation
,
dm3
.
dmDisplayOrientation
);
}
ok
(
i
>
0
,
"Expected at least one display mode found.
\n
"
);
if
(
device
==
0
)
{
ok
(
GetSystemMetrics
(
SM_CXSCREEN
)
==
dm2
.
dmPelsWidth
,
"Expected %d, got %d.
\n
"
,
dm2
.
dmPelsWidth
,
GetSystemMetrics
(
SM_CXSCREEN
));
ok
(
GetSystemMetrics
(
SM_CYSCREEN
)
==
dm2
.
dmPelsHeight
,
"Expected %d, got %d.
\n
"
,
dm2
.
dmPelsHeight
,
GetSystemMetrics
(
SM_CYSCREEN
));
}
if
(
device_count
==
1
)
{
ok
(
GetSystemMetrics
(
SM_CXVIRTUALSCREEN
)
==
dm2
.
dmPelsWidth
,
"Expected %d, got %d.
\n
"
,
dm2
.
dmPelsWidth
,
GetSystemMetrics
(
SM_CXVIRTUALSCREEN
));
ok
(
GetSystemMetrics
(
SM_CYVIRTUALSCREEN
)
==
dm2
.
dmPelsHeight
,
"Expected %d, got %d.
\n
"
,
dm2
.
dmPelsHeight
,
GetSystemMetrics
(
SM_CYVIRTUALSCREEN
));
}
}
ok
(
mode
>
0
,
"Expected at least one display mode found.
\n
"
);
}
/* Restore all adapters to their original settings */
/* Restore all adapters to their original settings */
for
(
device
=
0
;
device
<
device_count
;
++
device
)
for
(
device
=
0
;
device
<
device_count
;
++
device
)
{
{
...
...
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