Rémi Bernon (@rbernon) commented about dlls/mf/tests/transform.c:
winetest_push_context("%s", debugstr_a(attr->name));
hr = IMFMediaType_DeleteItem(media_type, attr->key); ok_(__FILE__, line)(hr == S_OK, "DeleteItem returned %#lx\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); todo_wine_if(attr->todo) ok_(__FILE__, line)(FAILED(hr) == attr->required, "SetInputType returned %#lx.\n", hr);
if (attr->required_set)
{
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok_(__FILE__, line)(FAILED(hr), "SetInputType Succeeded.\n");
hr = IMFTransform_SetInputType(transform, 0, NULL, 0);
ok_(__FILE__, line)(hr == S_OK, "Failed to clear input type.\n");
}
So, I understand this is to check that after a media type has been set with some specific attribute you cannot unset the media type? But can you still change it? Change the value of the attribute?
I'm a bit unsure that doing this check here is safe. I think it might have side effects on other attribute, and makes the later iteration results less reliable.
Maybe a separate helper to check that would be better?