Commit b1ffe12e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

qedit/tests: Add some tests for media types.

parent f30248f3
...@@ -352,6 +352,33 @@ static void test_aggregation(void) ...@@ -352,6 +352,33 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref); ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
} }
static void test_media_types(void)
{
IBaseFilter *filter = create_null_renderer();
AM_MEDIA_TYPE mt = {}, *pmt;
IEnumMediaTypes *enummt;
HRESULT hr;
ULONG ref;
IPin *pin;
IBaseFilter_FindPin(filter, sink_id, &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
IEnumMediaTypes_Release(enummt);
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
IPin_Release(pin);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
START_TEST(nullrenderer) START_TEST(nullrenderer)
{ {
IBaseFilter *filter; IBaseFilter *filter;
...@@ -373,6 +400,7 @@ START_TEST(nullrenderer) ...@@ -373,6 +400,7 @@ START_TEST(nullrenderer)
test_find_pin(); test_find_pin();
test_pin_info(); test_pin_info();
test_aggregation(); test_aggregation();
test_media_types();
CoUninitialize(); CoUninitialize();
} }
...@@ -449,6 +449,39 @@ static void test_aggregation(void) ...@@ -449,6 +449,39 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref); ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
} }
static void test_media_types(void)
{
IBaseFilter *filter = create_sample_grabber();
IEnumMediaTypes *enummt;
AM_MEDIA_TYPE mt = {};
HRESULT hr;
ULONG ref;
IPin *pin;
IBaseFilter_FindPin(filter, sink_id, &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
IPin_Release(pin);
IBaseFilter_FindPin(filter, source_id, &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
todo_wine ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
hr = IPin_QueryAccept(pin, &mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
IPin_Release(pin);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %d.\n", ref);
}
START_TEST(samplegrabber) START_TEST(samplegrabber)
{ {
IBaseFilter *filter; IBaseFilter *filter;
...@@ -470,6 +503,7 @@ START_TEST(samplegrabber) ...@@ -470,6 +503,7 @@ START_TEST(samplegrabber)
test_find_pin(); test_find_pin();
test_pin_info(); test_pin_info();
test_aggregation(); test_aggregation();
test_media_types();
CoUninitialize(); CoUninitialize();
} }
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