mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:35:41 +00:00
[IMM32_APITEST] Add himc testcase (#3965)
Add himc testcase. CORE-11700
This commit is contained in:
parent
e0da6437a1
commit
d6a0299eec
3 changed files with 116 additions and 1 deletions
|
@ -3,6 +3,7 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
clientimc.c
|
clientimc.c
|
||||||
|
himc.c
|
||||||
imcc.c
|
imcc.c
|
||||||
ImmIsUIMessage.c
|
ImmIsUIMessage.c
|
||||||
testlist.c)
|
testlist.c)
|
||||||
|
@ -10,5 +11,5 @@ list(APPEND SOURCE
|
||||||
add_executable(imm32_apitest ${SOURCE})
|
add_executable(imm32_apitest ${SOURCE})
|
||||||
target_link_libraries(imm32_apitest wine ${PSEH_LIB})
|
target_link_libraries(imm32_apitest wine ${PSEH_LIB})
|
||||||
set_module_type(imm32_apitest win32cui)
|
set_module_type(imm32_apitest win32cui)
|
||||||
add_importlibs(imm32_apitest imm32 msvcrt kernel32 ntdll)
|
add_importlibs(imm32_apitest imm32 msvcrt user32 kernel32 ntdll)
|
||||||
add_rostests_file(TARGET imm32_apitest)
|
add_rostests_file(TARGET imm32_apitest)
|
||||||
|
|
112
modules/rostests/apitests/imm32/himc.c
Normal file
112
modules/rostests/apitests/imm32/himc.c
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS api tests
|
||||||
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||||
|
* PURPOSE: Test for imm32 HIMC
|
||||||
|
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
START_TEST(himc)
|
||||||
|
{
|
||||||
|
DWORD style;
|
||||||
|
HWND hwndEdit, hwndStatic;
|
||||||
|
HIMC hNewIMC, hOldIMC, hIMC, hIMC1, hIMC2;
|
||||||
|
LPINPUTCONTEXT pIC;
|
||||||
|
|
||||||
|
/* ImmCreateContext/ImmDestroyContext and ImmLockIMC/ImmUnlockIMC */
|
||||||
|
hNewIMC = ImmCreateContext();
|
||||||
|
ok_int(hNewIMC != NULL, TRUE);
|
||||||
|
pIC = ImmLockIMC(hNewIMC);
|
||||||
|
ok_int(pIC == NULL, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
ok_int(ImmDestroyContext(hNewIMC), TRUE);
|
||||||
|
|
||||||
|
/* ImmGetContext against NULL */
|
||||||
|
hIMC = ImmGetContext(NULL);
|
||||||
|
ok_int(hIMC == NULL, TRUE);
|
||||||
|
|
||||||
|
/* Create EDIT control */
|
||||||
|
style = ES_MULTILINE | ES_LEFT;
|
||||||
|
hwndEdit = CreateWindowW(L"EDIT", NULL, style, 0, 0, 100, 20, NULL, NULL,
|
||||||
|
GetModuleHandleW(NULL), NULL);
|
||||||
|
ok_int(hwndEdit != NULL, TRUE);
|
||||||
|
|
||||||
|
/* Create STATIC control */
|
||||||
|
style = SS_LEFT;
|
||||||
|
hwndStatic = CreateWindowW(L"STATIC", NULL, style, 0, 30, 100, 20, NULL, NULL,
|
||||||
|
GetModuleHandleW(NULL), NULL);
|
||||||
|
ok_int(hwndStatic != NULL, TRUE);
|
||||||
|
|
||||||
|
/* ImmGetContext/ImmReleaseContext and ImmLockIMC/ImmUnlockIMC */
|
||||||
|
hIMC1 = hIMC = ImmGetContext(hwndEdit);
|
||||||
|
ok_int(hIMC != NULL, TRUE);
|
||||||
|
pIC = ImmLockIMC(hIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->hWnd == NULL, TRUE);
|
||||||
|
ok_int(pIC->fOpen, FALSE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCompStr) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCandInfo) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hGuideLine) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hPrivate) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hMsgBuf) != 0, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
SetFocus(hwndEdit);
|
||||||
|
pIC = ImmLockIMC(hIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->hWnd == hwndEdit, TRUE);
|
||||||
|
ok_int(pIC->fOpen, FALSE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
SetFocus(NULL);
|
||||||
|
pIC = ImmLockIMC(hIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->hWnd == hwndEdit, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
ok_int(ImmSetOpenStatus(hIMC, TRUE), TRUE);
|
||||||
|
pIC = ImmLockIMC(hIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->fOpen, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
ok_int(ImmReleaseContext(hwndEdit, hIMC), TRUE);
|
||||||
|
|
||||||
|
hIMC2 = hIMC = ImmGetContext(hwndStatic);
|
||||||
|
ok_int(hIMC != NULL, TRUE);
|
||||||
|
pIC = ImmLockIMC(hIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->hWnd == hwndEdit, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCompStr) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCandInfo) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hGuideLine) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hPrivate) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hMsgBuf) != 0, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
ok_int(ImmReleaseContext(hwndEdit, hIMC), TRUE);
|
||||||
|
|
||||||
|
ok_int(hIMC1 == hIMC2, TRUE);
|
||||||
|
|
||||||
|
/* ImmAssociateContext */
|
||||||
|
hNewIMC = ImmCreateContext();
|
||||||
|
ok_int(hNewIMC != NULL, TRUE);
|
||||||
|
pIC = ImmLockIMC(hNewIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
hOldIMC = ImmAssociateContext(hwndEdit, hNewIMC);
|
||||||
|
ok_int(hNewIMC != hOldIMC, TRUE);
|
||||||
|
hIMC = ImmGetContext(hwndEdit);
|
||||||
|
ok_int(hIMC == hNewIMC, TRUE);
|
||||||
|
ok_int(hIMC != hOldIMC, TRUE);
|
||||||
|
pIC = ImmLockIMC(hNewIMC);
|
||||||
|
ok_int(pIC != NULL, TRUE);
|
||||||
|
ok_int(pIC->hWnd == NULL, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCompStr) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hCandInfo) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hGuideLine) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hPrivate) != 0, TRUE);
|
||||||
|
ok_int(ImmGetIMCCSize(pIC->hMsgBuf) != 0, TRUE);
|
||||||
|
ImmUnlockIMC(hNewIMC);
|
||||||
|
ok_int(ImmReleaseContext(hwndEdit, hIMC), TRUE);
|
||||||
|
ok_int(ImmDestroyContext(hNewIMC), TRUE);
|
||||||
|
|
||||||
|
DestroyWindow(hwndEdit);
|
||||||
|
DestroyWindow(hwndStatic);
|
||||||
|
}
|
|
@ -3,12 +3,14 @@
|
||||||
#include <wine/test.h>
|
#include <wine/test.h>
|
||||||
|
|
||||||
extern void func_clientimc(void);
|
extern void func_clientimc(void);
|
||||||
|
extern void func_himc(void);
|
||||||
extern void func_imcc(void);
|
extern void func_imcc(void);
|
||||||
extern void func_ImmIsUIMessage(void);
|
extern void func_ImmIsUIMessage(void);
|
||||||
|
|
||||||
const struct test winetest_testlist[] =
|
const struct test winetest_testlist[] =
|
||||||
{
|
{
|
||||||
{ "clientimc", func_clientimc },
|
{ "clientimc", func_clientimc },
|
||||||
|
{ "himc", func_himc },
|
||||||
{ "imcc", func_imcc },
|
{ "imcc", func_imcc },
|
||||||
{ "ImmIsUIMessage", func_ImmIsUIMessage },
|
{ "ImmIsUIMessage", func_ImmIsUIMessage },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue