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.