[PATCH v4 0/5] MR708: windows.media.speech: Fix test breakage and misc changes.
Created a new MR, because the mailing bridge wouldn't trigger on force pushes. -- v4: windows.media.speech/tests: Skip SpeechRecognitionListConstraint tests on Win10 1709 x32 and below. windows.media.speech/tests: Add basic query tests for SpeechSynthesizerOptions. include/windows.media.speechsynthesis.idl: Add missing interfaces to SpeechSynthesizerOptions runtimeclass. windows.media.speech: Add missing async_void_Release implementation. https://gitlab.winehq.org/wine/wine/-/merge_requests/708
From: Bernhard K��lbl <besentv(a)gmail.com> They can fail, when the recognition session outlives the test function, which is expected to happen, as the session is concurrent. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53458 --- dlls/windows.media.speech/tests/speech.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 0d67c8b7cdb..75f0007089e 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1777,17 +1777,10 @@ skip_action: hr = ISpeechContinuousRecognitionSession_remove_ResultGenerated(session, token); ok(hr == S_OK, "ISpeechContinuousRecognitionSession_remove_ResultGenerated failed, hr %#lx.\n", hr); - ref = ISpeechContinuousRecognitionSession_Release(session); - ok(ref == 1, "Got unexpected ref %lu.\n", ref); - - ref = ISpeechRecognizer2_Release(recognizer2); - ok(ref == 2, "Got unexpected ref %lu.\n", ref); - - ref = ISpeechRecognizer_Release(recognizer); - ok(ref == 1, "Got unexpected ref %lu.\n", ref); - - ref = IInspectable_Release(inspectable); - ok(!ref, "Got unexpected ref %lu.\n", ref); + ISpeechContinuousRecognitionSession_Release(session); + ISpeechRecognizer2_Release(recognizer2); + ISpeechRecognizer_Release(recognizer); + IInspectable_Release(inspectable); done: for (i = 0; i < ARRAY_SIZE(commands); i++) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/708
From: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> --- dlls/windows.media.speech/async.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c index 5d20fe482f1..782fcddbfa9 100644 --- a/dlls/windows.media.speech/async.c +++ b/dlls/windows.media.speech/async.c @@ -93,6 +93,21 @@ ULONG WINAPI async_void_Release( IAsyncAction *iface ) struct async_void *impl = impl_from_IAsyncAction(iface); ULONG ref = InterlockedDecrement(&impl->ref); TRACE("iface %p, ref %lu.\n", iface, ref); + + if (!ref) + { + IAsyncInfo_Close(&impl->IAsyncInfo_iface); + + if (impl->invoker) + IInspectable_Release(impl->invoker); + if (impl->handler && impl->handler != HANDLER_NOT_SET) + IAsyncActionCompletedHandler_Release(impl->handler); + + impl->cs.DebugInfo->Spare[0] = NULL; + DeleteCriticalSection(&impl->cs); + free(impl); + } + return ref; } @@ -127,7 +142,7 @@ HRESULT WINAPI async_void_put_Completed( IAsyncAction *iface, IAsyncActionComple else if (impl->handler != HANDLER_NOT_SET) hr = E_ILLEGAL_DELEGATE_ASSIGNMENT; /* - impl->handler can only be set once with async_operation_put_Completed, + impl->handler can only be set once with async_void_put_Completed, so by default we set a non HANDLER_NOT_SET value, in this case handler. */ else if ((impl->handler = handler)) @@ -445,6 +460,7 @@ static ULONG WINAPI async_inspectable_Release( IAsyncOperation_IInspectable *ifa if (impl->result) IInspectable_Release(impl->result); + impl->cs.DebugInfo->Spare[0] = NULL; DeleteCriticalSection(&impl->cs); free(impl); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/708
From: Bernhard K��lbl <besentv(a)gmail.com> And their dependencies. --- include/windows.media.speechsynthesis.idl | 57 ++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl index c4a0eb06106..135cc8f3765 100644 --- a/include/windows.media.speechsynthesis.idl +++ b/include/windows.media.speechsynthesis.idl @@ -27,11 +27,16 @@ import "windows.storage.streams.idl"; namespace Windows.Media.SpeechSynthesis { + typedef enum SpeechAppendedSilence SpeechAppendedSilence; + typedef enum SpeechPunctuationSilence SpeechPunctuationSilence; typedef enum VoiceGender VoiceGender; interface IInstalledVoicesStatic; interface IInstalledVoicesStatic2; interface ISpeechSynthesizer; interface ISpeechSynthesizer2; + interface ISpeechSynthesizerOptions; + interface ISpeechSynthesizerOptions2; + interface ISpeechSynthesizerOptions3; interface IVoiceInformation; interface ISpeechSynthesisStream; runtimeclass SpeechSynthesizer; @@ -48,6 +53,24 @@ namespace Windows.Media.SpeechSynthesis interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*>; } + [ + contract(Windows.Foundation.UniversalApiContract, 6.0) + ] + enum SpeechAppendedSilence + { + Default = 0, + Min = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0) + ] + enum SpeechPunctuationSilence + { + Default = 0, + Min = 1, + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0) ] @@ -112,7 +135,7 @@ namespace Windows.Media.SpeechSynthesis } [ - contract(Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 4.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), uuid(a0e23871-cc3d-43c9-91b1-ee185324d83d) ] @@ -124,6 +147,34 @@ namespace Windows.Media.SpeechSynthesis [propput] HRESULT IncludeSentenceBoundaryMetadata([in] boolean value); } + [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), + uuid(1cbef60e-119c-4bed-b118-d250c3a25793), + ] + interface ISpeechSynthesizerOptions2 : IInspectable + { + [propget] HRESULT AudioVolume([out, retval] DOUBLE *value); + [propput] HRESULT AudioVolume([in] DOUBLE value); + [propget] HRESULT SpeakingRate([out, retval] DOUBLE *value); + [propput] HRESULT SpeakingRate([in] DOUBLE value); + [propget] HRESULT AudioPitch([out, retval] DOUBLE *value); + [propput] HRESULT AudioPitch([in] DOUBLE value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), + uuid(401ed877-902c-4814-a582-a5d0c0769fa8) + ] + interface ISpeechSynthesizerOptions3 : IInspectable + { + [propget] HRESULT AppendedSilence([out, retval] Windows.Media.SpeechSynthesis.SpeechAppendedSilence *value); + [propput] HRESULT AppendedSilence([in] Windows.Media.SpeechSynthesis.SpeechAppendedSilence value); + [propget] HRESULT PunctuationSilence([out, retval] Windows.Media.SpeechSynthesis.SpeechPunctuationSilence *value); + [propput] HRESULT PunctuationSilence([in] Windows.Media.SpeechSynthesis.SpeechPunctuationSilence value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer), @@ -145,12 +196,14 @@ namespace Windows.Media.SpeechSynthesis } [ - contract(Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 4.0), marshaling_behavior(agile) ] runtimeclass SpeechSynthesizerOptions { [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions; + [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions2; + [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions3; } [ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/708
From: Bernhard K��lbl <besentv(a)gmail.com> --- dlls/windows.media.speech/tests/speech.c | 33 +++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 75f0007089e..339f57190ad 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -73,8 +73,9 @@ static inline void check_refcount_(unsigned int line, void *obj, LONG exp) ok_(__FILE__, line)(exp == ref, "Unexpected refcount %lu, expected %lu\n", ref, exp); } -#define check_interface(obj, iid, exp) check_interface_(__LINE__, obj, iid, exp) -static void check_interface_(unsigned int line, void *obj, const IID *iid, BOOL supported) +#define check_interface(obj, iid, exp) check_interface_(__LINE__, obj, iid, exp, FALSE) +#define check_optional_interface(obj, iid, exp) check_interface_(__LINE__, obj, iid, exp, TRUE) +static void check_interface_(unsigned int line, void *obj, const IID *iid, BOOL supported, BOOL optional) { IUnknown *iface = obj; HRESULT hr, expected_hr; @@ -83,7 +84,7 @@ static void check_interface_(unsigned int line, void *obj, const IID *iid, BOOL expected_hr = supported ? S_OK : E_NOINTERFACE; hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); - ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr); + ok_(__FILE__, line)(hr == expected_hr || broken(hr == E_NOINTERFACE && optional), "Got hr %#lx, expected %#lx.\n", hr, expected_hr); if (SUCCEEDED(hr)) IUnknown_Release(unk); } @@ -1017,11 +1018,37 @@ static void test_SpeechSynthesizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + /* Test ISpeechSynthesizer2 iface */ hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechSynthesizer2, (void **)&synthesizer2); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1703 */ if (hr == S_OK) { + ISpeechSynthesizerOptions *options; + + hr = ISpeechSynthesizer2_get_Options(synthesizer2, &options); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + if (hr == S_OK) + { + ISpeechSynthesizerOptions3 *options3; + + check_interface(options, &IID_IAgileObject, TRUE); + check_optional_interface(options, &IID_ISpeechSynthesizerOptions2, TRUE); /* Requires Win10 >= 1709 */ + + hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions3, (void **)&options3); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1803 */ + + if (hr == S_OK) + { + ref = ISpeechSynthesizerOptions3_Release(options3); + ok(ref == 2, "Got unexpected ref %lu.\n", ref); + } + + ref = ISpeechSynthesizerOptions_Release(options); + ok(ref == 1, "Got unexpected ref %lu.\n", ref); + } + ref = ISpeechSynthesizer2_Release(synthesizer2); ok(ref == 3, "Got unexpected ref %lu.\n", ref); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/708
From: Bernhard K��lbl <besentv(a)gmail.com> --- dlls/windows.media.speech/tests/speech.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 339f57190ad..1beb5d9ebcc 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -59,6 +59,7 @@ HRESULT WINAPI (*pDllGetActivationFactory)(HSTRING, IActivationFactory **); static BOOL is_win10_1507 = FALSE; +static BOOL is_win10_1709 = FALSE; static inline LONG get_ref(IUnknown *obj) { @@ -1044,6 +1045,8 @@ static void test_SpeechSynthesizer(void) ref = ISpeechSynthesizerOptions3_Release(options3); ok(ref == 2, "Got unexpected ref %lu.\n", ref); } + else + is_win10_1709 = TRUE; ref = ISpeechSynthesizerOptions_Release(options); ok(ref == 1, "Got unexpected ref %lu.\n", ref); @@ -1477,10 +1480,14 @@ static void test_SpeechRecognitionListConstraint(void) hr = ISpeechRecognitionListConstraintFactory_CreateWithTag(listconstraint_factory, NULL, NULL, &listconstraint); ok(hr == E_POINTER, "ISpeechRecognitionListConstraintFactory_Create failed, hr %#lx.\n", hr); - /* The create functions on Win10 1507 x32 break when handling the given iterator. Seems like a Windows bug. Skipping these tests. */ - if (broken(is_win10_1507 && (sizeof(void*) == 4))) + /* + * The create functions break on Win10 <= 1709 x32 with the given iterator. + * Seems like a Windows bug, but if you see an issue in the test's code, please FIXME. + * Skipping these tests. + */ + if (broken((is_win10_1507 || is_win10_1709) && (sizeof(void*) == 4))) { - win_skip("SpeechRecognitionListConstraint object creation broken on Win10 1507 x32!\n"); + win_skip("SpeechRecognitionListConstraint object creation broken on Win10 <= 1709 x32!\n"); goto skip_create; } @@ -1628,10 +1635,14 @@ static void test_Recognition(void) ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr); } - /* The create functions for ListConstraint are broken on Win10 1507 x32 - abort early.*/ - if (broken(is_win10_1507 && (sizeof(void*) == 4))) + /* + * The create functions break on Win10 <= 1709 x32 with the given iterator. + * Seems like a Windows bug, but if you see an issue in the test's code, please FIXME. + * Skipping these tests. + */ + if (broken((is_win10_1507 || is_win10_1709) && (sizeof(void*) == 4))) { - win_skip("SpeechRecognitionListConstraint object creation broken on Win10 1507 x32!\n"); + win_skip("SpeechRecognitionListConstraint object creation broken on Win10 <= 1709 x32!\n"); goto done; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/708
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=122087 Your paranoid android. === w1064v1507 (64 bit report) === windows.media.speech: speech.c:1802: Test failed: Wait for put_thread failed.
participants (2)
-
Bernhard Kölbl -
Marvin