MR34v1 - windows.media.speech: Changes for IAsyncAction.

Rémi Bernon (@rbernon) wine at gitlab.winehq.org
Wed May 4 12:28:23 CDT 2022


Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/tests/speech.c:
> +    hr = IAsyncInfo_get_Id(info, &id);
> +    todo_wine ok(hr == S_OK, "IAsyncInfo_get_Id failed, hr %#lx.\n", hr);
> +    todo_wine ok(id != 0xdeadbeef, "Id was %#x.\n", id);
> +
> +    async_status = 0xdeadbeef;
> +    hr = IAsyncInfo_get_Status(info, &async_status);
> +    todo_wine ok(hr == S_OK, "IAsyncInfo_get_Status failed, hr %#lx.\n", hr);
> +    todo_wine ok(async_status == Completed, "Status was %#x.\n", async_status);
> +
> +    error_code = 0xdeadbeef;
> +    hr = IAsyncInfo_get_ErrorCode(info, &error_code);
> +    todo_wine ok(hr == S_OK, "IAsyncInfo_get_ErrorCode failed, hr %#lx.\n", hr);
> +    todo_wine ok(error_code == S_OK, "ErrorCode was %#lx.\n", error_code);
> +
> +    hr = IAsyncInfo_Cancel(info);
> +    todo_wine ok(hr == S_OK, "IAsyncInfo_Cancel failed, hr %#lx.\n", hr);
I'm not sure it's really useful to check again the IAsyncInfo interface. Sure, it's from a different IAsyncAction class but imho you can expect it to work the same way as the one you tested previously, otherwise you'll just have the same tests duplicated everywhere. It also makes the test purpose a little bit more obscure (which I believe is here to test the `StartAsync` / `StopAsync` functions?)

Alternatively, though I still don't think it means you need to do it every time you create an async, I think you could have a check_async_info helper that does all the checks at once with a few parameters to tell it what to expect (I have one in `dinput/tests/force_feedback.c`), and it'll save you the test duplication.

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



More information about the wine-devel mailing list