imm32/tests: Terminate the thread cleanly.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2016-02-11 23:03:30 +09:00 committed by Alexandre Julliard
parent 1fb30e1cab
commit 2cd81c149d
1 changed files with 5 additions and 1 deletions

View File

@ -640,7 +640,10 @@ static void test_ImmThreads(void)
ImmReleaseContext(hwnd,himc); ImmReleaseContext(hwnd,himc);
SendMessageA(threadinfo.hwnd, WM_CLOSE, 0, 0); SendMessageA(threadinfo.hwnd, WM_CLOSE, 0, 0);
TerminateThread(hThread, 1); rc = PostThreadMessageA(dwThreadId, WM_QUIT, 1, 0);
ok(rc == 1, "PostThreadMessage should succeed\n");
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
himc = ImmGetContext(GetDesktopWindow()); himc = ImmGetContext(GetDesktopWindow());
ok(himc == NULL, "Should not be able to get himc from other process window\n"); ok(himc == NULL, "Should not be able to get himc from other process window\n");
@ -842,6 +845,7 @@ static void test_ImmDefaultHwnd(void)
WaitForSingleObject(thread, INFINITE); WaitForSingleObject(thread, INFINITE);
ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n"); ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n");
ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n"); ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n");
CloseHandle(thread);
ImmReleaseContext(hwnd, imc1); ImmReleaseContext(hwnd, imc1);
ImmReleaseContext(hwnd, imc3); ImmReleaseContext(hwnd, imc3);