Zebediah Figura : quartz/tests/filesource: Add some tests for filter state.

Alexandre Julliard julliard at winehq.org
Fri Feb 22 15:22:10 CST 2019


Module: wine
Branch: master
Commit: 9e7b8a2f2f76bc678063c7796d272cb387adba5d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9e7b8a2f2f76bc678063c7796d272cb387adba5d

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Feb 21 18:43:00 2019 -0600

quartz/tests/filesource: Add some tests for filter state.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/filesource.c | 65 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c
index d485211..ddf0709 100644
--- a/dlls/quartz/tests/filesource.c
+++ b/dlls/quartz/tests/filesource.c
@@ -602,6 +602,70 @@ todo_wine
     ok(ret, "Failed to delete file, error %u.\n", GetLastError());
 }
 
+static void test_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);
+
+    hr = IMediaControl_Run(control);
+todo_wine
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Running, "Got state %d.\n", state);
+
+    hr = IMediaControl_Stop(control);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Stopped, "Got state %d.\n", state);
+
+    hr = IMediaControl_Pause(control);
+todo_wine
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %d.\n", state);
+
+    hr = IMediaControl_Run(control);
+todo_wine
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Running, "Got state %d.\n", state);
+
+    hr = IMediaControl_Pause(control);
+todo_wine
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %d.\n", state);
+
+    hr = IMediaControl_Stop(control);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    hr = IBaseFilter_GetState(filter, 1000, &state);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    ok(state == State_Stopped, "Got state %d.\n", state);
+
+    IMediaControl_Release(control);
+    IFilterGraph2_Release(graph);
+    ref = IBaseFilter_Release(filter);
+    ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
 START_TEST(filesource)
 {
     CoInitialize(NULL);
@@ -610,6 +674,7 @@ START_TEST(filesource)
     test_enum_pins();
     test_find_pin();
     test_pin_info();
+    test_filter_state();
     test_file_source_filter();
 
     CoUninitialize();




More information about the wine-cvs mailing list