sapi: Add SpMMAudioOut stub.
[wine.git] / dlls / sapi / tests / resource.c
blob0cedaa8b92846ff6e37e5742468aba5ec5022253
1 /*
2 * Speech API (SAPI) resource manager tests.
4 * Copyright 2020 Gijs Vermeulen
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
21 #define COBJMACROS
23 #include "sapiddk.h"
24 #include "sperror.h"
26 #include "wine/test.h"
28 static void test_interfaces(void)
30 ISpResourceManager *resource_manager, *resource_manager2;
31 IDispatch *dispatch;
32 IUnknown *unk;
33 HRESULT hr;
35 hr = CoCreateInstance(&CLSID_SpResourceManager, NULL, CLSCTX_INPROC_SERVER,
36 &IID_ISpResourceManager, (void **)&resource_manager);
37 ok(hr == S_OK, "Failed to create ISpeechVoice interface: %#lx.\n", hr);
38 ok(!!resource_manager, "Expected non-NULL resource manager.\n");
40 hr = CoCreateInstance(&CLSID_SpResourceManager, NULL, CLSCTX_INPROC_SERVER,
41 &IID_ISpResourceManager, (void **)&resource_manager2);
42 ok(hr == S_OK, "Failed to create ISpeechVoice interface: %#lx.\n", hr);
43 ok(!!resource_manager2, "Expected non-NULL resource manager.\n");
44 todo_wine ok(resource_manager2 == resource_manager, "Expected managers to match.\n");
45 ISpResourceManager_Release(resource_manager2);
47 hr = CoCreateInstance(&CLSID_SpResourceManager, NULL, CLSCTX_INPROC_SERVER,
48 &IID_IUnknown, (void **)&unk);
49 ok(hr == S_OK, "Failed to create IUnknown interface: %#lx.\n", hr);
50 ok(!!unk, "Expected non-NULL unk.\n");
51 todo_wine ok(unk == (IUnknown *)resource_manager, "Expected unk to match existing manager.\n");
52 IUnknown_Release(unk);
54 hr = CoCreateInstance(&CLSID_SpResourceManager, NULL, CLSCTX_INPROC_SERVER,
55 &IID_IDispatch, (void **)&dispatch);
56 ok(hr == E_NOINTERFACE, "Succeeded to create IDispatch interface: %#lx.\n", hr);
57 ok(!dispatch, "Expected NULL dispatch, got %p.", dispatch);
59 ISpResourceManager_Release(resource_manager);
62 START_TEST(resource)
64 CoInitialize(NULL);
65 test_interfaces();
66 CoUninitialize();