From 8ef24f0fc1c962aa69ac2a1baec197abe3523068 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Mon, 5 Aug 2013 23:17:38 +0800 Subject: [PATCH 1/6] imm32/tests: Added more IMCC lock count tests. To: wine-patches Reply-To: wine-devel Cc: Qian Hong --- dlls/imm32/tests/imm32.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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); } -- 1.7.9.5