Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
d95be60f
Commit
d95be60f
authored
Dec 21, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add a basic test for maximizing windows.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7cdfd31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
win.c
dlls/user32/tests/win.c
+37
-1
No files found.
dlls/user32/tests/win.c
View file @
d95be60f
...
@@ -6528,8 +6528,9 @@ static void test_ShowWindow(void)
...
@@ -6528,8 +6528,9 @@ static void test_ShowWindow(void)
{
{
HWND
hwnd
;
HWND
hwnd
;
DWORD
style
;
DWORD
style
;
RECT
rcMain
,
rc
,
rcMinimized
,
rcClient
,
rcEmpty
;
RECT
rcMain
,
rc
,
rcMinimized
,
rcClient
,
rcEmpty
,
rcMaximized
,
rcResized
;
LPARAM
ret
;
LPARAM
ret
;
MONITORINFO
mon_info
;
SetRect
(
&
rcClient
,
0
,
0
,
90
,
90
);
SetRect
(
&
rcClient
,
0
,
0
,
90
,
90
);
rcMain
=
rcClient
;
rcMain
=
rcClient
;
...
@@ -6547,6 +6548,12 @@ static void test_ShowWindow(void)
...
@@ -6547,6 +6548,12 @@ static void test_ShowWindow(void)
0
,
0
,
0
,
NULL
);
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
assert
(
hwnd
);
mon_info
.
cbSize
=
sizeof
(
mon_info
);
GetMonitorInfoW
(
MonitorFromWindow
(
hwnd
,
MONITOR_DEFAULTTOPRIMARY
),
&
mon_info
);
rcMaximized
=
mon_info
.
rcWork
;
AdjustWindowRectEx
(
&
rcMaximized
,
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
~
WS_BORDER
,
0
,
GetWindowLongA
(
hwnd
,
GWL_EXSTYLE
));
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
!
(
style
&
WS_VISIBLE
),
"window should not be visible
\n
"
);
ok
(
!
(
style
&
WS_VISIBLE
),
"window should not be visible
\n
"
);
...
@@ -6617,6 +6624,35 @@ static void test_ShowWindow(void)
...
@@ -6617,6 +6624,35 @@ static void test_ShowWindow(void)
ok
(
EqualRect
(
&
rcClient
,
&
rc
),
"expected %s, got %s
\n
"
,
ok
(
EqualRect
(
&
rcClient
,
&
rc
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
rcClient
),
wine_dbgstr_rect
(
&
rc
));
wine_dbgstr_rect
(
&
rcClient
),
wine_dbgstr_rect
(
&
rc
));
ShowWindow
(
hwnd
,
SW_MAXIMIZE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should be minimized
\n
"
);
ok
(
style
&
WS_MAXIMIZE
,
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMaximized
,
&
rc
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
rcMaximized
),
wine_dbgstr_rect
(
&
rc
));
/* maximized windows can be resized */
ret
=
SetWindowPos
(
hwnd
,
0
,
300
,
300
,
200
,
200
,
SWP_NOACTIVATE
|
SWP_NOZORDER
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
SetRect
(
&
rcResized
,
300
,
300
,
500
,
500
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcResized
,
&
rc
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
rcResized
),
wine_dbgstr_rect
(
&
rc
));
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"expected %s, got %s
\n
"
,
wine_dbgstr_rect
(
&
rcMain
),
wine_dbgstr_rect
(
&
rc
));
ret
=
EnableWindow
(
hwnd
,
FALSE
);
ret
=
EnableWindow
(
hwnd
,
FALSE
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
style
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
...
...
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