Zebediah Figura : quartz/filtergraph: Add tests for asynchronous state change.

Alexandre Julliard julliard at winehq.org
Fri Jun 21 16:44:16 CDT 2019


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Jun 20 20:13:20 2019 -0500

quartz/filtergraph: Add tests for asynchronous state change.

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

---

 dlls/quartz/tests/filtergraph.c | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index d89c9e2..aec9392 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -1163,6 +1163,8 @@ struct testfilter
     struct testpin *pins;
     unsigned int pin_count, enum_idx;
 
+    HRESULT state_hr;
+
     IAMFilterMiscFlags IAMFilterMiscFlags_iface;
     ULONG misc_flags;
 
@@ -1344,7 +1346,7 @@ static HRESULT WINAPI testfilter_Stop(IBaseFilter *iface)
     check_state_transition(filter, State_Stopped);
 
     filter->state = State_Stopped;
-    return S_OK;
+    return filter->state_hr;
 }
 
 static HRESULT WINAPI testfilter_Pause(IBaseFilter *iface)
@@ -1355,7 +1357,7 @@ static HRESULT WINAPI testfilter_Pause(IBaseFilter *iface)
     check_state_transition(filter, State_Paused);
 
     filter->state = State_Paused;
-    return S_OK;
+    return filter->state_hr;
 }
 
 static HRESULT WINAPI testfilter_Run(IBaseFilter *iface, REFERENCE_TIME start)
@@ -1367,7 +1369,7 @@ static HRESULT WINAPI testfilter_Run(IBaseFilter *iface, REFERENCE_TIME start)
 
     filter->state = State_Running;
     filter->start_time = start;
-    return S_OK;
+    return filter->state_hr;
 }
 
 static HRESULT WINAPI testfilter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state)
@@ -1376,7 +1378,7 @@ static HRESULT WINAPI testfilter_GetState(IBaseFilter *iface, DWORD timeout, FIL
     if (winetest_debug > 1) trace("%p->GetState(%u)\n", filter, timeout);
 
     *state = filter->state;
-    return S_OK;
+    return filter->state_hr;
 }
 
 static HRESULT WINAPI testfilter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
@@ -2954,6 +2956,7 @@ static void test_filter_state(void)
     IReferenceClock *clock;
     IMediaControl *control;
     IMediaFilter *filter;
+    OAFilterState state;
     HRESULT hr;
     ULONG ref;
 
@@ -3094,6 +3097,34 @@ todo_wine
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     check_filter_state(graph, State_Stopped);
 
+    sink.state_hr = S_FALSE;
+    hr = IMediaControl_Pause(control);
+    ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+    sink.state_hr = VFW_S_STATE_INTERMEDIATE;
+    hr = IMediaControl_GetState(control, 0, &state);
+    todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %u.\n", state);
+
+    sink.state_hr = VFW_S_CANT_CUE;
+    hr = IMediaControl_GetState(control, 0, &state);
+    todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %u.\n", state);
+
+    sink.state_hr = VFW_S_STATE_INTERMEDIATE;
+    source.state_hr = VFW_S_CANT_CUE;
+    hr = IMediaControl_GetState(control, 0, &state);
+    todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %u.\n", state);
+
+    sink.state_hr = VFW_S_CANT_CUE;
+    source.state_hr = VFW_S_STATE_INTERMEDIATE;
+    hr = IMediaControl_GetState(control, 0, &state);
+    todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr);
+    ok(state == State_Paused, "Got state %u.\n", state);
+
+    sink.state_hr = source.state_hr = S_OK;
+
     /* Destroying the graph while it's running stops all filters. */
 
     hr = IMediaFilter_Run(filter, 0);




More information about the wine-cvs mailing list