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
77337d75
Commit
77337d75
authored
Jan 15, 2013
by
Sergey Guralnik
Committed by
Alexandre Julliard
Jan 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test standard scrollbar initialization.
parent
6ad54620
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
scroll.c
dlls/user32/tests/scroll.c
+97
-0
No files found.
dlls/user32/tests/scroll.c
View file @
77337d75
...
...
@@ -396,6 +396,101 @@ todo_wine
DestroyWindow
(
hwnd
);
}
static
LRESULT
CALLBACK
scroll_init_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
SCROLLINFO
horz
,
vert
;
CREATESTRUCTA
*
cs
=
(
CREATESTRUCTA
*
)
lparam
;
BOOL
h_ret
,
v_ret
;
switch
(
msg
)
{
case
WM_NCCREATE
:
return
cs
->
lpCreateParams
?
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
)
:
TRUE
;
case
WM_CREATE
:
horz
.
cbSize
=
sizeof
horz
;
horz
.
fMask
=
SIF_ALL
;
horz
.
nMin
=
0xdeadbeaf
;
horz
.
nMax
=
0xbaadc0de
;
vert
=
horz
;
h_ret
=
GetScrollInfo
(
hwnd
,
SB_HORZ
,
&
horz
);
v_ret
=
GetScrollInfo
(
hwnd
,
SB_VERT
,
&
vert
);
if
(
cs
->
lpCreateParams
)
{
/* WM_NCCREATE was passed to DefWindowProc */
if
(
cs
->
style
&
(
WS_VSCROLL
|
WS_HSCROLL
))
{
todo_wine
ok
(
h_ret
&&
v_ret
,
"GetScrollInfo() should return NON-zero "
"but got h_ret=%d v_ret=%d
\n
"
,
h_ret
,
v_ret
);
todo_wine
ok
(
vert
.
nMin
==
0
&&
vert
.
nMax
==
100
,
"unexpected init values(SB_VERT): min=%d max=%d
\n
"
,
vert
.
nMin
,
vert
.
nMax
);
todo_wine
ok
(
horz
.
nMin
==
0
&&
horz
.
nMax
==
100
,
"unexpected init values(SB_HORZ): min=%d max=%d
\n
"
,
horz
.
nMin
,
horz
.
nMax
);
}
else
{
ok
(
!
h_ret
&&
!
v_ret
,
"GetScrollInfo() should return zeru, "
"but got h_ret=%d v_ret=%d
\n
"
,
h_ret
,
v_ret
);
ok
(
vert
.
nMin
==
0xdeadbeaf
&&
vert
.
nMax
==
0xbaadc0de
,
"unexpected initialization(SB_VERT): min=%d max=%d
\n
"
,
vert
.
nMin
,
vert
.
nMax
);
ok
(
horz
.
nMin
==
0xdeadbeaf
&&
horz
.
nMax
==
0xbaadc0de
,
"unexpected initialization(SB_HORZ): min=%d max=%d
\n
"
,
horz
.
nMin
,
horz
.
nMax
);
}
}
else
{
ok
(
!
h_ret
&&
!
v_ret
,
"GetScrollInfo() should return zeru, "
"but got h_ret=%d v_ret=%d
\n
"
,
h_ret
,
v_ret
);
ok
(
horz
.
nMin
==
0xdeadbeaf
&&
horz
.
nMax
==
0xbaadc0de
&&
vert
.
nMin
==
0xdeadbeaf
&&
vert
.
nMax
==
0xbaadc0de
,
"unexpected initialization
\n
"
);
}
return
FALSE
;
/* abort creation */
default:
/* need for WM_GETMINMAXINFO, which precedes WM_NCCREATE */
return
0
;
}
}
static
void
scrollbar_test_init
(
void
)
{
WNDCLASSEXA
wc
;
CHAR
cls_name
[]
=
"scroll_test_class"
;
LONG
style
[]
=
{
WS_VSCROLL
,
WS_HSCROLL
,
WS_VSCROLL
|
WS_HSCROLL
,
0
};
int
i
;
memset
(
&
wc
,
0
,
sizeof
wc
);
wc
.
cbSize
=
sizeof
wc
;
wc
.
style
=
CS_VREDRAW
|
CS_HREDRAW
;
wc
.
hInstance
=
GetModuleHandleA
(
0
);
wc
.
hCursor
=
LoadCursorA
(
NULL
,
IDC_ARROW
);
wc
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
wc
.
lpszClassName
=
cls_name
;
wc
.
lpfnWndProc
=
scroll_init_proc
;
RegisterClassExA
(
&
wc
);
for
(
i
=
0
;
i
<
sizeof
style
/
sizeof
style
[
0
];
i
++
)
{
/* need not to destroy these windows due creation abort */
CreateWindowExA
(
0
,
cls_name
,
NULL
,
style
[
i
],
100
,
100
,
100
,
100
,
NULL
,
NULL
,
wc
.
hInstance
,
(
LPVOID
)
TRUE
);
CreateWindowExA
(
0
,
cls_name
,
NULL
,
style
[
i
],
100
,
100
,
100
,
100
,
NULL
,
NULL
,
wc
.
hInstance
,
(
LPVOID
)
FALSE
);
}
UnregisterClassA
(
cls_name
,
wc
.
hInstance
);
}
START_TEST
(
scroll
)
{
WNDCLASSA
wc
;
...
...
@@ -444,6 +539,8 @@ START_TEST ( scroll )
scrollbar_test_default
(
WS_VSCROLL
);
scrollbar_test_default
(
WS_HSCROLL
|
WS_VSCROLL
);
scrollbar_test_init
();
DestroyWindow
(
hScroll
);
DestroyWindow
(
hMainWnd
);
}
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