Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/acmwrapper.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/avidec.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/avisplit.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/dsoundrender.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/filesource.c | 61 ++++++++++++++----------------- dlls/quartz/tests/mpegsplit.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/videorenderer.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/vmr7.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/vmr9.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/waveparser.c | 58 +++++++++++++++++++++++++++++ 10 files changed, 549 insertions(+), 34 deletions(-)
diff --git a/dlls/quartz/tests/acmwrapper.c b/dlls/quartz/tests/acmwrapper.c index 1f07e507830..035968b9e3e 100644 --- a/dlls/quartz/tests/acmwrapper.c +++ b/dlls/quartz/tests/acmwrapper.c @@ -441,6 +441,63 @@ todo_wine ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_acm_wrapper(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(acmwrapper) { CoInitialize(NULL); @@ -450,6 +507,7 @@ START_TEST(acmwrapper) test_enum_pins(); test_find_pin(); test_pin_info(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 19997e3c172..40d7b64f5f7 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -618,6 +618,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_avi_dec(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(avidec) { BOOL ret; @@ -634,6 +691,7 @@ START_TEST(avidec) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize();
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index ce0ea16a8e0..e17173b4cfc 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1015,6 +1015,63 @@ fail: DeleteFileW(filename); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_avi_splitter(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(avisplit) { IBaseFilter *filter; @@ -1036,6 +1093,7 @@ START_TEST(avisplit) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state(); test_filter_graph();
CoUninitialize(); diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index 8b7a1a52364..4f094e2c963 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -631,6 +631,63 @@ static void test_basefilter(void) IBaseFilter_Release(base); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_dsound_render(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(dsoundrender) { IBaseFilter *filter; @@ -657,6 +714,7 @@ START_TEST(dsoundrender) test_pin_info(); test_basic_audio(); test_enum_media_types(); + test_unconnected_filter_state(); test_basefilter();
CoUninitialize(); diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 37f8dd97cd0..f33ae1f971f 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -691,66 +691,59 @@ static void test_pin_info(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
-static void test_filter_state(void) +static void test_unconnected_filter_state(void) { IBaseFilter *filter = create_file_source(); - IMediaControl *control; - IFilterGraph2 *graph; FILTER_STATE state; HRESULT hr; ULONG ref;
- CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, - &IID_IFilterGraph2, (void **)&graph); - IFilterGraph2_AddFilter(graph, filter, NULL); - IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); - hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- hr = IMediaControl_Run(control); -todo_wine + hr = IBaseFilter_Pause(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Running, "Got state %d.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
- hr = IMediaControl_Stop(control); + hr = IBaseFilter_Run(filter, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
- hr = IMediaControl_Pause(control); -todo_wine + hr = IBaseFilter_Pause(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Paused, "Got state %d.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
- hr = IMediaControl_Run(control); -todo_wine + hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Running, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- hr = IMediaControl_Pause(control); -todo_wine + hr = IBaseFilter_Run(filter, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Paused, "Got state %d.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
- hr = IMediaControl_Stop(control); + hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- IMediaControl_Release(control); - IFilterGraph2_Release(graph); ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); } @@ -1197,7 +1190,7 @@ START_TEST(filesource) test_enum_pins(); test_find_pin(); test_pin_info(); - test_filter_state(); + test_unconnected_filter_state(); test_file_source_filter(); test_async_reader(); test_enum_media_types(); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 0281b67ce21..89e387a443b 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -997,6 +997,63 @@ static void test_enum_media_types(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_mpeg_splitter(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(mpegsplit) { IBaseFilter *filter; @@ -1018,6 +1075,7 @@ START_TEST(mpegsplit) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 985154f238b..7d3b2776177 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -528,6 +528,63 @@ static void test_basefilter(void) IBaseFilter_Release(base); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_video_renderer(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(videorenderer) { CoInitialize(NULL); @@ -539,6 +596,7 @@ START_TEST(videorenderer) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state(); test_basefilter();
CoUninitialize(); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index f9ca8930f30..53f979601e9 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -775,6 +775,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_vmr7(0); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr7) { CoInitialize(NULL); @@ -787,6 +844,7 @@ START_TEST(vmr7) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index f4a3017d3f7..80bb9303780 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -779,6 +779,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_vmr9(0); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr9) { IBaseFilter *filter; @@ -802,6 +859,7 @@ START_TEST(vmr9) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/waveparser.c b/dlls/quartz/tests/waveparser.c index 2e4cc914618..d1acaa531e4 100644 --- a/dlls/quartz/tests/waveparser.c +++ b/dlls/quartz/tests/waveparser.c @@ -761,6 +761,63 @@ static void test_enum_media_types(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_wave_parser(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(waveparser) { IBaseFilter *filter; @@ -782,6 +839,7 @@ START_TEST(waveparser) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); }