quartz/tests: Add tests for MPEG audio decoder unconnected filter state change.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2022-04-25 14:32:09 +07:00 committed by Alexandre Julliard
parent c4d4424358
commit 1a2697e58e
1 changed files with 65 additions and 0 deletions

View File

@ -210,12 +210,77 @@ static void test_aggregation(void)
ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
}
static void test_unconnected_filter_state(void)
{
IBaseFilter *filter;
FILTER_STATE state;
HRESULT hr;
ULONG ref;
filter = create_mpeg_audio_codec();
if (!filter)
{
skip("Failed to create MPEG audio decoder instance, skipping tests.\n");
return;
}
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(state == State_Stopped, "Got state %u.\n", state);
ref = IBaseFilter_Release(filter);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
START_TEST(mpegaudio)
{
CoInitialize(NULL);
test_interfaces();
test_aggregation();
test_unconnected_filter_state();
CoUninitialize();
}