Anton Baskanov : quartz/tests: Add tests for MPEG audio decoder IEnumMediaTypes.
Alexandre Julliard
julliard at winehq.org
Wed Apr 27 16:12:14 CDT 2022
Module: wine
Branch: master
Commit: c63b53326ced532e855a418e6c1b5ad22f1d3ade
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c63b53326ced532e855a418e6c1b5ad22f1d3ade
Author: Anton Baskanov <baskanov at gmail.com>
Date: Wed Apr 27 13:42:18 2022 +0700
quartz/tests: Add tests for MPEG audio decoder IEnumMediaTypes.
Signed-off-by: Anton Baskanov <baskanov at gmail.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/tests/mpegaudio.c | 76 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c
index 44e1a9ad2e6..5f851cb5973 100644
--- a/dlls/quartz/tests/mpegaudio.c
+++ b/dlls/quartz/tests/mpegaudio.c
@@ -526,6 +526,81 @@ static void test_pin_info(void)
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
+static void test_enum_media_types(void)
+{
+ IBaseFilter *filter = create_mpeg_audio_codec();
+ IEnumMediaTypes *enum1, *enum2;
+ AM_MEDIA_TYPE *mts[1];
+ ULONG ref, count;
+ HRESULT hr;
+ IPin *pin;
+
+ IBaseFilter_FindPin(filter, L"In", &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enum1);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+ ok(!count, "Got count %lu.\n", count);
+
+ hr = IEnumMediaTypes_Reset(enum1);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Clone(enum1, &enum2);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Skip(enum1, 1);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ IEnumMediaTypes_Release(enum1);
+ IEnumMediaTypes_Release(enum2);
+ IPin_Release(pin);
+
+ IBaseFilter_FindPin(filter, L"Out", &pin);
+
+ hr = IPin_EnumMediaTypes(pin, &enum1);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+ ok(!count, "Got count %lu.\n", count);
+
+ hr = IEnumMediaTypes_Reset(enum1);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Clone(enum1, &enum2);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Skip(enum1, 1);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+
+ IEnumMediaTypes_Release(enum1);
+ IEnumMediaTypes_Release(enum2);
+ IPin_Release(pin);
+
+ ref = IBaseFilter_Release(filter);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
+}
+
START_TEST(mpegaudio)
{
CoInitialize(NULL);
@@ -536,6 +611,7 @@ START_TEST(mpegaudio)
test_enum_pins();
test_find_pin();
test_pin_info();
+ test_enum_media_types();
CoUninitialize();
}
More information about the wine-cvs
mailing list