Commit 16d2a46b authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

imm32: Include a basic ImmGetCompositionString test checking ATTR lengths.

parent b17aa781
......@@ -220,8 +220,36 @@ static int test_ImmNotifyIME(void) {
return 0;
}
static int test_ImmGetCompositionString(void)
{
HIMC imc;
static const WCHAR string[] = {'w','i','n','e',0x65e5,0x672c,0x8a9e};
char cstring[20];
WCHAR wstring[20];
DWORD len;
DWORD alen,wlen;
imc = ImmGetContext(hwnd);
ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0);
alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20);
wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 20);
/* windows machines without any IME installed just return 0 above */
if( alen && wlen)
{
len = ImmGetCompositionStringW(imc, GCS_COMPATTR, NULL, 0);
ok(len*sizeof(WCHAR)==wlen,"GCS_COMPATTR(W) not returning correct count\n");
len = ImmGetCompositionStringA(imc, GCS_COMPATTR, NULL, 0);
ok(len==alen,"GCS_COMPATTR(A) not returning correct count\n");
}
ImmReleaseContext(hwnd, imc);
return 0;
}
START_TEST(imm32) {
if (init())
{
test_ImmNotifyIME();
test_ImmGetCompositionString();
}
cleanup();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment