msctf: Added msctf tests.

This commit is contained in:
Aric Stewart 2009-02-17 10:40:34 -06:00 committed by Alexandre Julliard
parent f936832595
commit 64ae0000b6
4 changed files with 107 additions and 0 deletions

9
configure vendored
View File

@ -25827,6 +25827,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/msctf/Makefile: dlls/msctf/Makefile.in dlls/Makedll.rules" dlls/msctf/Makefile: dlls/msctf/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/msctf/Makefile" ac_config_files="$ac_config_files dlls/msctf/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/msctf/tests/Makefile"
test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\
msctf/tests"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/msctf/tests/Makefile: dlls/msctf/tests/Makefile.in dlls/Maketest.rules"
ac_config_files="$ac_config_files dlls/msctf/tests/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\ ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/msdmo/Makefile" dlls/msdmo/Makefile"
test "x$enable_msdmo" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ test "x$enable_msdmo" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@ -28794,6 +28802,7 @@ do
"dlls/mscms/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/mscms/tests/Makefile" ;; "dlls/mscms/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/mscms/tests/Makefile" ;;
"dlls/mscoree/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/mscoree/Makefile" ;; "dlls/mscoree/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/mscoree/Makefile" ;;
"dlls/msctf/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msctf/Makefile" ;; "dlls/msctf/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msctf/Makefile" ;;
"dlls/msctf/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msctf/tests/Makefile" ;;
"dlls/msdmo/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msdmo/Makefile" ;; "dlls/msdmo/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msdmo/Makefile" ;;
"dlls/msftedit/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msftedit/Makefile" ;; "dlls/msftedit/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msftedit/Makefile" ;;
"dlls/msg711.acm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msg711.acm/Makefile" ;; "dlls/msg711.acm/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msg711.acm/Makefile" ;;

View File

@ -2059,6 +2059,7 @@ WINE_CONFIG_MAKEFILE([dlls/mscms/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_
WINE_CONFIG_MAKEFILE([dlls/mscms/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/mscms/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/mscoree/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mscoree/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/msctf/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msctf/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/msctf/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/msdmo/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msdmo/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/msftedit/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msftedit/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/msg711.acm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msg711.acm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = msctf.dll
IMPORTS = uuid ole32 user32 kernel32
CTESTS = \
inputprocessor.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -0,0 +1,84 @@
/*
* Unit tests for ITfInputProcessor
*
* Copyright 2009 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#define COBJMACROS
#include "wine/test.h"
#include "winuser.h"
#include "shlwapi.h"
#include "shlguid.h"
#include "comcat.h"
#include "initguid.h"
#include "msctf.h"
static ITfInputProcessorProfiles* g_ipp;
static LANGID gLangid;
DEFINE_GUID(CLSID_FakeService, 0xEDE1A7AD,0x66DE,0x47E0,0xB6,0x20,0x3E,0x92,0xF8,0x24,0x6B,0xF3);
static HRESULT initialize(void)
{
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance (&CLSID_TF_InputProcessorProfiles, NULL,
CLSCTX_INPROC_SERVER, &IID_ITfInputProcessorProfiles, (void**)&g_ipp);
return hr;
}
static void cleanup(void)
{
if (g_ipp)
ITfInputProcessorProfiles_Release(g_ipp);
CoUninitialize();
}
static void test_Register(void)
{
HRESULT hr;
static const WCHAR szDesc[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',0};
static const WCHAR szFile[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',' ','F','i','l','e',0};
hr = ITfInputProcessorProfiles_Register(g_ipp, &CLSID_FakeService);
ok(SUCCEEDED(hr),"Unable to register text service(%x)\n",hr);
hr = ITfInputProcessorProfiles_AddLanguageProfile(g_ipp, &CLSID_FakeService, gLangid, &CLSID_FakeService, szDesc, sizeof(szDesc)/sizeof(WCHAR), szFile, sizeof(szFile)/sizeof(WCHAR), 1);
ok(SUCCEEDED(hr),"Unable to add Language Profile (%x)\n",hr);
}
static void test_Unregister(void)
{
HRESULT hr;
hr = ITfInputProcessorProfiles_Unregister(g_ipp, &CLSID_FakeService);
todo_wine ok(SUCCEEDED(hr),"Unable to unregister text service(%x)\n",hr);
}
START_TEST(inputprocessor)
{
if (SUCCEEDED(initialize()))
{
gLangid = GetUserDefaultLCID();
test_Register();
test_Unregister();
}
else
skip("Unable to create InputProcessor\n");
cleanup();
}