[PATCH 0/1] MR3923: mfreadwrite/tests: Call CoInitialize at the start of tests.
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/mfreadwrite/tests/mfplat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index 42b58e878cb..4123d76fc77 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -571,8 +571,6 @@ 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, "Unexpected hr %#lx.\n", hr); @@ -582,8 +580,6 @@ static void test_factory(void) ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#lx.\n", hr); IMFReadWriteClassFactory_Release(factory); - - CoUninitialize(); } struct async_callback @@ -1531,6 +1527,8 @@ START_TEST(mfplat) { HRESULT hr; + CoInitialize(NULL); + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -1547,4 +1545,6 @@ START_TEST(mfplat) hr = MFShutdown(); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CoUninitialize(); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3923
I see, so it would've worked if new test was running after test_factory(). Could you just reorder them, with corresponding comment in the code, or commit message? So that we don't lose this information. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3923#note_46327
So you don't want the global CoInitialize? The tes_factory does a CoUninitialize so we mightt just end up in the same issue. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3923#note_46328
Following tests worked before this change, so I assumed it was enough. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3923#note_46329
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Nikolay Sivov (@nsivov)