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
699ef11d
Commit
699ef11d
authored
Apr 22, 2010
by
André Hentschel
Committed by
Alexandre Julliard
Apr 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Add tests for ImmAssociateContextEx.
parent
15daa84b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
5 deletions
+51
-5
imm32.c
dlls/imm32/tests/imm32.c
+51
-5
No files found.
dlls/imm32/tests/imm32.c
View file @
699ef11d
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
#define NUMELEMS(array) (sizeof((array))/sizeof((array)[0]))
#define NUMELEMS(array) (sizeof((array))/sizeof((array)[0]))
static
BOOL
(
WINAPI
*
pImmAssociateContextEx
)(
HWND
,
HIMC
,
DWORD
);
/*
/*
* msgspy - record and analyse message traces sent to a certain window
* msgspy - record and analyse message traces sent to a certain window
*/
*/
...
@@ -133,9 +135,13 @@ static void msg_spy_cleanup(void) {
...
@@ -133,9 +135,13 @@ static void msg_spy_cleanup(void) {
static
const
char
wndcls
[]
=
"winetest_imm32_wndcls"
;
static
const
char
wndcls
[]
=
"winetest_imm32_wndcls"
;
static
HWND
hwnd
;
static
HWND
hwnd
;
static
int
init
(
void
)
{
static
BOOL
init
(
void
)
{
WNDCLASSEX
wc
;
WNDCLASSEX
wc
;
HIMC
imc
;
HIMC
imc
;
HMODULE
hmod
;
hmod
=
GetModuleHandleA
(
"imm32.dll"
);
pImmAssociateContextEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"ImmAssociateContextEx"
);
wc
.
cbSize
=
sizeof
(
WNDCLASSEX
);
wc
.
cbSize
=
sizeof
(
WNDCLASSEX
);
wc
.
style
=
0
;
wc
.
style
=
0
;
...
@@ -151,19 +157,19 @@ static int init(void) {
...
@@ -151,19 +157,19 @@ static int init(void) {
wc
.
hIconSm
=
LoadIcon
(
NULL
,
IDI_APPLICATION
);
wc
.
hIconSm
=
LoadIcon
(
NULL
,
IDI_APPLICATION
);
if
(
!
RegisterClassExA
(
&
wc
))
if
(
!
RegisterClassExA
(
&
wc
))
return
0
;
return
FALSE
;
hwnd
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
wndcls
,
"Wine imm32.dll test"
,
hwnd
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
wndcls
,
"Wine imm32.dll test"
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
240
,
120
,
NULL
,
NULL
,
GetModuleHandle
(
0
),
NULL
);
240
,
120
,
NULL
,
NULL
,
GetModuleHandle
(
0
),
NULL
);
if
(
!
hwnd
)
if
(
!
hwnd
)
return
0
;
return
FALSE
;
imc
=
ImmGetContext
(
hwnd
);
imc
=
ImmGetContext
(
hwnd
);
if
(
!
imc
)
if
(
!
imc
)
{
{
win_skip
(
"IME support not implemented
\n
"
);
win_skip
(
"IME support not implemented
\n
"
);
return
0
;
return
FALSE
;
}
}
ImmReleaseContext
(
hwnd
,
imc
);
ImmReleaseContext
(
hwnd
,
imc
);
...
@@ -172,7 +178,7 @@ static int init(void) {
...
@@ -172,7 +178,7 @@ static int init(void) {
msg_spy_init
(
hwnd
);
msg_spy_init
(
hwnd
);
return
1
;
return
TRUE
;
}
}
static
void
cleanup
(
void
)
{
static
void
cleanup
(
void
)
{
...
@@ -307,6 +313,45 @@ static void test_ImmIME(void)
...
@@ -307,6 +313,45 @@ static void test_ImmIME(void)
ImmReleaseContext
(
hwnd
,
imc
);
ImmReleaseContext
(
hwnd
,
imc
);
}
}
static
void
test_ImmAssociateContextEx
(
void
)
{
HIMC
imc
;
BOOL
rc
;
if
(
!
pImmAssociateContextEx
)
return
;
imc
=
ImmGetContext
(
hwnd
);
if
(
imc
)
{
HIMC
retimc
,
newimc
;
newimc
=
ImmCreateContext
();
ok
(
newimc
!=
imc
,
"handles should not be the same
\n
"
);
rc
=
pImmAssociateContextEx
(
NULL
,
NULL
,
0
);
ok
(
!
rc
,
"ImmAssociateContextEx succeeded
\n
"
);
rc
=
pImmAssociateContextEx
(
hwnd
,
NULL
,
0
);
todo_wine
ok
(
rc
,
"ImmAssociateContextEx failed
\n
"
);
rc
=
pImmAssociateContextEx
(
NULL
,
imc
,
0
);
ok
(
!
rc
,
"ImmAssociateContextEx succeeded
\n
"
);
rc
=
pImmAssociateContextEx
(
hwnd
,
imc
,
0
);
todo_wine
ok
(
rc
,
"ImmAssociateContextEx failed
\n
"
);
retimc
=
ImmGetContext
(
hwnd
);
ok
(
retimc
==
imc
,
"handles should be the same
\n
"
);
ImmReleaseContext
(
hwnd
,
retimc
);
rc
=
pImmAssociateContextEx
(
hwnd
,
newimc
,
0
);
todo_wine
ok
(
rc
,
"ImmAssociateContextEx failed
\n
"
);
retimc
=
ImmGetContext
(
hwnd
);
todo_wine
ok
(
retimc
==
newimc
,
"handles should be the same
\n
"
);
ImmReleaseContext
(
hwnd
,
retimc
);
rc
=
pImmAssociateContextEx
(
hwnd
,
NULL
,
IACE_DEFAULT
);
ok
(
rc
,
"ImmAssociateContextEx failed
\n
"
);
}
ImmReleaseContext
(
hwnd
,
imc
);
}
START_TEST
(
imm32
)
{
START_TEST
(
imm32
)
{
if
(
init
())
if
(
init
())
{
{
...
@@ -314,6 +359,7 @@ START_TEST(imm32) {
...
@@ -314,6 +359,7 @@ START_TEST(imm32) {
test_ImmGetCompositionString
();
test_ImmGetCompositionString
();
test_ImmSetCompositionString
();
test_ImmSetCompositionString
();
test_ImmIME
();
test_ImmIME
();
test_ImmAssociateContextEx
();
}
}
cleanup
();
cleanup
();
}
}
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