Nikolay Sivov : mf/tests: Skip some tests on missing function.

Alexandre Julliard julliard at winehq.org
Mon Feb 22 15:43:22 CST 2021


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Feb 22 19:55:48 2021 +0300

mf/tests: Skip some tests on missing function.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/tests/mf.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 65f2b40faa9..e3a752553bb 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -47,6 +47,8 @@ DEFINE_GUID(MFVideoFormat_ABGR32, 0x00000020, 0x0000, 0x0010, 0x80, 0x00, 0x00,
 
 #include "wine/test.h"
 
+static HRESULT (WINAPI *pMFCreateSampleCopierMFT)(IMFTransform **copier);
+
 #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
 static void _expect_ref(IUnknown* obj, ULONG expected_refcount, int line)
 {
@@ -4669,7 +4671,13 @@ static void test_sample_copier(void)
     UINT32 value;
     HRESULT hr;
 
-    hr = MFCreateSampleCopierMFT(&copier);
+    if (!pMFCreateSampleCopierMFT)
+    {
+        win_skip("MFCreateSampleCopierMFT() is not available.\n");
+        return;
+    }
+
+    hr = pMFCreateSampleCopierMFT(&copier);
     ok(hr == S_OK, "Failed to create sample copier, hr %#x.\n", hr);
 
     hr = IMFTransform_GetAttributes(copier, &attributes);
@@ -5005,7 +5013,10 @@ static void test_sample_copier_output_processing(void)
     HRESULT hr;
     BYTE *ptr;
 
-    hr = MFCreateSampleCopierMFT(&copier);
+    if (!pMFCreateSampleCopierMFT)
+        return;
+
+    hr = pMFCreateSampleCopierMFT(&copier);
     ok(hr == S_OK, "Failed to create sample copier, hr %#x.\n", hr);
 
     /* Configure for 16 x 16 of D3DFMT_X8R8G8B8. */
@@ -5152,8 +5163,19 @@ static void test_MFGetTopoNodeCurrentType(void)
     IMFMediaType_Release(media_type2);
 }
 
+static void init_functions(void)
+{
+    HMODULE mod = GetModuleHandleA("mf.dll");
+
+#define X(f) p##f = (void*)GetProcAddress(mod, #f)
+    X(MFCreateSampleCopierMFT);
+#undef X
+}
+
 START_TEST(mf)
 {
+    init_functions();
+
     test_topology();
     test_topology_tee_node();
     test_topology_loader();




More information about the wine-cvs mailing list