Rémi Bernon : mf/tests: Tweak topology loader tests results based on the video processor presence.

Alexandre Julliard julliard at winehq.org
Wed May 11 16:10:24 CDT 2022


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri May  6 09:17:50 2022 +0200

mf/tests: Tweak topology loader tests results based on the video processor presence.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/tests/mf.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index a32005863d3..cc6bec40234 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -65,6 +65,7 @@ DEFINE_GUID(DMOVideoFormat_RGB8, D3DFMT_P8, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x
 static HRESULT (WINAPI *pMFCreateSampleCopierMFT)(IMFTransform **copier);
 static HRESULT (WINAPI *pMFGetTopoNodeCurrentType)(IMFTopologyNode *node, DWORD stream, BOOL output, IMFMediaType **type);
 
+static BOOL has_video_processor;
 static BOOL is_vista(void)
 {
     return !pMFGetTopoNodeCurrentType;
@@ -1885,6 +1886,7 @@ enum loader_test_flags
     LOADER_EXPECTED_DECODER = 0x1,
     LOADER_EXPECTED_CONVERTER = 0x2,
     LOADER_TODO = 0x4,
+    LOADER_NEEDS_VIDEO_PROCESSOR = 0x8,
 };
 
 static void test_topology_loader(void)
@@ -1972,7 +1974,7 @@ static void test_topology_loader(void)
 
             MF_CONNECT_ALLOW_CONVERTER,
             S_OK,
-            LOADER_EXPECTED_CONVERTER | LOADER_TODO,
+            LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_EXPECTED_CONVERTER | LOADER_TODO,
         },
 
         {
@@ -2021,7 +2023,7 @@ static void test_topology_loader(void)
 
             MF_CONNECT_ALLOW_CONVERTER,
             MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION,
-            LOADER_TODO,
+            LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_TODO,
         },
 
         {
@@ -2185,9 +2187,14 @@ static void test_topology_loader(void)
         ok(!count, "Unexpected count %u.\n", count);
 
         hr = IMFTopoLoader_Load(loader, topology, &full_topology, NULL);
-        todo_wine_if(test->flags & LOADER_TODO)
-        ok(hr == test->expected_result, "Unexpected hr %#lx on test %u.\n", hr, i);
-        ok(full_topology != topology, "Unexpected instance.\n");
+        if (test->flags & LOADER_NEEDS_VIDEO_PROCESSOR && !has_video_processor)
+            ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx on test %u.\n", hr, i);
+        else
+        {
+            todo_wine_if(test->flags & LOADER_TODO)
+            ok(hr == test->expected_result, "Unexpected hr %#lx on test %u.\n", hr, i);
+            ok(full_topology != topology, "Unexpected instance.\n");
+        }
 
         if (test->expected_result == S_OK && hr == S_OK)
         {
@@ -3629,6 +3636,7 @@ static void test_video_processor(void)
             transform_inputs, ARRAY_SIZE(transform_inputs), transform_outputs, ARRAY_SIZE(transform_outputs),
             &transform, &CLSID_VideoProcessorMFT, &class_id))
         goto failed;
+    has_video_processor = TRUE;
 
     todo_wine
     check_interface(transform, &IID_IMFVideoProcessorControl, TRUE);
@@ -8183,6 +8191,7 @@ START_TEST(mf)
         return;
     }
 
+    test_video_processor();
     test_topology();
     test_topology_tee_node();
     test_topology_loader();
@@ -8195,7 +8204,6 @@ START_TEST(mf)
     test_presentation_clock();
     test_sample_grabber();
     test_sample_grabber_is_mediatype_supported();
-    test_video_processor();
     test_quality_manager();
     test_sar();
     test_evr();




More information about the wine-cvs mailing list