Aric Stewart : imm32: Include a basic ImmGetCompositionString test checking ATTR lengths.
Alexandre Julliard
julliard at winehq.org
Tue Sep 16 06:54:28 CDT 2008
Module: wine
Branch: master
Commit: 16d2a46bc5214680c7941568a970341f011812ce
URL: http://source.winehq.org/git/wine.git/?a=commit;h=16d2a46bc5214680c7941568a970341f011812ce
Author: Aric Stewart <aric at codeweavers.com>
Date: Mon Sep 15 08:50:34 2008 -0500
imm32: Include a basic ImmGetCompositionString test checking ATTR lengths.
---
dlls/imm32/tests/imm32.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 591feb3..d0ced5f 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -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();
}
More information about the wine-cvs
mailing list