https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d066dae7d9a396c1c000e…
commit d066dae7d9a396c1c000ea87225a3718d10b6322
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Jul 10 00:05:43 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Jul 10 00:05:43 2021 +0900
[IMM32_APITEST] Add imm32_apitest test program (#3810)
Add a test program for imm32.dll as a proof of concept. CORE-11700
---
modules/rostests/apitests/CMakeLists.txt | 1 +
modules/rostests/apitests/imm32/CMakeLists.txt | 10 ++++++++
modules/rostests/apitests/imm32/imcc.c | 33 ++++++++++++++++++++++++++
modules/rostests/apitests/imm32/testlist.c | 11 +++++++++
4 files changed, 55 insertions(+)
diff --git a/modules/rostests/apitests/CMakeLists.txt
b/modules/rostests/apitests/CMakeLists.txt
index 7c1ff8120ed..b9f10c04120 100644
--- a/modules/rostests/apitests/CMakeLists.txt
+++ b/modules/rostests/apitests/CMakeLists.txt
@@ -23,6 +23,7 @@ add_subdirectory(dnsapi)
add_subdirectory(fontext)
add_subdirectory(gdi32)
add_subdirectory(gditools)
+add_subdirectory(imm32)
add_subdirectory(iphlpapi)
add_subdirectory(kernel32)
add_subdirectory(loadconfig)
diff --git a/modules/rostests/apitests/imm32/CMakeLists.txt
b/modules/rostests/apitests/imm32/CMakeLists.txt
new file mode 100644
index 00000000000..7e5e1223d7b
--- /dev/null
+++ b/modules/rostests/apitests/imm32/CMakeLists.txt
@@ -0,0 +1,10 @@
+
+list(APPEND SOURCE
+ imcc.c
+ testlist.c)
+
+add_executable(imm32_apitest ${SOURCE})
+target_link_libraries(imm32_apitest wine ${PSEH_LIB})
+set_module_type(imm32_apitest win32cui)
+add_importlibs(imm32_apitest imm32 msvcrt kernel32 ntdll)
+add_rostests_file(TARGET imm32_apitest)
diff --git a/modules/rostests/apitests/imm32/imcc.c
b/modules/rostests/apitests/imm32/imcc.c
new file mode 100644
index 00000000000..230222be263
--- /dev/null
+++ b/modules/rostests/apitests/imm32/imcc.c
@@ -0,0 +1,33 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Test for imm32 IMCC
+ * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
+ */
+
+#include <ntstatus.h>
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <imm.h>
+#include "wine/test.h"
+
+START_TEST(imcc)
+{
+ HIMCC hImcc;
+ DWORD i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ hImcc = ImmCreateIMCC(i);
+ ok_long(LocalSize(hImcc), 4);
+ ok_long(ImmGetIMCCSize(hImcc), 4);
+ ok_long(ImmGetIMCCLockCount(hImcc), (LocalFlags(hImcc) & LMEM_LOCKCOUNT));
+ ImmDestroyIMCC(hImcc);
+ }
+
+ hImcc = ImmCreateIMCC(5);
+ ok_long(LocalSize(hImcc), 5);
+ ok_long(ImmGetIMCCSize(hImcc), 5);
+ ok_long(ImmGetIMCCLockCount(hImcc), (LocalFlags(hImcc) & LMEM_LOCKCOUNT));
+ ImmDestroyIMCC(hImcc);
+}
diff --git a/modules/rostests/apitests/imm32/testlist.c
b/modules/rostests/apitests/imm32/testlist.c
new file mode 100644
index 00000000000..15f00bfca65
--- /dev/null
+++ b/modules/rostests/apitests/imm32/testlist.c
@@ -0,0 +1,11 @@
+
+#define STANDALONE
+#include <wine/test.h>
+
+extern void func_imcc(void);
+
+const struct test winetest_testlist[] =
+{
+ { "imcc", func_imcc },
+ { 0, 0 }
+};