Qian Hong : imm32/tests: Added more IMCC lock count tests.

Alexandre Julliard julliard at winehq.org
Fri Aug 16 14:23:47 CDT 2013


Module: wine
Branch: master
Commit: 7822398d275eb11b42f6e0050965901982d17e89
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7822398d275eb11b42f6e0050965901982d17e89

Author: Qian Hong <qhong at codeweavers.com>
Date:   Mon Aug 12 22:09:54 2013 +0800

imm32/tests: Added more IMCC lock count tests.

---

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

diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 26101a4..2cdc662 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -715,7 +715,8 @@ static void test_ImmGetIMCLockCount(void)
 static void test_ImmGetIMCCLockCount(void)
 {
     HIMCC imcc;
-    DWORD count, ret;
+    DWORD count, g_count, ret, i;
+    VOID *p;
 
     imcc = ImmCreateIMCC(sizeof(CANDIDATEINFO));
     count = ImmGetIMCCLockCount(imcc);
@@ -731,6 +732,28 @@ static void test_ImmGetIMCCLockCount(void)
     ok(ret == FALSE, "expect FALSE, ret %d\n", ret);
     count = ImmGetIMCCLockCount(imcc);
     ok(count == 0, "expect 0, returned %d\n", count);
+
+    p = ImmLockIMCC(imcc);
+    todo_wine ok(GlobalHandle(p) == imcc, "expect %p, returned %p\n", imcc, GlobalHandle(p));
+
+    for (i = 0; i < GMEM_LOCKCOUNT * 2; i++)
+    {
+        ImmLockIMCC(imcc);
+        count = ImmGetIMCCLockCount(imcc);
+        g_count = GlobalFlags(imcc) & GMEM_LOCKCOUNT;
+        todo_wine ok(count == g_count, "count %d, g_count %d\n", count, g_count);
+    }
+    count = ImmGetIMCCLockCount(imcc);
+    todo_wine ok(count == GMEM_LOCKCOUNT, "expect GMEM_LOCKCOUNT, returned %d\n", count);
+
+    for (i = 0; i < GMEM_LOCKCOUNT - 1; i++)
+        GlobalUnlock(imcc);
+    count = ImmGetIMCCLockCount(imcc);
+    todo_wine ok(count == 1, "expect 1, returned %d\n", count);
+    GlobalUnlock(imcc);
+    count = ImmGetIMCCLockCount(imcc);
+    todo_wine ok(count == 0, "expect 0, returned %d\n", count);
+
     ImmDestroyIMCC(imcc);
 }
 




More information about the wine-cvs mailing list