Commit 84f89605 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

qcap/tests: Refactor interface testing.

parent f348b87b
...@@ -174,27 +174,12 @@ static void test_stream_config(IPin *pin) ...@@ -174,27 +174,12 @@ static void test_stream_config(IPin *pin)
IAMStreamConfig_Release(stream_config); IAMStreamConfig_Release(stream_config);
} }
static void test_capture(IBaseFilter *filter) static void test_pin_interfaces(IPin *pin)
{ {
IEnumPins *enum_pins;
IPin *pin;
HRESULT hr;
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
while ((hr = IEnumPins_Next(enum_pins, 1, &pin, NULL)) == S_OK)
{
PIN_DIRECTION pin_direction;
IPin_QueryDirection(pin, &pin_direction);
if (pin_direction == PINDIR_OUTPUT)
{
test_media_types(pin);
test_stream_config(pin);
todo_wine check_interface(pin, &IID_IAMBufferNegotiation, TRUE); todo_wine check_interface(pin, &IID_IAMBufferNegotiation, TRUE);
check_interface(pin, &IID_IAMStreamConfig, TRUE); check_interface(pin, &IID_IAMStreamConfig, TRUE);
todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE); todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE);
todo_wine check_interface(pin, &IID_IKsPin, TRUE);
check_interface(pin, &IID_IKsPropertySet, TRUE); check_interface(pin, &IID_IKsPropertySet, TRUE);
todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE); todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE);
check_interface(pin, &IID_IPin, TRUE); check_interface(pin, &IID_IPin, TRUE);
...@@ -209,12 +194,36 @@ static void test_capture(IBaseFilter *filter) ...@@ -209,12 +194,36 @@ static void test_capture(IBaseFilter *filter)
check_interface(pin, &IID_IAMVideoCompression, FALSE); check_interface(pin, &IID_IAMVideoCompression, FALSE);
check_interface(pin, &IID_IAMVideoProcAmp, FALSE); check_interface(pin, &IID_IAMVideoProcAmp, FALSE);
check_interface(pin, &IID_IPersistPropertyBag, FALSE); check_interface(pin, &IID_IPersistPropertyBag, FALSE);
check_interface(pin, &IID_IStreamBuilder, FALSE);
}
static void test_pins(IBaseFilter *filter)
{
IEnumPins *enum_pins;
IPin *pin;
HRESULT hr;
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
while ((hr = IEnumPins_Next(enum_pins, 1, &pin, NULL)) == S_OK)
{
PIN_DIRECTION pin_direction;
IPin_QueryDirection(pin, &pin_direction);
if (pin_direction == PINDIR_OUTPUT)
{
test_pin_interfaces(pin);
test_media_types(pin);
test_stream_config(pin);
} }
IPin_Release(pin); IPin_Release(pin);
} }
IEnumPins_Release(enum_pins); IEnumPins_Release(enum_pins);
}
static void test_filter_interfaces(IBaseFilter *filter)
{
check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IAMFilterMiscFlags, TRUE);
check_interface(filter, &IID_IAMVideoControl, TRUE); check_interface(filter, &IID_IAMVideoControl, TRUE);
check_interface(filter, &IID_IAMVideoProcAmp, TRUE); check_interface(filter, &IID_IAMVideoProcAmp, TRUE);
...@@ -287,7 +296,8 @@ START_TEST(videocapture) ...@@ -287,7 +296,8 @@ START_TEST(videocapture)
hr = IMoniker_BindToObject(moniker, NULL, NULL, &IID_IBaseFilter, (void**)&filter); hr = IMoniker_BindToObject(moniker, NULL, NULL, &IID_IBaseFilter, (void**)&filter);
if (hr == S_OK) if (hr == S_OK)
{ {
test_capture(filter); test_filter_interfaces(filter);
test_pins(filter);
test_misc_flags(filter); test_misc_flags(filter);
ref = IBaseFilter_Release(filter); ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment