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
be8534d3
Commit
be8534d3
authored
Feb 02, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add some tests for GetClassName() and versioned classes.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
51a0b4eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
class.c
dlls/user32/tests/class.c
+35
-5
No files found.
dlls/user32/tests/class.c
View file @
be8534d3
...
...
@@ -1211,12 +1211,15 @@ static void test_actctx_classes(void)
"<windowClass>MyTestClass</windowClass>"
"</file>"
"</assembly>"
;
static
const
char
*
testclass
=
"MyTestClass"
;
WNDCLASSA
wc
;
ULONG_PTR
cookie
;
HANDLE
context
;
BOOL
ret
;
ATOM
class
;
HINSTANCE
hinst
;
char
buff
[
64
];
HWND
hwnd
;
create_manifest_file
(
"main.manifest"
,
main_manifest
);
context
=
create_test_actctx
(
"main.manifest"
);
...
...
@@ -1228,29 +1231,56 @@ static void test_actctx_classes(void)
memset
(
&
wc
,
0
,
sizeof
(
wc
));
wc
.
lpfnWndProc
=
ClassTest_WndProc
;
wc
.
hIcon
=
LoadIconW
(
0
,
(
LPCWSTR
)
IDI_APPLICATION
);
wc
.
lpszClassName
=
"MyTestClass"
;
wc
.
lpszClassName
=
testclass
;
hinst
=
GetModuleHandleW
(
0
);
ret
=
GetClassInfoA
(
hinst
,
"MyTestClass"
,
&
wc
);
ret
=
GetClassInfoA
(
hinst
,
testclass
,
&
wc
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
class
=
RegisterClassA
(
&
wc
);
ok
(
class
!=
0
,
"Failed to register class.
\n
"
);
/* Class info is available by versioned and regular names. */
ret
=
GetClassInfoA
(
hinst
,
"MyTestClass"
,
&
wc
);
ret
=
GetClassInfoA
(
hinst
,
testclass
,
&
wc
);
ok
(
ret
,
"Failed to get class info.
\n
"
);
hwnd
=
CreateWindowExA
(
0
,
testclass
,
"test"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
hinst
,
0
);
ok
(
hwnd
!=
NULL
,
"Failed to create a window.
\n
"
);
ret
=
GetClassNameA
(
hwnd
,
buff
,
sizeof
(
buff
));
ok
(
ret
,
"Failed to get class name.
\n
"
);
todo_wine
ok
(
!
strcmp
(
buff
,
testclass
),
"Unexpected class name.
\n
"
);
ret
=
GetClassInfoA
(
hinst
,
"4.3.2.1!MyTestClass"
,
&
wc
);
ok
(
ret
,
"Failed to get class info.
\n
"
);
ret
=
UnregisterClassA
(
"MyTestClass"
,
hinst
);
ok
(
ret
,
"Failed to unregister class.
\n
"
);
ret
=
UnregisterClassA
(
testclass
,
hinst
);
ok
(
!
ret
,
"Failed to unregister class.
\n
"
);
ret
=
DeactivateActCtx
(
0
,
cookie
);
ok
(
ret
,
"Failed to deactivate context.
\n
"
);
ret
=
GetClassInfoA
(
hinst
,
testclass
,
&
wc
);
ok
(
!
ret
,
"Unexpected ret val %d.
\n
"
,
ret
);
ret
=
GetClassInfoA
(
hinst
,
"4.3.2.1!MyTestClass"
,
&
wc
);
ok
(
ret
,
"Failed to get class info.
\n
"
);
ret
=
GetClassNameA
(
hwnd
,
buff
,
sizeof
(
buff
));
ok
(
ret
,
"Failed to get class name.
\n
"
);
todo_wine
ok
(
!
strcmp
(
buff
,
testclass
),
"Unexpected class name.
\n
"
);
DestroyWindow
(
hwnd
);
ret
=
UnregisterClassA
(
"MyTestClass"
,
hinst
);
ok
(
!
ret
,
"Unexpected ret value %d.
\n
"
,
ret
);
ret
=
UnregisterClassA
(
"4.3.2.1!MyTestClass"
,
hinst
);
ok
(
ret
,
"Failed to unregister class.
\n
"
);
/* Register versioned class without active context. */
wc
.
lpszClassName
=
"4.3.2.1!MyTestClass"
;
class
=
RegisterClassA
(
&
wc
);
...
...
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