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
e193e43c
Commit
e193e43c
authored
Oct 10, 2012
by
Sergey Guralnik
Committed by
Alexandre Julliard
Oct 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add tests for class small icons.
parent
429e47f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
class.c
dlls/user32/tests/class.c
+58
-0
No files found.
dlls/user32/tests/class.c
View file @
e193e43c
...
...
@@ -977,6 +977,63 @@ if (0) { /* crashes under XP */
ok
(
wcx
.
lpfnWndProc
!=
NULL
,
"got null proc
\n
"
);
}
static
void
test_icons
(
void
)
{
WNDCLASSEXW
wcex
,
ret_wcex
;
WCHAR
cls_name
[]
=
{
'I'
,
'c'
,
'o'
,
'n'
,
'T'
,
'e'
,
's'
,
't'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
HWND
hwnd
;
HINSTANCE
hinst
=
GetModuleHandleW
(
0
);
HICON
hsmicon
,
hsmallnew
;
ICONINFO
icinf
;
memset
(
&
wcex
,
0
,
sizeof
wcex
);
wcex
.
cbSize
=
sizeof
wcex
;
wcex
.
lpfnWndProc
=
ClassTest_WndProc
;
wcex
.
hIcon
=
LoadIconW
(
0
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hInstance
=
hinst
;
wcex
.
lpszClassName
=
cls_name
;
ok
(
RegisterClassExW
(
&
wcex
),
"RegisterClassExW returned 0
\n
"
);
hwnd
=
CreateWindowExW
(
0
,
cls_name
,
NULL
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
0
,
0
,
NULL
,
NULL
,
hinst
,
0
);
ok
(
hwnd
!=
NULL
,
"Window was not created
\n
"
);
ok
(
GetClassInfoExW
(
hinst
,
cls_name
,
&
ret_wcex
),
"Class info was not retrieved
\n
"
);
ok
(
wcex
.
hIcon
==
ret_wcex
.
hIcon
,
"Icons don't match
\n
"
);
todo_wine
ok
(
ret_wcex
.
hIconSm
!=
NULL
,
"hIconSm should be non-zero handle
\n
"
);
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
hsmallnew
=
CopyImage
(
wcex
.
hIcon
,
IMAGE_ICON
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
0
);
ok
(
!
SetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
,
(
LONG_PTR
)
hsmallnew
),
"Previous hIconSm should be zero
\n
"
);
ok
(
hsmallnew
==
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
),
"Should return explicitly assigned small icon"
);
ok
(
!
GetIconInfo
(
hsmicon
,
&
icinf
),
"Previous small icon should be destroyed
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
,
0
);
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_HICON
,
0
);
ok
(
!
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
),
"GetClassLong should return zero handle
\n
"
);
SetClassLongPtrW
(
hwnd
,
GCLP_HICON
,
(
LONG_PTR
)
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_QUESTION
));
hsmicon
=
(
HICON
)
GetClassLongPtrW
(
hwnd
,
GCLP_HICONSM
);
todo_wine
ok
(
hsmicon
!=
NULL
,
"GetClassLong should return non-zero handle
\n
"
);
UnregisterClassW
(
cls_name
,
hinst
);
todo_wine
ok
(
GetIconInfo
(
hsmicon
,
&
icinf
),
"Icon should NOT be destroyed
\n
"
);
DestroyIcon
(
hsmallnew
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
class
)
{
HANDLE
hInstance
=
GetModuleHandleA
(
NULL
);
...
...
@@ -995,6 +1052,7 @@ START_TEST(class)
CreateDialogParamTest
(
hInstance
);
test_styles
();
test_builtinproc
();
test_icons
();
/* this test unregisters the Button class so it should be executed at the end */
test_instances
();
...
...
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