2019-11-18 03:18:40 +01:00
|
|
|
/*
|
|
|
|
* Speech API (SAPI) automation tests.
|
|
|
|
*
|
|
|
|
* Copyright 2019 Jactry Zeng for 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "sapiddk.h"
|
|
|
|
#include "sperror.h"
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
|
|
|
|
static void test_interfaces(void)
|
|
|
|
{
|
|
|
|
ISpeechFileStream *filestream;
|
|
|
|
ISpeechBaseStream *basestream;
|
|
|
|
IDispatch *dispatch;
|
2019-11-18 03:19:00 +01:00
|
|
|
ISpStream *spstrem;
|
2019-11-18 03:18:40 +01:00
|
|
|
IUnknown *unk;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_SpFileStream, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_ISpeechFileStream, (void **)&filestream);
|
2022-03-04 09:25:28 +01:00
|
|
|
ok(hr == S_OK, "Failed to create ISpeechFileStream interface: %#lx.\n", hr);
|
2019-11-18 03:18:40 +01:00
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_SpFileStream, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IUnknown, (void **)&unk);
|
2022-03-04 09:25:28 +01:00
|
|
|
ok(hr == S_OK, "Failed to create IUnknown interface: %#lx.\n", hr);
|
2019-11-18 03:18:40 +01:00
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_SpFileStream, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDispatch, (void **)&dispatch);
|
2022-03-04 09:25:28 +01:00
|
|
|
ok(hr == S_OK, "Failed to create IDispatch interface: %#lx.\n", hr);
|
2019-11-18 03:18:40 +01:00
|
|
|
IDispatch_Release(dispatch);
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_SpFileStream, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_ISpeechBaseStream, (void **)&basestream);
|
2022-03-04 09:25:28 +01:00
|
|
|
ok(hr == S_OK, "Failed to create ISpeechBaseStream interface: %#lx.\n", hr);
|
2019-11-18 03:18:40 +01:00
|
|
|
ISpeechBaseStream_Release(basestream);
|
|
|
|
|
2019-11-18 03:19:00 +01:00
|
|
|
hr = CoCreateInstance(&CLSID_SpFileStream, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_ISpStream, (void **)&spstrem);
|
2022-03-04 09:25:28 +01:00
|
|
|
ok(hr == S_OK, "Failed to create ISpStream interface: %#lx.\n", hr);
|
2019-11-18 03:19:00 +01:00
|
|
|
|
|
|
|
ISpStream_Release(spstrem);
|
2019-11-18 03:18:40 +01:00
|
|
|
ISpeechFileStream_Release(filestream);
|
|
|
|
}
|
|
|
|
|
|
|
|
START_TEST(automation)
|
|
|
|
{
|
|
|
|
CoInitialize(NULL);
|
|
|
|
test_interfaces();
|
|
|
|
CoUninitialize();
|
|
|
|
}
|