imm32: Add tests for ImmAssociateContextEx

André Hentschel nerv at dawncrow.de
Wed Apr 21 09:45:03 CDT 2010


---
 dlls/imm32/tests/imm32.c |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index ccbbc06..eeb8a01 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -307,6 +307,43 @@ static void test_ImmIME(void)
     ImmReleaseContext(hwnd,imc);
 }
 
+static void test_ImmAssociateContextEx(void)
+{
+    HIMC imc;
+    BOOL rc;
+
+    imc = ImmGetContext(hwnd);
+    if (imc)
+    {
+        HIMC retimc, newimc;
+
+        newimc = ImmCreateContext();
+        ok(newimc != imc, "handles should not be the same\n");
+        rc = ImmAssociateContextEx(NULL, NULL, 0);
+        ok(!rc, "ImmAssociateContextEx succeeded\n");
+        rc = ImmAssociateContextEx(hwnd, NULL, 0);
+        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        rc = ImmAssociateContextEx(NULL, imc, 0);
+        ok(!rc, "ImmAssociateContextEx succeeded\n");
+
+        rc = ImmAssociateContextEx(hwnd, imc, 0);
+        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        retimc = ImmGetContext(hwnd);
+        ok(retimc == imc, "handles should be the same\n");
+        ImmReleaseContext(hwnd,retimc);
+
+        rc = ImmAssociateContextEx(hwnd, newimc, 0);
+        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        retimc = ImmGetContext(hwnd);
+        todo_wine ok(retimc == newimc, "handles should be the same\n");
+        ImmReleaseContext(hwnd,retimc);
+
+        rc = ImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT);
+        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+    }
+    ImmReleaseContext(hwnd,imc);
+}
+
 START_TEST(imm32) {
     if (init())
     {
@@ -314,6 +351,7 @@ START_TEST(imm32) {
         test_ImmGetCompositionString();
         test_ImmSetCompositionString();
         test_ImmIME();
+        test_ImmAssociateContextEx();
     }
     cleanup();
 }
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list