2 * Unit tests for ITfInputProcessor
4 * Copyright 2009 Aric Stewart, CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/test.h"
32 static ITfInputProcessorProfiles* g_ipp;
33 static LANGID gLangid;
35 DEFINE_GUID(CLSID_FakeService, 0xEDE1A7AD,0x66DE,0x47E0,0xB6,0x20,0x3E,0x92,0xF8,0x24,0x6B,0xF3);
37 static HRESULT initialize(void)
41 hr = CoCreateInstance (&CLSID_TF_InputProcessorProfiles, NULL,
42 CLSCTX_INPROC_SERVER, &IID_ITfInputProcessorProfiles, (void**)&g_ipp);
46 static void cleanup(void)
49 ITfInputProcessorProfiles_Release(g_ipp);
53 static void test_Register(void)
57 static const WCHAR szDesc[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',0};
58 static const WCHAR szFile[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',' ','F','i','l','e',0};
60 hr = ITfInputProcessorProfiles_Register(g_ipp, &CLSID_FakeService);
61 ok(SUCCEEDED(hr),"Unable to register text service(%x)\n",hr);
62 hr = ITfInputProcessorProfiles_AddLanguageProfile(g_ipp, &CLSID_FakeService, gLangid, &CLSID_FakeService, szDesc, sizeof(szDesc)/sizeof(WCHAR), szFile, sizeof(szFile)/sizeof(WCHAR), 1);
63 ok(SUCCEEDED(hr),"Unable to add Language Profile (%x)\n",hr);
66 static void test_Unregister(void)
69 hr = ITfInputProcessorProfiles_Unregister(g_ipp, &CLSID_FakeService);
70 todo_wine ok(SUCCEEDED(hr),"Unable to unregister text service(%x)\n",hr);
73 START_TEST(inputprocessor)
75 if (SUCCEEDED(initialize()))
77 gLangid = GetUserDefaultLCID();
82 skip("Unable to create InputProcessor\n");