[PATCH v3 4/5] windows.media.speech/tests: Add a test for IAsyncOperation_get_Completed.

Bernhard Kölbl wine at gitlab.winehq.org
Fri May 13 09:42:42 CDT 2022


From: Bernhard Kölbl <besentv at gmail.com>

This one actually retrieves a handler.

Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
---
 dlls/windows.media.speech/tests/speech.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index 13732a2499b..ec235542d58 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -863,7 +863,7 @@ static void test_SpeechRecognizer(void)
     HANDLE put_thread;
     HRESULT hr, error_code;
     UINT32 id;
-    LONG ref;
+    LONG ref, old_ref;
 
     hr = RoInitialize(RO_INIT_MULTITHREADED);
     ok(hr == S_OK, "RoInitialize failed, hr %#lx.\n", hr);
@@ -1140,6 +1140,16 @@ static void test_SpeechRecognizer(void)
         ok(!WaitForSingleObject(compilation_handler.event_finished, 5000), "Wait for event_finished failed.\n");
         ok(WaitForSingleObject(compilation_handler.event_unblock, 100) == WAIT_TIMEOUT, "Wait for event_unblock didn't time out.\n");
 
+        handler = (void*)0xdeadbeef;
+        old_ref = compilation_handler.ref;
+        hr = IAsyncOperation_SpeechRecognitionCompilationResult_get_Completed(operation, &handler);
+        ok(hr == S_OK, "IAsyncOperation_SpeechRecognitionCompilationResult_get_Completed failed, hr %#lx.\n", hr);
+        todo_wine ok(handler == &compilation_handler.IAsyncHandler_Compilation_iface, "Handler was %p.\n", handler);
+
+        ref = compilation_handler.ref - old_ref;
+        todo_wine ok(ref == 1, "The ref was increased by %lu.\n", ref);
+        if (handler) IAsyncOperationCompletedHandler_SpeechRecognitionCompilationResult_Release(handler);
+
         hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info);
         ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/34



More information about the wine-devel mailing list