Rémi Bernon (@rbernon) commented about dlls/mf/tests/transform.c:
check_mft_get_input_current_type(transform, expect_input_type_desc); check_mft_get_input_stream_info(transform, S_OK, NULL);
- /* Input type attributes should match output type attributes. */
- for (i = 0; i < ARRAY_SIZE(to_set_attributes); ++i)
- {
winetest_push_context("attr %lu", i);
memcpy(type_desc, input_type_desc, sizeof(input_type_desc));
set_attribute_desc(type_desc, &to_set_attributes[i], 1);
check_mft_set_input_type(transform, type_desc, MF_E_INVALIDMEDIATYPE);
winetest_pop_context();
- }
Fwiw we don't *have* to use these helpers for every check, I think they are useful to set common check patterns, but in this case it seems specific to this transform and something like that would be simpler and save the need for a new helper:
``` hr = MFCreateMediaType(&media_type); ok(hr == S_OK, "MFCreateMediaType returned %#lx.\n", hr);
/* Input type attributes should match output type attributes. */ for (i = 0; i < ARRAY_SIZE(to_set_attributes); ++i) { winetest_push_context("attr %lu", i); init_media_type(media_type, input_type_desc, -1); hr = IMFMediaType_SetItem(media_type, to_set_attributes[i].key, &to_set_attributes[i].item); ok(hr == S_OK, "got %#lx.\n", hr); hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); ok(hr == MF_E_INVALIDMEDIATYPE, "got %#lx.\n", hr); winetest_pop_context(); }
IMFMediaType_Release(media_type); ```
I would even consider dropping the loop and making individual checks, to avoid having to look for the actual values that are checked, up to you.