sapi: Add SpMMAudioOut stub.
[wine.git] / dlls / sapi / tests / mmaudio.c
blob5dd0d91ab1d5d19c578f24cc5c68847f8fc01024
1 /*
2 * Speech API (SAPI) winmm audio tests.
4 * Copyright 2023 Shaun Ren for 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
21 #define COBJMACROS
23 #include "sapiddk.h"
24 #include "sperror.h"
26 #include "wine/test.h"
28 static void test_interfaces(void)
30 ISpMMSysAudio *mmaudio;
31 IUnknown *unk;
32 ISpEventSource *source;
33 ISpEventSink *sink;
34 ISpObjectWithToken *obj_with_token;
35 HRESULT hr;
37 hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
38 &IID_ISpMMSysAudio, (void **)&mmaudio);
39 ok(hr == S_OK, "Failed to create ISpMMSysAudio interface: %#lx.\n", hr);
40 ISpMMSysAudio_Release(mmaudio);
42 hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
43 &IID_IUnknown, (void **)&unk);
44 ok(hr == S_OK, "Failed to create IUnknown interface: %#lx.\n", hr);
45 IUnknown_Release(unk);
47 hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
48 &IID_ISpEventSource, (void **)&source);
49 ok(hr == S_OK, "Failed to create ISpEventSource interface: %#lx.\n", hr);
50 ISpEventSource_Release(source);
52 hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
53 &IID_ISpEventSink, (void **)&sink);
54 ok(hr == S_OK, "Failed to create ISpEventSink interface: %#lx.\n", hr);
55 ISpEventSink_Release(sink);
57 hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER,
58 &IID_ISpObjectWithToken, (void **)&obj_with_token);
59 ok(hr == S_OK, "Failed to create ISpObjectWithToken interface: %#lx.\n", hr);
60 ISpObjectWithToken_Release(obj_with_token);
63 START_TEST(mmaudio)
65 CoInitialize(NULL);
66 test_interfaces();
67 CoUninitialize();