mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[IMM32_APITEST] Add clientimc testcase (#3815)
- Add clientimc testcase to imm32_apitest. - Add "precomp.h". CORE-11700
This commit is contained in:
parent
192981a1fe
commit
5a9c77b3be
6 changed files with 77 additions and 5 deletions
|
@ -1,5 +1,8 @@
|
|||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||
|
||||
list(APPEND SOURCE
|
||||
clientimc.c
|
||||
imcc.c
|
||||
testlist.c)
|
||||
|
||||
|
|
53
modules/rostests/apitests/imm32/clientimc.c
Normal file
53
modules/rostests/apitests/imm32/clientimc.c
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* PURPOSE: Test for imm32 ImmLockClientImc/ImmUnlockClientImc
|
||||
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#if 0
|
||||
static void DumpBinary(LPCVOID pv, size_t cb)
|
||||
{
|
||||
const BYTE *pb = pv;
|
||||
while (cb--)
|
||||
{
|
||||
printf("%02X ", (BYTE)*pb++);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
START_TEST(clientimc)
|
||||
{
|
||||
DWORD dwCode;
|
||||
CLIENTIMC *pClientImc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
|
||||
|
||||
pClientImc->hImc = (HIMC)ImmCreateIMCC(4);
|
||||
pClientImc->cLockObj = 2;
|
||||
pClientImc->dwFlags = 0x40;
|
||||
RtlInitializeCriticalSection(&pClientImc->cs);
|
||||
ok_long(ImmGetIMCCSize(pClientImc->hImc), 4);
|
||||
|
||||
ImmUnlockClientImc(pClientImc);
|
||||
ok_long(pClientImc->cLockObj, 1);
|
||||
ok_long(ImmGetIMCCSize(pClientImc->hImc), 4);
|
||||
|
||||
dwCode = 0;
|
||||
_SEH2_TRY
|
||||
{
|
||||
ImmUnlockClientImc(pClientImc);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
dwCode = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
ok_long(dwCode, STATUS_ACCESS_VIOLATION);
|
||||
|
||||
ok_long(pClientImc->cLockObj, 0);
|
||||
ok_long(ImmGetIMCCSize(pClientImc->hImc), 0);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, pClientImc);
|
||||
}
|
|
@ -5,11 +5,7 @@
|
|||
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
||||
*/
|
||||
|
||||
#include <ntstatus.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <imm.h>
|
||||
#include "wine/test.h"
|
||||
#include "precomp.h"
|
||||
|
||||
START_TEST(imcc)
|
||||
{
|
||||
|
|
15
modules/rostests/apitests/imm32/precomp.h
Normal file
15
modules/rostests/apitests/imm32/precomp.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <ntstatus.h>
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <imm.h>
|
||||
#include <ddk/imm.h>
|
||||
#include <pseh/pseh2.h>
|
||||
#include <ndk/umtypes.h>
|
||||
#include <ndk/pstypes.h>
|
||||
#include "../../../win32ss/include/ntuser.h"
|
||||
#include <imm32_undoc.h>
|
||||
#include <ndk/rtlfuncs.h>
|
||||
#include <wine/test.h>
|
||||
#include <stdio.h>
|
|
@ -2,10 +2,12 @@
|
|||
#define STANDALONE
|
||||
#include <wine/test.h>
|
||||
|
||||
extern void func_clientimc(void);
|
||||
extern void func_imcc(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "clientimc", func_clientimc },
|
||||
{ "imcc", func_imcc },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
|
|
@ -32,6 +32,9 @@ extern "C" {
|
|||
BOOL WINAPI
|
||||
ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey);
|
||||
|
||||
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc);
|
||||
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue