From: Gijs Vermeulen Subject: [PATCH 3/5] amstream/tests: Add more AMVideoStream::QueryAccept tests. Message-Id: <20200630150810.94561-3-gijsvrm@gmail.com> Date: Tue, 30 Jun 2020 17:08:08 +0200 In-Reply-To: <20200630150810.94561-1-gijsvrm@gmail.com> References: <20200630150810.94561-1-gijsvrm@gmail.com> Signed-off-by: Gijs Vermeulen --- dlls/amstream/tests/amstream.c | 36 ++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 9a97b6be65..8f6054015a 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -27,6 +27,7 @@ #include "ks.h" #include "initguid.h" #include "ksmedia.h" +#include "dvdmedia.h" #include "wine/strmbase.h" static const WAVEFORMATEX audio_format = @@ -1859,7 +1860,11 @@ static void test_enum_media_types(void) static void test_media_types(void) { + static const VIDEOINFOHEADER2 req_vih2 = {}; static const VIDEOINFOHEADER req_vih = {}; + static const MPEG2VIDEOINFO req_m2vi = {}; + static const MPEG1VIDEOINFO req_m1vi = {}; + static const WAVEFORMATEX req_wfx = {}; static const WAVEFORMATEX expect_wfx = { .wFormatTag = WAVE_FORMAT_PCM, @@ -1879,6 +1884,20 @@ static void test_media_types(void) HRESULT hr; IPin *pin; + struct { + GUID type; + BYTE *format; + ULONG size; + } tests[] = { + { GUID_NULL, NULL, 0 }, + { FORMAT_None, NULL, 0 }, + { FORMAT_WaveFormatEx, (BYTE *)&req_wfx, sizeof(WAVEFORMATEX) }, + { FORMAT_MPEG2Video, (BYTE *)&req_m2vi, sizeof(MPEG2VIDEOINFO) }, + { FORMAT_MPEGVideo, (BYTE *)&req_m1vi, sizeof(MPEG2VIDEOINFO) }, + { FORMAT_VideoInfo2, (BYTE *)&req_vih2, sizeof(VIDEOINFOHEADER2) }, + { FORMAT_VideoInfo, (BYTE *)&req_vih, sizeof(VIDEOINFOHEADER) } + }; + static const GUID *rejected_subtypes[] = { &MEDIASUBTYPE_RGB1, @@ -1918,14 +1937,15 @@ static void test_media_types(void) wine_dbgstr_guid(&pmt->formattype)); ok(!pmt->pUnk, "Got pUnk %p.\n", pmt->pUnk); - hr = IPin_QueryAccept(pin, pmt); - todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); - - pmt->formattype = FORMAT_VideoInfo; - pmt->cbFormat = sizeof(VIDEOINFOHEADER); - pmt->pbFormat = (BYTE *)&req_vih; - hr = IPin_QueryAccept(pin, pmt); - ok(hr == S_OK, "Got hr %#x.\n", hr); + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + pmt->formattype = tests[i].type; + pmt->cbFormat = tests[i].size; + pmt->pbFormat = tests[i].format; + hr = IPin_QueryAccept(pin, pmt); + todo_wine_if (i != 6) + ok(hr == (i == 6) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + } pmt->bFixedSizeSamples = FALSE; pmt->bTemporalCompression = TRUE; -- 2.27.0