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
91bb0bf5
Commit
91bb0bf5
authored
Mar 31, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32/tests: Add some ImmGetCandidateListCount(W|A) tests.
parent
18d7be24
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
imm32.c
dlls/imm32/tests/imm32.c
+75
-0
No files found.
dlls/imm32/tests/imm32.c
View file @
91bb0bf5
...
...
@@ -5241,6 +5241,79 @@ cleanup:
winetest_pop_context
();
}
static
void
test_ImmGetCandidateListCount
(
BOOL
unicode
)
{
HKL
hkl
,
old_hkl
=
GetKeyboardLayout
(
0
);
CANDIDATEINFO
*
cand_info
;
INPUTCONTEXT
*
ctx
;
DWORD
count
;
HIMC
himc
;
winetest_push_context
(
unicode
?
"unicode"
:
"ansi"
);
/* IME_PROP_END_UNLOAD for the IME to unload / reload. */
ime_info
.
fdwProperty
=
IME_PROP_END_UNLOAD
;
if
(
unicode
)
ime_info
.
fdwProperty
|=
IME_PROP_UNICODE
;
if
(
!
(
hkl
=
ime_install
()))
goto
cleanup
;
hwnd
=
CreateWindowW
(
test_class
.
lpszClassName
,
NULL
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
100
,
100
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!!
hwnd
,
"CreateWindowW failed, error %lu
\n
"
,
GetLastError
()
);
ok_ret
(
1
,
ImmActivateLayout
(
hkl
)
);
ok_ret
(
1
,
ImmLoadIME
(
hkl
)
);
himc
=
ImmCreateContext
();
ok_ne
(
NULL
,
himc
,
HIMC
,
"%p"
);
ctx
=
ImmLockIMC
(
himc
);
ok_ne
(
NULL
,
ctx
,
INPUTCONTEXT
*
,
"%p"
);
process_messages
();
memset
(
ime_calls
,
0
,
sizeof
(
ime_calls
)
);
ime_call_count
=
0
;
ok_ret
(
144
,
ImmGetCandidateListCountW
(
default_himc
,
&
count
)
);
ok_eq
(
0
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
ok_ret
(
144
,
ImmGetCandidateListCountA
(
default_himc
,
&
count
)
);
ok_eq
(
0
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
ok_ret
(
144
,
ImmGetCandidateListCountW
(
himc
,
&
count
)
);
ok_eq
(
0
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
ok_ret
(
144
,
ImmGetCandidateListCountA
(
himc
,
&
count
)
);
ok_eq
(
0
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
cand_info
=
ImmLockIMCC
(
ctx
->
hCandInfo
);
ok
(
!!
cand_info
,
"ImmLockIMCC failed, error %lu
\n
"
,
GetLastError
()
);
cand_info
->
dwCount
=
1
;
ok_ret
(
0
,
ImmUnlockIMCC
(
ctx
->
hCandInfo
)
);
todo_wine_if
(
!
unicode
)
ok_ret
(
(
unicode
?
144
:
172
),
ImmGetCandidateListCountW
(
himc
,
&
count
)
);
ok_eq
(
1
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
todo_wine_if
(
unicode
)
ok_ret
(
(
unicode
?
172
:
144
),
ImmGetCandidateListCountA
(
himc
,
&
count
)
);
ok_eq
(
1
,
count
,
UINT
,
"%u"
);
ok_seq
(
empty_sequence
);
ok_ret
(
1
,
ImmUnlockIMC
(
himc
)
);
ok_ret
(
1
,
ImmDestroyContext
(
himc
)
);
ok_ret
(
1
,
ImmActivateLayout
(
old_hkl
)
);
ok_ret
(
1
,
DestroyWindow
(
hwnd
)
);
process_messages
();
ime_cleanup
(
hkl
,
TRUE
);
memset
(
ime_calls
,
0
,
sizeof
(
ime_calls
)
);
ime_call_count
=
0
;
cleanup:
winetest_pop_context
();
}
START_TEST
(
imm32
)
{
default_hkl
=
GetKeyboardLayout
(
0
);
...
...
@@ -5289,6 +5362,8 @@ START_TEST(imm32)
test_ImmGetCandidateList
(
TRUE
);
test_ImmGetCandidateList
(
FALSE
);
test_ImmGetCandidateListCount
(
TRUE
);
test_ImmGetCandidateListCount
(
FALSE
);
if
(
init
())
{
...
...
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