mfreadwrite/tests: Initialize COM only for tests that need it.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-02-21 15:34:58 +03:00 committed by Alexandre Julliard
parent b91fbb1c28
commit 4bca67bd47
1 changed files with 4 additions and 4 deletions

View File

@ -96,6 +96,8 @@ static void test_factory(void)
IMFReadWriteClassFactory *factory, *factory2;
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory,
(void **)&factory);
ok(hr == S_OK, "Failed to create class factory, hr %#x.\n", hr);
@ -105,14 +107,14 @@ static void test_factory(void)
ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#x.\n", hr);
IMFReadWriteClassFactory_Release(factory);
CoUninitialize();
}
START_TEST(mfplat)
{
HRESULT hr;
CoInitialize(NULL);
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
@ -122,6 +124,4 @@ START_TEST(mfplat)
test_factory();
MFShutdown();
CoUninitialize();
}