[v2 2/3] user32/tests: Add test for EM_GETIMESTATUS and EM_SETIMESTATUS.
Kusanagi Kouichi
slash at ac.auone-net.jp
Fri Jan 15 23:54:14 CST 2010
v2
- Use win_skip instead of trace
- Fix failure on Vista
Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
dlls/user32/tests/Makefile.in | 2 +-
dlls/user32/tests/edit.c | 59 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletions(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in
index 013adf2..f6bed6a 100644
--- a/dlls/user32/tests/Makefile.in
+++ b/dlls/user32/tests/Makefile.in
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = user32.dll
-IMPORTS = user32 gdi32 advapi32 kernel32
+IMPORTS = user32 gdi32 advapi32 kernel32 imm32
CTESTS = \
broadcast.c \
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index 3b38d30..9ebda3f 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -2299,6 +2299,64 @@ static void test_dialogmode(void)
destroy_child_editcontrol(hwEdit);
}
+static void test_imestatus(void)
+{
+ HWND hwEdit;
+ LRESULT status;
+ HIMC imc;
+ static const WCHAR compstr[] = {'T', 'e', 's', 't'};
+ LONG len1, len2;
+
+ trace("EDIT: IMESTATUS\n");
+ hwEdit = create_editcontrol(ES_MULTILINE, 0);
+
+ status = SendMessage(hwEdit, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
+ ok(status == 0, "expected 0, got %#lx\n", (ULONG_PTR)status);
+
+ imc = ImmGetContext(hwEdit);
+ if (!imc)
+ {
+ win_skip("ImmGetContext is not implemented.\n");
+ DestroyWindow(hwEdit);
+ return;
+ }
+
+ ImmSetCompositionStringW(imc, SCS_SETSTR, compstr, sizeof compstr, NULL, 0);
+ SetFocus(hwEdit);
+ len1 = ImmGetCompositionStringW(imc, GCS_COMPSTR, NULL, 0);
+
+ SetFocus(NULL);
+ len2 = ImmGetCompositionStringW(imc, GCS_RESULTSTR, NULL, 0);
+ ok(len2 == 0, "expected 0, got %d\n", len2);
+
+ SetFocus(hwEdit);
+ len2 = ImmGetCompositionStringW(imc, GCS_COMPSTR, NULL, 0);
+ ok(len1 == len2, "expected %d, got %d\n", len1, len2);
+
+ SendMessage(hwEdit, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING,
+ EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS);
+ status = SendMessage(hwEdit, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
+ todo_wine
+ ok(status == (EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS),
+ "expected %#x, got %#lx\n",
+ EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS,
+ (ULONG_PTR)status);
+
+ SetFocus(NULL);
+ len2 = ImmGetCompositionStringW(imc, GCS_RESULTSTR, NULL, 0);
+ todo_wine
+ ok(len1 == len2, "expected %d, got %d\n", len1, len2);
+
+ ImmSetCompositionStringW(imc, SCS_SETSTR, compstr, sizeof compstr, NULL, 0);
+ SetFocus(hwEdit);
+ len2 = ImmGetCompositionStringW(imc, GCS_COMPSTR, NULL, 0);
+ todo_wine
+ ok(len2 == 0, "expected 0, got %d\n", len2);
+
+ ImmReleaseContext(hwEdit, imc);
+ DestroyWindow(hwEdit);
+}
+
START_TEST(edit)
{
hinst = GetModuleHandleA(NULL);
@@ -2325,6 +2383,7 @@ START_TEST(edit)
test_child_edit_wmkeydown();
test_fontsize();
test_dialogmode();
+ test_imestatus();
UnregisterWindowClasses();
}
--
1.6.6
More information about the wine-patches
mailing list