Lei Zhang : quartz: Add some IGraphBuilder related tests.

Alexandre Julliard julliard at winehq.org
Fri Dec 7 11:02:07 CST 2007


Module: wine
Branch: master
Commit: 646eefaa476995c387f8616a401c4dba6e2fccc8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=646eefaa476995c387f8616a401c4dba6e2fccc8

Author: Lei Zhang <thestig at google.com>
Date:   Wed Dec  5 20:10:54 2007 -0800

quartz: Add some IGraphBuilder related tests.

---

 dlls/quartz/tests/filtergraph.c |   47 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 8cbae7b..abdaa09 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -102,6 +102,52 @@ static void test_render_run(void)
     releasefiltergraph();
 }
 
+static void test_graph_builder(void)
+{
+    HRESULT hr;
+    IBaseFilter *pF = NULL;
+    IBaseFilter *pF2 = NULL;
+    IPin *pIn = NULL;
+    IEnumPins *pEnum = NULL;
+    PIN_DIRECTION dir;
+    static const WCHAR testFilterW[] = {'t','e','s','t','F','i','l','t','e','r',0};
+    static const WCHAR fooBarW[] = {'f','o','o','B','a','r',0};
+
+    if (!createfiltergraph())
+        return;
+
+    /* create video filter */
+    hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER,
+            &IID_IBaseFilter, (LPVOID*)&pF);
+    ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr);
+    ok(pF != NULL, "pF is NULL\n");
+
+    /* add the two filters to the graph */
+    hr = IGraphBuilder_AddFilter(pgraph, pF, testFilterW);
+    ok(hr == S_OK, "failed to add pF to the graph: %x\n", hr);
+
+    /* find the pins */
+    hr = IBaseFilter_EnumPins(pF, &pEnum);
+    ok(hr == S_OK, "IBaseFilter_EnumPins failed for pF: %x\n", hr);
+    ok(pEnum != NULL, "pEnum is NULL\n");
+    hr = IEnumPins_Next(pEnum, 1, &pIn, NULL);
+    ok(hr == S_OK, "IEnumPins_Next failed for pF: %x\n", hr);
+    ok(pIn != NULL, "pIn is NULL\n");
+    hr = IPin_QueryDirection(pIn, &dir);
+    ok(hr == S_OK, "IPin_QueryDirection failed: %x\n", hr);
+    ok(dir == PINDIR_INPUT, "pin has wrong direction\n");
+
+    hr = IGraphBuilder_FindFilterByName(pgraph, fooBarW, &pF2);
+    todo_wine {
+        ok(hr == VFW_E_NOT_FOUND, "IGraphBuilder_FindFilterByName returned %x\n", hr);
+    }
+    ok(pF2 == NULL, "IGraphBuilder_FindFilterByName returned %p\n", pF2);
+    hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, &pF2);
+    ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned %x\n", hr);
+    ok(pF2 != NULL, "IGraphBuilder_FindFilterByName returned NULL\n");
+    releasefiltergraph();
+}
+
 static void test_filter_graph2(void)
 {
     HRESULT hr;
@@ -119,5 +165,6 @@ START_TEST(filtergraph)
 {
     CoInitialize(NULL);
     test_render_run();
+    test_graph_builder();
     test_filter_graph2();
 }




More information about the wine-cvs mailing list